Yesterday I downloaded Umbraco 5 and ran it via Web Matrix on my Windows XP.
Today I tried to create a sitemap with razor but everytime I create a helper method I get the CS0433 error message. Has anyone else had this problem? I changed the helper name to something random to no avail and I've even tried removing either of the files which didn't work either?
Compiler Error Message: CS0433:
The type 'System.Web.WebPages.HelperResult' exists in both
'c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
and
'c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
Source Error:
Line 55:
Line 56: #line hidden
Line 57: public System.Web.WebPages.HelperResult traverse(dynamic node, int pad) {
Line 58: return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
Line 59:
Source File:
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\45baf68f\2ba1f2f8\App_Web_contentpage.cshtml.a270542a.q7_qc8vc.0.cs
Line: 57
Hmmm still didn't get anywhere with this error but then I downloaded Umbraco 5.0.1 and don't have a problem any more. I guess more of the creases have been ironed out ;-)
I have been running into this problem as well. It's not actually about the helper delegates in Razor views, rather, a conflicting build provider registration for Razor. When the MVC 4 / WebPages 2 beta is installed, a new build provider for WebPages 2 is added to the machine.config. In this instance, Umbraco 5 web app references version 1.0 of the assembly, but the 'newer' build provider is winning out during compilation. Thus the invalid cast exceptions...
To cut to the chase, the solution is to simply add the following to the web.config application settings: <add key="webpages:Version" value="1.0.0.0"/>
Umbraco 5 razor helper causing problems
Hi Umbrocans,
Yesterday I downloaded Umbraco 5 and ran it via Web Matrix on my Windows XP.
Today I tried to create a sitemap with razor but everytime I create a helper method I get the CS0433 error message. Has anyone else had this problem? I changed the helper name to something random to no avail and I've even tried removing either of the files which didn't work either?
Compiler Error Message: CS0433: The type 'System.Web.WebPages.HelperResult' exists in both 'c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll' and 'c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
Source Error:
Line 55: Line 56: #line hidden Line 57: public System.Web.WebPages.HelperResult traverse(dynamic node, int pad) { Line 58: return new System.Web.WebPages.HelperResult(__razor_helper_writer => { Line 59:
Source File: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\45baf68f\2ba1f2f8\App_Web_contentpage.cshtml.a270542a.q7_qc8vc.0.cs Line: 57
Hmmm still didn't get anywhere with this error but then I downloaded Umbraco 5.0.1 and don't have a problem any more. I guess more of the creases have been ironed out ;-)
Hi Paul,
I have been running into this problem as well. It's not actually about the helper delegates in Razor views, rather, a conflicting build provider registration for Razor. When the MVC 4 / WebPages 2 beta is installed, a new build provider for WebPages 2 is added to the machine.config. In this instance, Umbraco 5 web app references version 1.0 of the assembly, but the 'newer' build provider is winning out during compilation. Thus the invalid cast exceptions...
To cut to the chase, the solution is to simply add the following to the web.config application settings: <add key="webpages:Version" value="1.0.0.0"/>
Hope this helps others that run into the problem!
Andy
is working on a reply...