We have a complex solution (22 sub-projects, one of which is a website) that won't build using TFS Build. If I open the solution on the build server the code compiles fine inside of Visual Studio, but if I open a CMD prompt and try MSBUILD piccsserver.sln I get this error:
"C:\TFS2017_agent\_work\4\s\CorePlatform\PICCS\Main\src\piccsserver.sln"
(default target) (1) ->
"C:\TFS2017_agent\_work\4\s\CorePlatform\PICCS\Main\src\PICCS_WebHost.metaproj"
(default target) (24) ->(Build target) -> ASPNETCOMPILER : error ASPCONFIG: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not mat
ch the assembly reference. (Exception from HRESULT: 0x80131040) [C:\TFS2017_age
nt\_work\4\s\CorePlatform\PICCS\Main\src\PICCS_WebHost.metaproj]
I notice that when I build from within VS and look at the version of NewtonSoft.Json.dll in the website's bin folder, the version is 11.0.1 which is what I expect, but when I build from the command prompt the version is 4.5.11.15520.
What the heck is going on here? Doesn't building from within VS use MSBUILD?
I got it to work. I changed the value of newVersion in the Web.config from 11.0.0.0 to 11.0.1.0. No idea why that stops if from building only from the command-line, but now it builds both in VS and at the command-prompt.
From this:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0." newVersion="11.0.0.0" />
</dependentAssembly>
to this:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0." newVersion="11.0.1.0" />
</dependentAssembly>
Related
I installed gridmvc latest using nuget. Things work fine in my local environment but when i deploy it to production, I get this error. Please help.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1705: Assembly 'GridMvc, Version=2.0.4.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Source Error:
[No relevant source lines]
Source File: Line: 0
Show Detailed Compiler Output:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212
Try to clean & compile in release before publishing to production and let me know if the same issue happens to you.
Please follow the guide below: http://www.codeproject.com/Tips/597253/Using-the-Grid-MVC-in-ASP-NET-MVC
and make sure you've done the same steps while configuring your environment and code.
I hope the above will address you issue.
It's resolved now. All I had to do was, remove old referenced dll under References in this case (System.Web.Mvc 4.0.0.0). Add new reference System.Web.Mvc 4.0.0.1. Click on the new referenced dll, in the properties windows set Copy to Local = True.
The in my project's root web.config file, change the following
FROM
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
TO
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.1" />
</dependentAssembly>
Then do clean and rebuild. Then copy the new System.Web.Mvc (4.0.0.1) dll over to production.
The recent Visual Studio 2012 update seems to have broke something in my build. I think it has to do with last week's nuget update.
NuGet package restore started.
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Rebuild All started: Project: Project1, Configuration: Debug Any CPU ------
1> Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "Microsoft.Data.Edm, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Spatial, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll] to solve conflict and get rid of warning.
1>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
1> Project1 -> C:\Users\avianbc\Desktop\Project1\Project1\bin\Project1.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
How could I resolve these warnings? I've had all kinda of weird side effects in my application since they have appeared such as: inconsistent model binding (related to the Edm assembly?).
As the message indicates you can fix these warning by mapping the assembly version 5.2 to version 5.6. You do this by editing the assemblyBinding of your config file. In this case, add the following XML:
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
I'm not sure why you think this is cryptic, it's quite clear. You have more than one version of those packages installed (5.2 and 5.6) Some of your components are referencing 5.2 and some 5.6, and this is causing the warning. It's suggesting that you alias 5.2 to 5.6 so that the assemblies referencing 5.2 will use 5.6 instead.
This is probably no the best approach though, unless you have no control over those assemblies. You should probably just uninstall the 5.2 packages, and then update the nuget references to the 5.6 version and rebuild.
VS 2012, MVC4 app using Postal 0.8.0
When I NuGet install Andrew’s Davey’s Postal 0.8.0 it works on my development machine but when I deploy it I get this error message:
Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have spent several days trying to get this to work. What is the cause of this problem and how do you fix it?
When you install Postal with NuGet it replaces System.Web.Razor 2.0 with System.Web.Razor 1.0. I had to delete the reference to System.Web.Razor 1.0 and then added back in System.Web.Razor 2.0. You have to additionally set Copy Local to True in the Properties for System.Web.Razor and then rebuild the project. Once I did that VS2012 copied the System.Web.Razor.dll to the deployed bin directory and the problem cleared.
Postal also adds these dependency's to the web.config. I removed them and it still works properly.
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RazorEngine" publicKeyToken="9ee697374c7e744a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.8.0" newVersion="3.0.8.0" />
</dependentAssembly>
UPDATE 3/3/13
AD has just released Postal v0.8.2 which updated System.Web.Razor to 2.0.
The WebGrease dependency, with the release of ASP.NET and Web Tools 2012.2 (http://www.asp.net/vnext/overview/fall-2012-update) appears to be the default now.
I receive the following two errors when I try to compile my MVC4 web project:
CA0058 Error Running Code Analysis CA0058 : The referenced assembly 'DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' could not be found. This assembly is required for analysis and was referenced by: C:\Users\bflynn\Visual Studio Sites\mnp\bin\mnp.dll, C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\Microsoft.Web.WebPages.OAuth.dll. [Errors and Warnings] (Global)
and
CA0001 Error Running Code Analysis CA0001 : The following error was encountered while reading module 'Microsoft.Web.WebPages.OAuth': Assembly reference cannot be resolved: DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246. [Errors and Warnings] (Global)
I recently added the DotNetOpenAuth.AspNet package to the application, and it seems tied to that. I have Cleaned, Rebuilt, Open/Closed the program, Uninstalled/Re-installed the package, yet the errors persists.
I just ran into this too.
Don't upgrade DOA to 4.1
It looks like the aspnet dll has a specific version referenced. Altough it's .nuspec file says 4.0+ is ok...
Solution:
Uninstall-Package -Force each DotNetOpenAuth package (core /aspnet /oauth/openid etc)
Install-Package DotNetOpenAuth.AspNet -Version 4.0.4.12182
I used this to resolve the issue:
1. Uninstall-Package Microsoft.AspNet.WebPages.OAuth –RemoveDependencies
2. Install-Package DotNetOpenAuth.AspNet -Version 4.0.4.12182
3. Install-Package Microsoft.AspNet.WebPages.OAuth
I ran into the same issue the other day and reported it http://aspnetwebstack.codeplex.com/workitem/443
Problem was reported on 21. september 2012. (http://aspnetwebstack.codeplex.com/workitem/443)
It was closed on 5. june 2013 with message:
The next version of MVC will not have a dependency on DotNetOpenAuth. Use the recommended workarounds below.
So I used the workaround https://stackoverflow.com/a/12847018/1016682
Code Analysis error Could not load file or assembly 'System.Net.Http, Version=2.0.0.0 in MVC4 Web API
See Yao's answer. The only solution I found that actually works for this.
I had the same issue. Though the code analysis issue got fixed, the web application wouldn't run because of the following error.
Could not load file or assembly 'DotNetOpenAuth.AspNet' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
It turned that the web.config was not cleaned as part of the uninstall.
I had to remove the following dependentAssembly from web.config under the runtime/assemblyBinding section.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
</dependentAssembly>
</assemblyBinding>
</runtime>
The details can be read in http://www.bigcode.net/2013/07/error-running-code-analysis-in-vs2012.html
having some issues upgrading my Sitefinity 4.1.1339.0 installation to 4.3 (and ultimately to Sitefinity 5). It is giving me the following error:
Could not load file or assembly 'Telerik.Sitefinity, Version=4.1.1339.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I was thinking it was the /bin/Telerik.Sitefinity.dll file but everything seems to be updated in there.
Any ideas?
Thanks!
I agree with #Josh, plus you might try looking through all your files in the App_Data\Sitefinity\Configuration folder. I had to update all of the references in those files manually for some reason to match the exact DLL version. Make sure you completely restart your cassini/IIS/sitefinity instance to pick up the changes.
If you are using 'assemblyBinding' in your Sitefinity web.config, you will need to update that section of the config to the latest dll versions. Assembly Binding is a common solution to map out of date third party Sitefinity modules/plugins to the current Sitefinity dlls.
The following are correct versions for Sitefinity 5.1.3210. Note that Telerik.Web.UI is a different version as it is from a different Telerik product line.
<!-- From web.config - not complete file -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.1.3210.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2012.2.607.40"/>
</dependentAssembly>
</assemblyBinding>
If you will be upgrading through many versions 4.1 -> 4.4 -> 5.0 -> 5.1, you may wish to comment out this section of the config until you are complete with your upgrades, then add it back in. Otherwise, you'll have to edit these three lines after each upgrade.
Note: to get the dll version, browse to the bin folder. Right click dll file, click properties, then select the 'details' tab.