Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Dependency conflict #4680

Closed
pantonis opened this issue May 19, 2016 · 14 comments
Closed

Dependency conflict #4680

pantonis opened this issue May 19, 2016 · 14 comments
Labels

Comments

@pantonis
Copy link

pantonis commented May 19, 2016

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

@pantonis
Copy link
Author

pantonis commented May 21, 2016

Managed to reproduce it again. Please pull latest changes from repository mentioned above

@pantonis pantonis reopened this May 21, 2016
@Eilon
Copy link
Member

Eilon commented May 22, 2016

@davidfowl @anurse can you guys take a quick look at this? Should this move to the CLI repo? Or tooling?

@Eilon
Copy link
Member

Eilon commented May 22, 2016

BTW I set up a quick mtg for Monday to discuss this.

@Eilon
Copy link
Member

Eilon commented May 23, 2016

@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

@Eilon Eilon closed this as completed May 23, 2016
@Eilon Eilon added the external label May 23, 2016
@pantonis
Copy link
Author

Is there any workaround? I m currently blocked and cannot start working on my project. Deadlines are pushing me.

Thanks.

@Eilon
Copy link
Member

Eilon commented May 24, 2016

@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.

@pantonis
Copy link
Author

@Eilon project.json in a .net class library?

@Eilon
Copy link
Member

Eilon commented May 24, 2016

@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)

@pantonis
Copy link
Author

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.

@Eilon
Copy link
Member

Eilon commented May 24, 2016

@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.

@karthicktv
Copy link

Hi all, is this problem resolved yet? Thanks.

@DaveSlinn
Copy link

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.

@Eilon
Copy link
Member

Eilon commented Sep 15, 2016

@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?

@Eilon
Copy link
Member

Eilon commented Sep 16, 2016

Ah, it seems that NuGet/Home#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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants