Dependency conflict
I am not sure what is the reason but I am suspecting a Newtonsoft dependency conflict. I have an asp.net core rc2 web app (.net framework) and a class library with entity framework core installed. When I run the app I get following error
An exception of type 'System.IO.FileLoadException' occurred in Microsoft.Extensions.Configuration.FileExtensions.dll but was not handled in user code
Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
You can find the app here
https://github.com/pantonis/AspNetRC2EFCore
Managed to reproduce it again. Please pull latest changes from repository mentioned above
@davidfowl @anurse can you guys take a quick look at this? Should this move to the CLI repo? Or tooling?
BTW I set up a quick mtg for Monday to discuss this.
@pantonis we looked into this issue and it turns out to be an issue with .NET CLI and NuGet.
I moved the bug to here: https://github.com/dotnet/cli/issues/3205
Thanks, Eilon
Is there any workaround? I m currently blocked and cannot start working on my project. Deadlines are pushing me.
Thanks.
@pantonis I think that if you wrap the project manually by creating your own project.json that just includes a reference to the bin/*.dll file, you can then reference that from your main app's project.json file. The problem you're encountering here is due to the project type reference, which is where the NuGet/.NET CLI bug gets tripped up and doesn't know which "other" DLLs to grab from the bin folder of the csproj.
@Eilon project.json in a .net class library?
@pantonis you'd have something like this:
/src/ClassLibrary/
MyProj.csproj
packages.config
/src/ClassLibraryWrapped
project.json (that points to ../ClassLibrary/bin/Release/MyProj.dll)
/src/MyWebSite
project.json (that points to ClassLibraryWrapped)
Thanks.
I have more than 10 class libraries. This will cause me a mess. Please fix the problem as soon as possible because I think the majority of people will have same problem. I already saw a lot of people complaining on the same problems with .csproj and .xproj incompatibilities.
@pantonis indeed, I agree this bug is very cumbersome to work around. I recommend adding a comment to https://github.com/dotnet/cli/issues/3205 to further voice your urgency.
Hi all, is this problem resolved yet? Thanks.
This f'in ridiculous! I've now spent the entire afternoon trying to understand why a reference added using the "Add Reference" in Visual Studio works, yet simply adding the example same declaration directly in the project.json doesn't.
@sayedihashimi @BillHiebert @barrytang do you guys know the right place to track the status of this work? The Tooling repo? A CLI repo? Another place?
Ah, it seems that https://github.com/NuGet/Home/issues/2865 is the right place to track the status of this fix. Please add your thoughts to that issue if they're not already tracked there. Thanks!