servicestack,C#,Asp.net,.net,servicestack" /> servicestack,C#,Asp.net,.net,servicestack" />

C# ServiceStack从V3升级到V4会导致成功构建,但在运行时为500

C# ServiceStack从V3升级到V4会导致成功构建,但在运行时为500,c#,asp.net,.net,servicestack,C#,Asp.net,.net,servicestack,我最近获得了ServiceStack V4的许可证,并从V3完成了整个升级过程。一切看起来都很好,但由于某种原因,我在运行时遇到了500个错误。由于重命名,我已确保web.config中引用的HttpModule正确。它当前正在引用ServiceStack.HttpHandlerFactory。我还检查了IIS Express日志,这些日志没有太大帮助。似乎只是说它在BeginRequest中失败了 我似乎无法使用Log4Net获取任何日志记录或调试信息。我看到来自RavenDB的信息被放入日志

我最近获得了ServiceStack V4的许可证,并从V3完成了整个升级过程。一切看起来都很好,但由于某种原因,我在运行时遇到了500个错误。由于重命名,我已确保web.config中引用的HttpModule正确。它当前正在引用ServiceStack.HttpHandlerFactory。我还检查了IIS Express日志,这些日志没有太大帮助。似乎只是说它在BeginRequest中失败了

我似乎无法使用Log4Net获取任何日志记录或调试信息。我看到来自RavenDB的信息被放入日志中,但ServiceStack本身没有任何信息。它似乎只是默默地失败了一个500

我可以肯定的是,如果我使用ServiceStack许可证appSetting,我会得到预期的许可例外。如果我有许可证,它只会给我这个通用500

这就是日志文件中显示的内容

2014-06-03 15:08:58,991 [1] DEBUG Raven.Client.Document.SessionOperations.QueryOperation [(null)] - Executing query 'ServiceName:PracticeManagement' on index 'dynamic/ApiClientAuths' in 'https://ravendb.someurl.com (DB: DB);DB'
2014-06-03 15:08:59,144 [1] DEBUG Raven.Client.Document.SessionOperations.QueryOperation [(null)] - Query returned 1/1 results
2014-06-03 15:08:59,168 [1] DEBUG Raven.Client.Document.SessionOperations.QueryOperation [(null)] - Executing query 'ServiceName:PracticeManagement' on index 'dynamic/ApiClientAuths' in 'https://ravendb.someurl.com (DB: DB);DB'
2014-06-03 15:08:59,251 [1] DEBUG Raven.Client.Document.SessionOperations.QueryOperation [(null)] - Query returned 1/1 results
下面是配置的调用

public override void Configure(Container container)
{
    //Set JSON web services to return idiomatic JSON camelCase properties
    JsConfig.EmitCamelCaseNames = true;

    SetConfig(new HostConfig { DebugMode = true });
    //logging
    LogManager.LogFactory = new Log4NetFactory(true);

    //Using an in-memory cache
    container.Register<ICacheClient>(new MemoryCacheClient());

    //Configure SQL database
    ConfigureSqlDb(container);
    ConfigureCrossSystemProviders(container);
    //Configure RavenDB
    this.ConfigureRavenDb("RavenDB");
    //Enable ApiKeys
    this.ConfigureApi("PracticeManagement");
    //Enable validation
    this.ConfigureValidation(typeof(GetRecipes).Assembly);
    //Enable Authentication
    ConfigureAuth(container);       
    //Enable exception management
    this.ConfigureElmah();
    //Configure CDE data
    ConfigureCdeProviders(container);
}
public override void Configure(容器)
{
//设置JSON web服务以返回惯用JSON用例属性
JsConfig.casenames=true;
SetConfig(新主机配置{DebugMode=true});
//伐木
LogManager.LogFactory=新的Log4NetFactory(true);
//使用内存缓存
Register(newmemorycacheclient());
//配置SQL数据库
配置sqldb(容器);
配置CrossSystemProviders(容器);
//配置RavenDB
此文件。配置RavenDB(“RavenDB”);
//启用ApiKeys
这是指配置API(“实践管理”);
//启用验证
此.ConfigureValidation(typeof(GetRecipes).Assembly);
//启用身份验证
ConfigureAuth(容器);
//启用异常管理
这个.ConfigureElmah();
//配置CDE数据
配置CDE提供程序(容器);
}
下面是web.config中的一些代码

<system.web>
  <compilation debug="true">
    <assemblies>
      <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </assemblies>
  </compilation>
  <httpModules>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
  </httpModules>

  <httpHandlers>
    <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" />
  </httpHandlers>
</system.web>

现在是webserver标记

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />

    <handlers>
      <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
    </handlers>
  </system.webServer>


我发现了问题。它出现在ConfigureApi方法调用中,与未正确执行的Funq解析有关。我仍然不知道依赖项解析的问题是什么,但我不再有一个模糊的HTTP 500故障发生。

请发布一些代码和异常堆栈跟踪。确保在
Configure
方法中设置了
DebugMode=true
。i、 e.
HostConfig=newhostconfig{DebugMode=true;}
。感谢您的回复。我本来会发布代码的,但由于这是一个500,并且无法获得任何关于在哪里查找失败的好信息,我只是不确定发布什么代码。我已经发布了一些来自对ServiceStack的配置调用和上面的web.cofig。调用日志根本没有帮助,因为ServiceStack没有在日志文件中写入任何内容,目前只有RavenDB。这可能更适合ServiceStack支持论坛。如果您刚刚购买了许可证,看起来您已经购买了。