Visual Studio update 15.7.2 breaks Xamarin Android project - visual-studio

After updating Visual Studio, I can no longer build the release version of my Xamarin project:
1>Foobar.Android ->
C:\Apps\foobar-telerik-mobile-app\foobar\Android\bin\Release\foobar.Android.dll1>No
way to resolve conflict between "mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e".
Choosing "mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" arbitrarily.1>The
"LinkAssemblies" task failed
unexpectedly.1>Mono.Linker.MarkException: Error processing method:
'System.Void
Telerik.XamarinForms.DataGrid.RadDataGridResourceDictionary::InitializeComponent()'
in assembly: 'Telerik.XamarinForms.DataGrid.dll' --->
Mono.Cecil.ResolutionException: Failed to resolve
System.Func`2
Xamarin.Forms.Internals.ResourceLoader::get_ResourceProvider()
If the Android option "Use Shared Runtime" is true, it will build - except you cannot publish with that option set! So there is no point.
I have no idea how to fix this. Any Microsoft/Xamarin/Telerik insiders out there with some ideas?

Related

While implementing Maps in Xamarin, I got following Error

Error: Could not load file or assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies

Team Foundation Server 2015 MsBuild 14

I am getting the following Conflict which doesn't make sense:
2>ResolveAssemblyReferences:
No way to resolve conflict
between "System.Web.Mvc, Version=5.2.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing
"System.Web.Mvc, Version=5.2.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" arbitrarily.
No way to resolve conflict
between "System.Web.Mvc, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing
"System.Web.Mvc, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" arbitrarily.
Consider app.config
remapping of assembly "System.Web.Mvc, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version
"5.2.3.0"
[C:\BuildAgent_work\1\s\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll]
to solve conflict and get rid of warning.
[warning]C:\Program Files
(x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1819,5):
Warning MSB3247: Found conflicts between different versions of the
same dependent assembly. In Visual Studio, double-click this warning
(or select it and press Enter) to fix the conflicts; otherwise, add
the following binding redirects to the "runtime" node in the
application configuration file:
The solution has 3 project and they all use Version=5.2.3.0. When i run local in Visual Studio I don't get this warning.
Any ideas how to fix it?
It seems your issue is because the assembly on your local machine and build agent machine are different. You can try to remove/uninstall the assemblies and reinstall them from Manage Nuget Packages, the warning should disappear.

how to resolve runtime error in mvc3 razor view (Assembly 'MvcApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')

I want to create a mvc3 web razor application in visual studio 2010 professional. I added mvc3 web project with razor view but when i compile it it gives error of MVC.WEB.dll older version. then i updated mvc.web.dll to version 4 and web.mvc.webpages to version 2 in my refference assemblieis.
I already added the web.config file configurations when it gives compile time error as show below
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</assemblies>
</compilation>
but now it not give the compile time error as shown below.
Assembly 'MvcApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Please help me to resolve this matter.
I want to create a mvc3 web razor application
and then
i updated mvc.web.dll to version 4
what?
Exception ... which has a higher version than referenced assembly ...
Try to remove reference from project references (left click on System.Web.Mvc and press delete), then References -> Add reference sort by name on first tab and select System.Web.Mvc with 4.0.0.0 in second column (version).
Under the References you will find the System.Web.Mvc referenced
remove this reference and add a new reference of higher version i.e 4.x

Configuration error: System.Web.Helpers

I deployed a site to a server and I get this error. Why do I get this?
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 16: <assemblies>
Line 17: <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 18: <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 19: <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 20: <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Source File: C:\<path>\web.config Line: 18
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Looks like the server on which you deployed the application doesn't have ASP.NET MVC 3 installed. If you do not want to install ASP.NET MVC 3 on the server you could also bin deploy your application.
I had the same problem and i installed ASP.NET MVC 3 Tools Update from Microsoft site and it resolved the problem.
Also check if the C:\Program Files (x86)\Microsoft ASP.NET is present prior to installation. As in my case this folder was missing and post installation i has this folder and assemblies got registered.
I had the following situation. A brand new laptop with Visual Studio 2015 working on a somewhat older MVC3 project. Visual Studio 2015 and later does apparently no longer install MVC 3. So after downloading the AspNetMVC3ToolsUpdateSetup.exe and installing it, the right references where found (from GAC). And the build completed with no errors, no extra steps needed besides this install.
As per the comments in Phil Haack's bin deploy post recent versions of Visual Studio don't have right-click Add Deployable Dependencies option on projects so you can do this:
Use the Package Manager Console and run the following command:
Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1
That should reference all the assemblies in a manner that will make it
bin deployable.
I then got this error:
Could not load file or assembly 'NuGet.Core, Version=1.0.11220.104,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies.
Which I got rid of by deleting the file: bin\System.Web.WebPages.Administration.dll

Assembly created by Moles in VS2010 is referencing MVC3 and MVC4 after install of VS2012

Assembly 'dllname.Moles, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
A MVC3 solution targetting the .NET4.0 framework, with a unittest project using the Moles framework, worked perfectly in Visual Studio 2010. MVC4 was not installed on this computer.
After installation of Visual Studio 2012 (and the mandatory in place replacement of .NET4.0 by .NET4.5 and the installation of MVC4), the unittest project doesn't compile anymore in VS2010, it complains about the given error.
When we inspect the assembly, we see effectively that it is referencing MVC4 and MVC3??
BoneSoft.CSS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
itextsharp, Version=5.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca
Microsoft.ExtendedReflection, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.Moles.Framework, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
NHibernate.Validator, Version=1.3.1.4000, Culture=neutral, PublicKeyToken=70154e18752585bd
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
MVC4 is never referenced in the whole solution, but Moles somewhere thinks it must be included when generating a 'moles assembly' of a assembly who is referencing MVC3.
I have also moles assemblies of other assemblies who are not referencing MVC3 and there no problem at compiling time.
I deleted already the moles assembly in the project, rebuilded and recreated the moles assembly: same error.
Ideas where to search the problem?
When you installed VS 2012, it installed MVC4 on the box. MVC 3 wont work well SxS with MVC 4. You need to update MVC 3 app to work on machine where MVC 4 is installed.This is documented in release notes for MVC 4.0. Please read section Installing ASP.NET MVC 4 breaks ASP.NET MVC 3 RTM applications. Follow setps "Required updates".
I was getting a similar error on a project so I removed the reference to MVC and re-added the reference to MVC 3, then I was able to compile.
Looking at the .csproj file, before it read:
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
and after re-adding the reference:
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
So it looks like the tag <SpecificVersion>False</SpecificVersion> was letting the project look for the reference to the newer version of MVC, which was causing the version conflict.

Resources