-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2017RC3 - Assembly conflicts because of the same name #1386
Comments
@nguerrera @dsplaisted What's a recommendation for James here? He basically needs our "project overrides package ref" feature that we haven't written yet. |
This is dotnet/sdk#364 Cc @mattwar There's a workaround shown there. Try it with Foo replaced by Newtonsoft.Json. |
dotnet/sdk#364 does not repro with more recent VS. Possibly this is already solved too. The repro I tried had a referenced project building a fake Newtonsof.Json.dll and nuget reference of the actual Newtonsof.Json.dll. The project wins over the nuget package in the build and in the IDE. |
Ok, I'll try it tonight |
I get the same warnings and error messages after adding the XML work around.
Output
|
@mattwar Bear in mind that |
Hey, you can't call us externals. That's our word. |
Fixed. |
Is this a bug that will require an updated version of VS2017? Right now this is blocking me from porting Newtonsoft.Json from project.json to csproj. |
@JamesNK We can't repro the bug right now. @dsplaisted's going to spend a little bit of time looking into it. Have you tried the latest RC build? |
@JamesNK Hi James, is this the branch you're working on and encountering these issues?: https://github.com/JamesNK/Newtonsoft.Json/tree/vs2017 |
Yes I installed it last night. I believe the version number was updated in the sln file here JamesNK/Newtonsoft.Json@bd3d201#diff-7943d585b13cd19598be20000ad7867fR4 |
Yes it is. Add |
Hmmm, although I think I still need to update the test project csproj to only include the NUnit package when the target isn't |
What do you mean by "corrupted"? |
git still thinks the new VS2017 csproj files are binary for some reason 🤷♂️ |
@JamesNK At one point we had issues where we would corrupt the encoding of .csproj files. That may have been what happened to you. I gave up on trying to fix them and did a new migrate from scratch. The way this is supposed to work is that the ProjectReference should replace the PackageReference to Newtonsoft.Json. This wasn't happening because the project name was Newtonsoft.Json.Dotnet.csproj, so it was assuming that the package ID for the project would be Newtonsoft.Json.Dotnet. You can specify the package ID and version (so you don't get downgrade warnings) by adding the following properties to your project: <Version>9.0.3</Version>
<PackageId>Newtonsoft.Json</PackageId> This fixes the issue for command-line restore and build. However, the PackageId property isn't being respected when Visual Studio runs the restore, so in VS you would still see the same issues. I've filed #1532 for this. |
I probably lost |
Ok, this is successfully compiling https://github.com/JamesNK/Newtonsoft.Json/commits/vs2017 However I am getting errors in VS when a file is open. I'll post details in a bit. |
Hmmm, the errors that I'm getting when a file is open seem to have disappeared. Maybe adding PackageId fixed it. |
Consider it fixed. One last question - Is there a way to suppress this warning:
|
No, you suppress it by fixing it. :) This is saying "one of your references is referencing a dll that is higher than what you are referencing". Post a diagnostic log and I can tell what it is. |
The issue is the |
Do you mean the build output window content with the level set to diagnostic? I tried building with that but VS froze with the CPU spinning at 20%. Might be a bug there. |
Yeah that's #1242, will be fixed in the next public build. Should unfreeze after a while. |
Log attached. I think some of the first build is truncated. |
Relevant portion:
This is microsoft/vstest#393. |
Ok! Closed |
I filed dotnet/msbuild#1712 against MSBuild because I hate this warning. |
❤️ |
I have an interesting situation: I have a project called
Newtonsoft.Json
that I want to test innetcoreapp1.0
, but theMicrosoft.NET.Test.Sdk
package that I have to depend on to run tests has a dependency on a NuGet package calledNewtonsoft.Json
.I get this warning when I build in VS2017RC3:
And lots of this error:
How do I tell the Roslyn/msbuild/.NET Core that I want the referenced
Newtonsoft.Json
project to be used?The text was updated successfully, but these errors were encountered: