External dll packing with NPAPI Plugin extension - plugins

I created an NPAPI plugin. It uses two other Dlls.
I need to pack those Dll files along with Plugin dll as Extension.
How can I do that? So that I can Place that dll to any folder and register it.
Is there any way to do this?
Sorry if its a duplicate.
thanks in advance.

If you pack it as an extension, you just put the two DLLs you need in the same directory in the extension as the plugin DLL.
Note that some browsers the search path may have difficulties finding those DLLs; if you find this to be the case you could try DELAYLOAD linking those DLLs and use SetDllDirectory to add the plugin dll directory to the path.

Related

UnityEngine.UI outside of Unity Environment

I am trying to compile several scripts in my project into an easier to move and manage DLL file, however several scripts call UnityEngine.UI, and I know that the DLL file used to exist in /Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll however the only data I can find for it now are the uncompiled files inside the Package Manager, where is the compiled DLL stored now?
The simplest answer that I just found is to look in the project folder of one of your projects in Library\ScriptAssemblies

MEF With Portable Class library using Microsoft Composition MEF2 throws file not found exception

I am working on Portable Class Library(PCL) and trying to achieve MEF in that. I used System.Composition from Nuget. When i build and package for vsix (Extension for Visual Studio) it doesn't package and place those dll's to extension folder
(C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\14.0Exp\Extensions\ExtensionName\AppName\versionofYourApp). When i manually place those library in this folder it works fine. Can some one suggest a good solution to this problem. I am writing it for Roslyn Analyzers and creating a nuget package. Again i am facing the same issue, even if i am packaging those library together.
Set Copy Local to true in the VSIX's reference to the MEF DLLs.
I found a solution, thought of sharing. You are welcome to correct and suggest. For Vsix extension i added those library as an asset(VisualStudio.Assembly) from local.
And for packages, Assembly.Load("AssemblyName") was trying to load library from all possible locations like " C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies" and many. So i placed it there and it was getting loaded. I know this is not the best solution. You are most welcome to suggest.

Installing NuGet packages to custom folder in a project in Visual Studio 2015

I have a Visual Studio 2015 solution with many projects. For one of the projects I would like the files from NuGet to download to a specific folder in my project. For example, I intend to use Bootstrap and also Signalr. I would like Bootstrap to download everything into one folder in my application, and not create folders within my project root. For example, I have a folder called 'Libs' in the project and would like those libraries to use 'Libs' as their root folder. This is due to an external build solution that handles everything in the 'Libs' folder.
I've found these docs about using a NuGet.config folder for the solution, but this does not handle my problem. Any ideas?
As far as I'm aware, this isn't possible. Each Nuget package is written with specific instructions on how to install into a project. One of those instructions is where to put files, another example would be what transform to apply to the web.config. Nuget doesn't specify a way to modify these instructions. The only thing you could do would be to modify the packages yourself - download the .nupkg file and open it up as a zip file, you will be able to edit the folder structure from there.

What is the recommended way to copy a .NET exe and its DLLs with a NuGet package

I am creating a NuGet package, which is a library DLL. I did this successfully.
However I would like to have a .NET exe (and its dependent assemblies) also in the target machine. It is completely OK if the .exe and these dlls are under the solution's package folder.
If it is possible I do not want to create a standard Windows installer and run it silently.
Thanks in advance
You'll have to edit your .nuspec file. You can include a element to include additional files in your package. Look at what else you can do by looking at the specs.
You can run your exe by creating a powershell script during package installation.
Starting from NuGet 2.0 a package can contain a "tools" folder. Here you can put exe, scripts and so on.
http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Framework_Version_Folder_Structure
Binary under this folder will not be referenced, just copied on the machine.
Hope it helps.

How to create NuGet package that add only JavaScript/CSS to web-based project?

I have some NuGet package that contains both DLL file and web related files like JavaScript, Stylesheet and image files. I want to create package that only install web related file to web project only (including ASP.NET and ASP.NET MVC project). What is the easiest way to do that?
Thanks,
PS. I think it should be possible via Powershell script. But I think, it is quite complex for me.
You probably want to use the Nuget Package Explorer. It allows you to create a package without the command line and add only the required files to your package (plus some easy config).
If I understand you correctly, you sometimes want to install just the DLL, and sometimes the DLL plus the web stuff. In this case it's best to create a separate package for the DLL, then another package with the web stuff which specifies the DLL package as a dependency of the Web package. This way it will automatically add the DLL when you add the Web content.
Here's a tutorial on Nuget Package Explorer that will probably help you.
I have a solution which I am using in several projects which works pretty nicely.
Create a second .Assets project, which contains the Assets, and reference all the files as links in your project, and mark them as embedded resources.
YourProject.Assets - contains the css/html/js/cshtml files
YourProject - files included as links, marked as Embedded Resource
Then include my EmbeddedResourceVirtualPathProvider Nuget package, and it will serve you assets from the Embedded Resources in YourProject.dll.
If someones wants to override the resources, they can install the .Assets nuget package and they will be included in their project and served.