Razor Servicestack剃须刀&x27;型号';在这种情况下不存在
所以,我想弄明白这一点,但没有用 我在VS 2013中创建了一个新的空ASP.NET Web应用程序 增加了ServiceStack框架和Razor引擎vie NuGet 添加了一个简单的/Services/LogonSvc.cs服务,以及一个带有[Route(“/Logon”)]的logonsdto类 添加了一个简单的/Views/Logon/Logons.cshtml web.config文件应该是由NuGet模板创建的正确文件,对吗 但是VS仍然说“当前上下文中不存在‘model’这个名称。”。“布局”也是如此 已将web.config文件复制到“视图”文件夹中。没有变化Razor Servicestack剃须刀&x27;型号';在这种情况下不存在,razor,
servicestack,Razor,
servicestack,所以,我想弄明白这一点,但没有用 我在VS 2013中创建了一个新的空ASP.NET Web应用程序 增加了ServiceStack框架和Razor引擎vie NuGet 添加了一个简单的/Services/LogonSvc.cs服务,以及一个带有[Route(“/Logon”)]的logonsdto类 添加了一个简单的/Views/Logon/Logons.cshtml web.config文件应该是由NuGet模板创建的正确文件,对吗 但是VS仍然说“当前上下文中不存在‘model’这个名称
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<buildProviders>
<add extension=".cshtml" type="ServiceStack.Razor.CSharpRazorBuildProvider, ServiceStack.Razor" />
</buildProviders>
</compilation>
<httpRuntime targetFramework="4.5" />
<httpHandlers>
<add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
</system.webServer>
<appSettings>
<add key="webPages:Enabled" value="false" />
</appSettings>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="ServiceStack.Razor.ViewPage">
<namespaces>
<add namespace="ServiceStack" />
<add namespace="ServiceStack.Html" />
<add namespace="ServiceStack.Razor" />
<add namespace="ServiceStack.Text" />
<add namespace="ServiceStack.OrmLite" />
<add namespace="Telestion.Web" />
<add namespace="Telestion.Web.Dto"/>
</namespaces>
</pages>
</system.web.webPages.razor>
</configuration>
Logons.cshtml,在“model”和“Layout”下有弯曲的线条:
@model Telestion.Web.Dto.LogonResponse
@{
布局=空;
}
有什么想法吗?我不确定,但这可能会解决你的问题 在.cshtml中,删除以下行:
@model Telestion.Web.Dto.LogonResponse
然后将其添加到文件开头:
@继承ServiceStack.Razor.ViewPage
我不确定,但这可能会解决您的问题
在.cshtml中,删除以下行:@model Telestion.Web.Dto.LogonResponse
然后将其添加到文件开头:
@继承ServiceStack.Razor.ViewPage
@model Telestion.Web.Dto.LogonResponse
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title></title>
</head>
<body>
<div>
</div>
</body>
</html>