Recently we've started upgrading all our projects to MVC5. I've done 4 other projects without issue but for some reason this one is throwing 95 warnings.
ASPNETCOMPILER : warning CS1701: Assuming assembly reference 'System.Web.Mvc,
Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' matches 'Sy
stem.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
', you may need to supply runtime policy
Now I am completely aware of what this warning normally means. I have looked EVERYWHERE for an incorrect reference, checked every single dependency, even gone so far as to grep every single file in my project folder. I feel like I've wasted days on this and its driving me bonkers!
Does anyone have any suggestions on debugging this issue?
Related
I have a project file targeting net 472. It depends on a bunch of libraries that are built against netstandard2. Some of those libraries depend upon the Microsoft.Extensions.Primitives library although (as far as I can tell) there is no directly dependency from the root project. When I build it, I see this warning...
Severity Code Description Project File Line Suppression State
Warning Found conflicts between different versions of "Microsoft.Extensions.Primitives" that could not be resolved.
There was a conflict between "Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.Primitives, Version=5.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60".
"Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.Extensions.Primitives, Version=5.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
References which depend on "Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll].
C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll
Project file item includes which caused reference "C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll".
C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll
References which depend on "Microsoft.Extensions.Primitives, Version=5.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
C:\Users\neilm\.nuget\packages\lazycache\2.1.3\lib\netstandard2.0\LazyCache.dll
Project file item includes which caused reference "C:\Users\neilm\.nuget\packages\lazycache\2.1.3\lib\netstandard2.0\LazyCache.dll".
C:\Users\neilm\.nuget\packages\lazycache\2.1.3\lib\netstandard2.0\LazyCache.dll
D:\work\code\b6\Backend\CSharp\Libraries\Standard\TableAccess_std\bin\Debug\netstandard2.0\TableAccess_std.dll
D:\work\code\b6\Backend\CSharp\Libraries\Standard\CommsCode_std\bin\Debug\netstandard2.0\CommsCode_std.dll
D:\work\code\b6\Backend\CSharp\Libraries\Standard\Recognisers\bin\Debug\netstandard2.0\Recognisers.dll
The relevant section, elided for readability, is
References which depend on "Microsoft.Extensions.Primitives, Version=5.0.0.0,...
C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll
Project file item includes which caused reference...
C:\Users\neilm\.nuget\packages\microsoft.extensions.primitives\5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll
which seems to be describing a self-reference. Any idea how this might be occurring? I've tried nuking the package cache, as well as the bin and obj folders but can't seem to get rid of it. TIA.
Edit I should probably add this is just one of a number of System packages for which I am getting this warning. Others include:
System.Diagnostics.DiagnosticsSource
System.Memory.Data
Edit 2 In case it is relevant, the root project is an Azure Cloud Service "Classic" worker role built using the Azure SDK which is why (regrettably) I can't just target .Net5 to try and work around this.
Edit 3 The conflicts appear to be resolved when adding local dependencies at a matching version but I would still like to understand where the original conflict is coming from and what the warning is trying to tell me. I think it is implying that the 472 framework depends on a different version of those packages/dlls but if so it's unclear what the appropriate resolution should be.
I'm absolutely desperate with this.
I wanted to change my Xamarin Forms Project from PLC to .NET Standard (v.1.5) and i made the mistake to change it in the Project options. After changing, i realised it's a bad approach and wanted to restore to PLC. After changing back i cannot build the project anymore as I'm getting 96 compile errors. Every error is saying "Error CS0344"
The type 'GeneratedCodeAttribute' exists in both 'System.Diagnostics.Tools, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
and 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
It says that for basically every CS and XAML file i have in the project. I have no idea what to do to fix this. I searched almost the whole web for a solution and i'm clueless.
Thanks in regards for your help.
I have a C# MVC project, it was working last week but when I started working again this week I am getting this warning and all the adjustment or changes I am making in the controllers doesn't reflect:
Could not resolve this reference. Could not locate the assembly "Microsoft.AspNet.Scaffolding.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxx, processorArchitecture=x86". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Hope someone can help me.
Thanks!
EDIT
I'm seeing this on my references, so what I did is I deleted it then added it again now there's a different warning, please see below.
New Warning:
The primary reference "Microsoft.AspNet.Scaffolding.12.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.6" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2".
I have few projects in my solution referring Syste.Web.Http and Formatting binary. Things are fine few days back but last week my Team Services build started failing without any changed made on ref: and it gives me below error
Assembly 'Microsoft.CloudOA.Wizard' with identity 'Microsoft.CloudOA.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http' with identity 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
However, the same project is building fine in locally. I tried looking into all projects and made sure none of my project is using 4.0.0. But no luck. Can some one please help me to get rid of this issue? Thanks in advance.
Make sure that you check all bin folders. I mean it can be changed in bin folder, but reference in project can be still to 4.0.0.0.
Try running "Update-package" command for all your projects from "VS\Tools\Nuget Package Manager\Package Manager Console" to update the referenced packages to the latest version.
We just did a merge(TFS) between two branches. But now when I compile, I've this error:
No way to resolve conflict between
"AA.BB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
and
"AA.BB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bfd296a93930d932".
Choosing "AA.BB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"AA.BB" is one of our project, I've checked that we only reference it as a project. And we have only project named like this.
Does someone knows why this error is happening? And where this PublicKeyToken error can come from?
What I already tried:
Remove all reference to this project and make again the references
Search if one of those project was having a copyLocal = true(not the case) or referencing directly a DLL(not the case)
Note that:
The build is considered as succeed but when I launch the application I got errors(basically an error saying that this dll doesn't match the manifest)
If I got in the classes that uses this, I've no errors
I finally found the issue, I post it since maybe it can help someone in the future.
The issue was that before the Merge, there were some project which were having a different output directory.
So, when doing the rebuild, some project were finding multiple reference of the same project in different directory.
The solution is quite simple: Delete manually once the output directory and you're good :)