我在运行IIS 8.0的Arvixe ASP.NET服务器上运行ServiceStack时遇到一些问题。IIS 8.0上的ServiceStack存在问题Arvixe服务器
我按照http://servicestack.net/ServiceStack.Hello/的教程创建了一个空的ASP.NET Web应用程序,并在程序包管理器控制台中发出命令“PM> Install-Package ServiceStack.Host.AspNet”。
这样做后,我可以从本地主机上的Visual Studio中运行Web应用程序,并且Todo应用程序工作正常,我可以调用/ hello/{Name} url来获取正确的结果。
然后我试着将项目上传到我在IIS 8.0上运行的Arvixe ASP.NET服务器,在这里它不起作用。待办事项应用程序加载,但不添加项目,并在工作的时候尝试访问/元数据或/你好/ {名称}我得到一个HTTP错误404.0 - 找不到像这样:
我我对ServiceStack完全陌生,所以我不知道如何解决这个问题。有人可以告诉我该怎么做才能做到这一点?
编辑
我的web.config
<?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>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<httpHandlers><add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /></httpHandlers></system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers><add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /></handlers></system.webServer>
</configuration>
这是不可能的,找出这里有什么问题。发布您的web.config和Global.asax –
我自己没有编辑过任何代码,我刚刚安装了ServiceStack.Host.AspNet并直接从框中运行它。所以web.config和Global.asax就是下载的内容。据我所知,Global.asax是空的,AppHost类等位于名为App_Start的文件夹中。 – Daniel
我不认为这是IIS问题。如果您正在使用新项目,则需要在global.asax中执行少量设置。 http://stackoverflow.com/questions/12361860/service-stack-on-mvc4/12797075#12797075。请检查一下。 – kunjee