Thanks in advance for your help, I appreciate it! I am looking for some direction on successfully referencing a normal (Non-ASP NET) Class Library FROM an ASP.NET 5 project and have it successfully publish. The catch is that the Class Library uses references to packages brought in from Nuget.
Here are the details and how to reproduce:
- New ASP.NET 5 Solution and Website.
- Change reference to dnx46
- Remove dnxcore.
- Add a new Class Library and target .NET 4.6.
- Add a nuget package to the Class Library (For Example, add EntityFramework 6.1.3)
- Issue Command "dnu wrap .
Add the dependency to the the web project.json:
"frameworks": { "dnx46": { "dependencies": { "ClassLibrary": "1.0.0-*" } } }
At this point, we have the "ClassLibrary" "wrapped" in the "wrap" folder.
The solution and project starts up without an issue, all dependencies are found and resolved. Everything compiles and it runs on IIS Express without issue.
Now if you try and perform a "Local Publish" to deploy to IIS, it will complain that the reference to "EntityFramework 6.1.3" found within the "wrap" project.json cannot be resolved.
After trying this out multiple ways, I think it's because the "EntityFramework" DLL from the nuget packages folder never officially gets wrapped. Somehow this doesn't cause an issue when running on IIS Express but causes an issue when publishing. Although I've used "EntityFramework" as an example, you could have used any reference from Nuget.
Has anyone experienced this before, and if so, how did you resolve it?