2

I am having some problems getting ServiceStack to work on my Arvixe ASP.NET server which runs on IIS 8.0.

I followed the tutorial on http://servicestack.net/ServiceStack.Hello/, creating an empty ASP.NET Web Application and issuing the command "PM> Install-Package ServiceStack.Host.AspNet" in Package Manager Console.

After doing this I could run the Web Application just fine from Visual Studio on localhost and the Todo app worked fine and I could call the /hello/{Name} url to get the correct result.

I then tried to upload the project to my Arvixe ASP.NET server which runs on IIS 8.0 and here it doesn't work. The Todo app loads but does not work with adding items, and when I try to access the /metadata or /hello/{Name} I get an HTTP Error 404.0 - Not Found like so:

enter image description here

I am completely new to ServiceStack so I don't know how to work around this problem. Can someone tell what I should do to get this working?

EDIT

My 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>
Daniel
  • 924
  • 1
  • 14
  • 31
  • It's impossible to figure out what's wrong here. Post your web.config and Global.asax – Ufuk Hacıoğulları Aug 05 '13 at 12:12
  • I have not edited any code myself, I have just installed the ServiceStack.Host.AspNet and run it straight from the box. So the web.config and Global.asax is just what was downloaded. As far as I can tell the Global.asax is empty and the AppHost class etc. is in a folder called App_Start. – Daniel Aug 05 '13 at 12:22
  • I don't think this is IIS issue. if you are using new project you need to do few setting in global.asax details are here. http://stackoverflow.com/questions/12361860/service-stack-on-mvc4/12797075#12797075 . Please check it out. – kunjee Aug 06 '13 at 08:36

2 Answers2

1

SOLVED

I found out what the problem was: I had to manually upload the Web.config file generated by Visual Studio. Once this file was uploaded to the root at the webserver, the example worked as it should. Apparently the Web.config file is not automatically uploaded to the server when using Publish from Visual Studio 2010.

Daniel
  • 924
  • 1
  • 14
  • 31
0

Actually the web.config is uploaded when you publish your website with Visual Studio 2010. There must be a setting where you are not letting web.config to upload.