Reputation: 798
I am using Visual Studio Community 2015 RC. I have created an ASP.NET 5 / MVC 6 project.
Now I want to add a (.NET) DLL to the project but if I open the dialog “Add Reference...” I am not able to browse any folders outside the solution. The browse button is missing.
Is there any other way to add a reference to the project at compile time?
A class library (as a NuGet package) is not a solution because here is the same problem. If I create, say, a WPF application the browse button is available.
Upvotes: 2
Views: 10042
Reputation: 368
In order to Add additional dll or third party dll in MVC6 please follow below steps.
Now you will be able to find it under DNX 4.5.1
Upvotes: 4
Reputation: 798
The following procedure worked for me:
Add a new project for creating a (classic) C# class library (.dll) to the solution.
Add the external DLLs to the class library project by right clicking on “References” and then select “Browse…”. Find and add the DLLs to the class library project.
Reference the class library in the web project by right clicking on “References”, select “Projects” and then “Solution”.
The Packages of the web project are restored and the project.json is modified automatically.
"frameworks": {
"dnx451": {
"dependencies": {
"ClassLib1": "1.0.0-*"
}
}
Upvotes: 0
Reputation: 13676
Not sure how are you going to add reference to assembly dynamically if you haven't loaded it yet. But you can just load your assembly from a file with :
Assembly.LoadFrom("MyAssembly.dll");
Upvotes: 0