Error loading Razor Script c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET
Files\root\ce3443bb\58e618b\App_Web_inline-71cf33f09db3dfcc7669a3e4c8583d52.cshtml.ae9e2569.9k1svgrr.0.cs(19):
error CS0234: Le type ou le nom d'espace de noms 'Helpers' n'existe pas
dans l'espace de noms 'System.Web' (une référence d'assembly est-elle
manquante ?)
(it's french, it say that the namespace Helpers dont exists in System.Web), but I have the namespace Helpers and all namespaces of .NET 4 without any problem.
when I write it without Razor Macro, I get the Hello World
I get rid of this dependency, but there is another I dont know how to solve - so if somebody could help with this error:
The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Then it will be great.
Why inline Razors scripts needs to have assemblies defined in webconfig if umbraco is build from 4.7.1 source branch? When I run umbraco from 4.7.0 binaries it is working fine and there is not needed to modify web.config.
That looks pretty messed up, I would suggest you have a good hard look at your web.config versus the one that comes with Umbraco, some stuff seems to be missing there.
Just stumped in the same error and just sharing how I overcome it.
I added the web.config line (<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />) just as woo123 wrote, but still got the following error:
c:\Users\Joao\AppData\Local\Temp\Temporary ASP.NET Files\root\42fd127e\8bb72002\App_Web_634444441819238282_listposts.cshtml.70df5e80.s4lfi-yx.0.cs(23): error CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.WebPages' (are you missing an assembly reference?)
As the error implies, a reference to the System.Web.WebPages is required. So to be allowed to use and save Razor files in Umbraco Admin, just had the following 2 lines:
I believe that this error occurs when we install and run Umbraco without MVC3 installed. After the MVC3 installation, the error persists. Add the 2 lines under Compilation->Assemblies and everything should be fine.
More info here (http://www.asp.net/learn/whitepapers/mvc3-release-notes#upgrading)
Thanks João and woo123 That's awesome, fixed it for me
Just another piece to the puzzle:
I had a separate .cshtml file which was working perfectly until I tried to use inline cshtml macro, at which point everything broke permanently. even removing all inline cshtml did not resolve the issue. But João's solution has it working again. thanks!
(oh also if you don't have syntax highlighting and autocomplete working make sure you reference Microsoft.CSharp in your project.)
Error loading Razor Script
Hi, when i try to use Razor Macro
I get an error
This is the error:
Error loading Razor Script
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ce3443bb\58e618b\App_Web_inline-71cf33f09db3dfcc7669a3e4c8583d52.cshtml.ae9e2569.9k1svgrr.0.cs(19): error CS0234: Le type ou le nom d'espace de noms 'Helpers' n'existe pas dans l'espace de noms 'System.Web' (une référence d'assembly est-elle manquante ?)
(it's french, it say that the namespace Helpers dont exists in System.Web), but I have the namespace Helpers and all namespaces of .NET 4 without any problem.
when I write it without Razor Macro, I get the Hello World
Do you have MVC2 and MVC3 installed? I seem to recall that you would need them both.
Hah I'm solving same issue (for second day..).
insert this into your web.config, section assemblies:
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
I get rid of this dependency, but there is another I dont know how to solve - so if somebody could help with this error:
The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Then it will be great.
Why inline Razors scripts needs to have assemblies defined in webconfig if umbraco is build from 4.7.1 source branch? When I run umbraco from 4.7.0 binaries it is working fine and there is not needed to modify web.config.
Thanks
That looks pretty messed up, I would suggest you have a good hard look at your web.config versus the one that comes with Umbraco, some stuff seems to be missing there.
Hi there,
Just stumped in the same error and just sharing how I overcome it.
I added the web.config line (<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />) just as woo123 wrote, but still got the following error:
c:\Users\Joao\AppData\Local\Temp\Temporary ASP.NET Files\root\42fd127e\8bb72002\App_Web_634444441819238282_listposts.cshtml.70df5e80.s4lfi-yx.0.cs(23): error CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.WebPages' (are you missing an assembly reference?)
As the error implies, a reference to the System.Web.WebPages is required. So to be allowed to use and save Razor files in Umbraco Admin, just had the following 2 lines:
<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" />
I believe that this error occurs when we install and run Umbraco without MVC3 installed. After the MVC3 installation, the error persists. Add the 2 lines under Compilation->Assemblies and everything should be fine.
More info here (http://www.asp.net/learn/whitepapers/mvc3-release-notes#upgrading)
Thanks João and woo123 That's awesome, fixed it for me
Just another piece to the puzzle:
I had a separate .cshtml file which was working perfectly until I tried to use inline cshtml macro, at which point everything broke permanently. even removing all inline cshtml did not resolve the issue. But João's solution has it working again. thanks!
(oh also if you don't have syntax highlighting and autocomplete working make sure you reference Microsoft.CSharp in your project.)
Thanks... This fixed it for me too!
Thanks João, it also fixed my problem.
We had a project where we are not using MVC, but did wan't to use Razor for our macro script, this was one of the issues we also discovered.
Our solution was to add http://nuget.org/packages/Microsoft.AspNet.WebPages to our project, that way we had the right dependencies and could push these to our src repo.
But thanks for the excellent pointers, it helped narrow down the issue :-)
is working on a reply...