Problems related to Microsoft HTTP Client Libraries v2.1.10 NuGet update - asp.net-mvc

Note: This question was totally rewritten several days after it was originally posted.
I have an ASP.NET MVC app developed in VS 2012, deployed to Azure. The original projects were created from the ASP.NET MVC 4 project template.
NuGet recently started showing a whole slew of updated packages from Microsoft. One of those updates, Microsoft HTTP Client Libraries v2.1.10, causes serious problems when it is installed.
It installs MicrosoftBcl.Build, which is not compatible with my Azure project (see this SO question for the problem and its solution).
It causes a whole slew of "incompatible DLL" problems (see below).
This raises several burning questions:
My MVC app is just a website. It just runs in a web browser. Do I need this package at all? (E.g., is it used by template code, which would break, possibly subtly, if I remove the package?)
According to the Project Site (http://blogs.msdn.com/b/bclteam/p/httpclient.aspx), there are a couple of newer (albeit beta) versions of this product. I assume I'd see them if I told NuGet to show me non-released versions. Do these versions fix the problems described above?
Here are the warnings I get when I build the solution after installing the updated NuGet package...
1>------ Build started: Project: Ruby, Configuration: Release Any CPU ------
1> All packages listed in packages.config are already installed.
1> No way to resolve conflict between "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.
1> Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.AspNet.4.3.0.13117\lib\net45-full\DotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to Version "4.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Web.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\WebGrease.1.3.0\lib\WebGrease.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Web.WebPages.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Data.OData.5.5.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Web.WebPages, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "DotNetOpenAuth.Core, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.Core.4.3.0.13117\lib\net45-full\DotNetOpenAuth.Core.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Web.WebPages.Deployment, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.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> Ruby -> C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\Ruby\bin\Ruby.dll
2>------ Build started: Project: Ruby.Azure, Configuration: Release Any CPU ------
3>------ Publish started: Project: Ruby.Azure, Configuration: Release Any CPU ------
3>C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.targets(220,5): warning : All projects referencing Ruby.csproj must install nuget package Microsoft.Bcl.Build.
3> No way to resolve conflict between "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Choosing "System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" arbitrarily.
3> Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.AspNet.4.3.0.13117\lib\net45-full\DotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to Version "4.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "System.Web.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\WebGrease.1.3.0\lib\WebGrease.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "System.Web.WebPages.Razor, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.5.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.Data.OData.5.5.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "System.Web.WebPages, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "DotNetOpenAuth.Core, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\DotNetOpenAuth.Core.4.3.0.13117\lib\net45-full\DotNetOpenAuth.Core.dll] to solve conflict and get rid of warning.
3> Consider app.config remapping of assembly "System.Web.WebPages.Deployment, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll] to Version "2.0.0.0" [C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll] to solve conflict and get rid of warning.
3>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.
3> Transformed Web.config using C:\Users\Robert\Documents\SBSoftware\SCM\Ruby\Ruby\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227.
3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227.
3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227.
3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227.
3>Ruby(0,0): warning WAT153: The web project 'Ruby' is dependent on the following MVC assembly: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll. MVC assemblies must be added to the package or installed on the virtual machine for your web role. For more details about this, see the following help page: http://go.microsoft.com/fwlink/?LinkId=218227.

You can use binding redirects in your web.config file to solve issues.
For example, for line:
Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.3.0.0"
Add in Web.config:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet"
publicKeyToken="2780ccd10d57b246"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.3.0.0"
newVersion="4.3.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
and so on... For each dll that creates exception add additional dependentAssembly node.

One situation which causes this error is running the Azure package oder publish commands without having done a clean rebuild for the same configuration (e.g. Release) before.
This fixed it for me:
Reinstall the WindowsAzure.Storage NuGet package by running the following command on the NuGet Package Manager Console:
Update-Package –reinstall WindowsAzure.Storage
Rebuild the MVC web application project (Debug and Release).
If this does not help you could set the "MSBuild project build output verbosity" under TOOLS -> Options -> "Projects and Solutions" -> "Build and Run" to "Diagnostic" and check what causes the Assembly conflict (e.g. look for "Project file item includes which caused reference").

You need to update/create an app.config file with the redirects as mentioned here:
https://cpaterson.wordpress.com/2014/03/28/found-conflicts-between-different-versions-of-assembly-consider-app-config-remapping-of-assembly/

Related

Project doesn't compile after upgrading from Visual Studio 2017 to 2019

I can't understand the warnings and errors from Visual Studio 2019. It seems that all the references to the packages of the project are no longer working after the upgrade from Visual Studio 2017.
There are the initial lines of the log when I compile the solution.
1>------ Build started: Project: ClientServerUpload, Configuration: Debug Any CPU ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Text.Encoding.CodePages". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3243: No way to resolve conflict between "System.Text.Encoding.CodePages, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Text.Encoding.CodePages". Choosing "System.Text.Encoding.CodePages, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> Consider app.config remapping of assembly "FSharp.Core, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.4.3.0" [] to Version "4.7.0.0" [\\mypath\packages\FSharp.Core.4.7.0\lib\net45\FSharp.Core.dll] to solve conflict and get rid of warning.
There are many other lines after the above, but anyway I can't see what is going wrong. For example, I pick the first message, about "System.Text.Encoding.CodePages". There a warning saying "Could not locate the assembly" and another about a conflict between Version=4.1.3.0 and a reference with no version. But from where does it look at Version=4.1.3.0? In the pacakge.config there is a line:
<package id="System.Text.Encoding.CodePages" version="4.7.0" targetFramework="net461" />
and if I edit the .proj file I see:
<Reference Include="System.Text.Encoding.CodePages"> <HintPath>..\packages\System.Text.Encoding.CodePages.4.7.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
</Reference>
and the HintPath is indeed there. Similar doubts for all the other messages and errors.
Only another example, why is it searching FSharp.Core, Version=4.4.1.0?
Again I have
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.7.0\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
in the proj file and in the packages.config
<package id="FSharp.Core" version="4.7.0" targetFramework="net461" />
All the configurations I'm aware of seem correct to me, and the whole solution was completely fine with Visual Studio 2017. The project was built with WebSharper template, I don't know if/how this is relevant, however I also reinstalled WebSharper VSIX, after upgrading to Visual Studio 2019, and I didn't receive any error.
Aside from deleting and restoring all the packages, looking at the .proj file, cleaning and rebuilding the solution, what other options do I have? At what else should I look? I know I can add remapping to the Web.config, but I don't think it is the solution (not even a workaround). For your info, after many hours I managed to get a release with many (strange) lines of remapping and by manually (!) copying some files (including FSharp.Core) from the packages to the bin folder, that is clearly not an acceptable way to proceed.
I seem to recall something similar when I upgraded an F# project from VS2015 to 2017.
The solution was to update the version of the F# runtime (FSharp.Core.dll) in the project properties.
Looking at the .fsproj for a .NET Core 3.0 F# project: the F# runtime is not actually listed, so must be an implicit dependency: maybe removing it would also work.
Step 0
I've restored an old commit of my project to better describe the original situation and to track all the steps to resolve it.
Before the following 2 operations, I had to nuget upgrade from FSharp.Core 4.6 to 4.7, for a problem specific to WebSharper: the Scripts were not produced.
Step 1
I had to edit the .proj file to delete some reference lines, sort of duplicated.
Here is an example for FSharp.Core, but I did the same for many others (I don't know what exactly originated this problem but removing those lines seems to have done the trick for me)
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.7.0\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core" />
In the above case I deleted the last line (and all the other similar lines without a version reference under a tag containing the version of the same package)
Step 2
Then I copied and pasted all the <dependentAssembly> from the Visual Studio output to the Web.config. Again I don't understand wht they are many more than the ones needed for Visual Studio 2017, but these 2 operations apparently solved my issue.

Trying to Upgrade froM MVC3 to MVC4, all ok bar one component which is still referencing 3.0.0.0

I have upgraded my MVC3 application using the Nuget UpgradeFromMvc3ToMvc4 which has worked fine, except for one component. I did uninstall the V3 of this "MvcSiteMapProvider" component before upgrading, and then installed "MvcSiteMap Core V4" after the MVC4 upgrade.
Ther error I get is:
Error 41 Assembly 'MvcSiteMapProvider, Version=4.6.18.0,
Culture=neutral, PublicKeyToken=1923abe4657913cc' 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'
d:\..\MvcSiteMapProvider.MVC4.Core.4.6.18\lib\net45
\MvcSiteMapProvider.dll
There is no reference to 3.0.0.0 in my solution. I have done a "find" in "all files". So am confused.
Any help appreciated. Thanks.
Drop refference to System.Web.MVC and readd it.
Sometimes this just happends.

Using a custom version of FSharp.Core.dll

I've been poking around with the fsharp compiler source code to try to build a wp7 version of FSharp.Core (FSharp.Core for Windows Phone 7.1 and F# 3.0), and at one point I gave up and started trying to make the portable version work with wp7 instead. I added the FX_NO_STRUCTURAL_EQUALITY define to the portable-net4+sl4+wp71+win8 target framework, which seems to what's causing it to not work at runtime, and tried to replace the FSharp.Core.dll in C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable with my custom version. But I get this errors when compiling in Visual Studio:
Warning 1 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
Warning 3 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
Warning 2 The primary reference "FSharp.Core" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile47". To resolve this problem, either remove the reference "FSharp.Core" or retarget your application to a framework version which contains "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1578 5 FSharp.Data.Portable
The problem is that the portable FSharp.Core that comes with VS2012 depends on the portable 2.0.5.0 versions of mscorlib.dll, System.dll and System.Core.dllthose assemblies, but the one I compile from source depends on the non-portable 4.0.0.0 versions. Has anyone built the portable version successfully from source?
What you could do is add:
<OtherFlags>$(OtherFlags) --simpleresolution -r:"pathToTheCorrectmscorlib/mscorlib-runtime.dll" </OtherFlags>
to the FSharp.Source.Targets file. Do this right file after the <DefineConstants> elements. This should cause the compilation phase to use the version of mscorlib that you specify rather than the default version specified by the msbuild target. (Obviously replace pathToTheCorrectmscorlib/mscorlib-runtime.dll with the correct one :) )
Got the portable-net4+sl4+wp71+win8 target compiling to Profile88 from F# source after a couple of changes https://github.com/ovatsus/fsharp
Still need to thoroughly test at runtime, though

Could not load assembly WebPages.Deployment version 2 at host?

I have a ASP.NET MVC 2 website (VS2010) that I have upgraded to ASP.NET MVC 3 (VS2012) and this works fin on local IIS7 but when publishing it I get this exception on host :
Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
After some seartch I found this that states that I should set CopyLocal on some of the references(inlcuding the System.Web.WebPages) and also use the publish tool in VS2012, but this generated the following exception?
Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
And I can´t find any Deployment dll to set copyLocal?
How could I solve this?
Have a read of http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net
You need to add a reference to System.Web.WebPages.Deployment and set that also to CopyLocal.

Complications when upgrading from ASP MVC 3 Preview 1 to beta

I have just upgraded my ASP MVC 3 application from the preview to the beta version.
In preview everything worked fine, but as soon as I upgraded weird things started to happen.
I get this error message:
Compiler Error Message: CS0234: The
type or namespace name 'Helpers' does
not exist in the namespace
'System.Web' (are you missing an
assembly reference?)
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\1512250b\962d050c\App_Web_index.cshtml.a8d08dba.kncxiw31.0.cs Line: 19
I have tried to completly rebuild the application, and to clear the temporary asp.net files, but nothing works. My solution builds successfully, no errors while building. But when i try to open the website, I get this error.
These are my referenced dll's:
Version Information: Microsoft .NET
Framework Version:4.0.30319; ASP.NET
Version:4.0.30319.1
Screenshot of the error message:
Any thoughts?
After intense searching I found some answers in the ASP.NET MVC 3 release notes. There is a section called Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 which tell you what to do:
Add the two following lines into your <assemblies> section in your web.config:
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" />
The problem is that you need to set the Copy Local property to true on the System.Web.Helpers reference.
Make sure that the System.Web.Mvc assembly points to the correct version:
C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
and that System.Web.Helpers also:
C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Helpers.dll
In Beta 3, System.Web.Helpers is a separate download so make sure you've installed AspNetWebPages.msi.

Resources