Trying to create my .NET 3.5 mvc application in VS2010 Beta2 throws MVCBuildView error

I upgraded to VS 2010 Beta2. He updated my slns and csprojs when I opened them. When he asked me, I decided to stay in .net 3.5 to maintain compatibility.

NOTE: the original project was created using MVC2 Preview2 - the same version as for VS2010

However, when I try to create my web project, including views, I encounter some compiler errors.

I have Pager.ascx that uses some swap magic using RouteValueDictionary, but I get this error during build.

Error 50 The type "System.Web.Routing.RouteValueDictionary" exists both in "c: \ Program Files \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0 \ System.Web.dll, and in c: Windows \ assembly \ GAC_MSIL \ System.Web.Routing \ 3.5.0.0__31bf3856ad364e35 \ System.Web.Routing.dll 'c: \ Projects \ Phase2 \ Source \ Kk.Web \ Views \ Shared \ Pager.ascx 8 Kk.Web

MvcBuildViews is true inside the project file.

How to fix this build error?

I somehow need to say that the ASPX compiler will be v3.5 (or v2.0, not sure). But I do not know how to do this.

Any help is greatly appreciated.

Summary

+1
source share
2 answers

I looked at this problem again and, thanks to Maslow, I was able to improve Google and find this Microsoft Connect error.

http://connect.microsoft.com/VisualStudio/feedback/details/557798/visual-studio-2010-compile-asp-net-3-5-website-using-net4s-aspnet-compiler-exe

The work proposed on this subject works great.

The solution is given here, http://forums.asp.net/p/1551418/3824696.aspx

0
source

according to this article you need to change the physical path of AspNetCompiler as follows:

<Target Name="BuildViews" Condition="'$(MvcBuildViews)'=='true'" AfterTargets="Build"> <Message Importance="normal" Text="Precompiling views" /> <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> </Target> 
+1
source

Source: https://habr.com/ru/post/970781/


All Articles