0
I was taking a look in that question in Stackoverflow English, because I really find it very confusing to use ASPX files and find the syntax of Razor more user friendly.
When trying to add a file with the extension .cshtml
the project to make tests, I had an error in the system:
Could not determine which version of ASP.NET Web Pages to use.
In order to use this site, specify a version in the site’s web.config file. For more information, see the following article on the Microsoft support site: http://go.microsoft.com/fwlink/? Linkid=254126
[Invalidoperationexception: Could not determine which version of ASP.NET Web Pages to use.
In order to use this site, specify a version in the site’s web.config file. For more information, see the following article on the Microsoft support site: http://go.microsoft.com/fwlink/? Linkid=254126]
System.Web.Webpages.Deployment.Preapplicationstartcode.Startcore(Ifilesystem filesystem, String appDomainAppPath, String bindirectory, Namevaluecollection appSettings, Ienumerable1 loadedAssemblies, IBuildManager buildManager, Action
1 loadWebPages, Action registerForChangeNotification, Func`2 getAssemblyNameThunk) +16236
System.Web.Webpages.Deployment.Preapplicationstartcode.Startcore() +167 System.Web.Webpages.Deployment.Preapplicationstartcode.Start() +38[Invalidoperationexception: The method of initialization of the Start application preload on type System.Web.Webpages.Deployment.Preapplicationstartcode issued a Exception with the following error message: Could not determine which version of ASP.NET Web Pages to use.
In order to use this site, specify a version in the site’s web.config file. For more information, see the following article on the Microsoft support site: http://go.microsoft.com/fwlink/? Linkid=254126.]
System.Web.Compilation.BuildManager.Invokeprestartinitmethodscore(Icollection1 methods, Func
1 setHostingEnvironmentCultures) +615
System.Web.Compilation.BuildManager.Invokeprestartinitmethods(Icollection`1 methods) +141
System.Web.Compilation.BuildManager.Callprestartinitmethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.BuildManager.Executepreappstart() +157
System.Web.Hosting.HostingEnvironment.Initialize(Applicationmanager appManager, Iapplicationhost appHost, Iconfigmappathfactory configMapPathFactory, Hostingenvironmentparameters hostingParameters, Policylevel policyLevel, Exception appDomainCreationException) +549[Httpexception (0x80004005): The boot method of Start application preload on type System.Web.Webpages.Deployment.Preapplicationstartcode issued a Exception with the following error message: Could not determine which version of ASP.NET Web Pages to use.
In order to use this site, specify a version in the site’s web.config file. For more information, see the following article on the Microsoft support site: http://go.microsoft.com/fwlink/? Linkid=254126.]
System.Web.Httpruntime.Firstrequestinit(Httpcontext context) +10085804 System.Web.Httpruntime.Ensurefirstrequestinit(Httpcontext context) +95 System.Web.Httpruntime.Processrequestnotificationprivate(Iis7workerrequest Wr, Httpcontext context) +254
I wonder if it is really possible to replace the files ASPX
by CSHTML.
I think it’s like using a . Vb and trying to compile as . Cs
– Rovann Linhalis
briefly not .... different things, do different and have different proposals.
– novic
I put
<add key="webPages:Version" value="2.0"/>
and the project is working now. And displaying the content...– Wallace Maxters