1
我正在使用xunit來運行測試。一個接一個,它工作得很好,但是一旦我並行運行它,servicestack會拋出異常。ServiceStackHost.Instance已被設置(BasicAppHost)
System.IO.InvalidDataException : ServiceStackHost.Instance has already been set (BasicAppHost)
at ServiceStack.ServiceStackHost.Init() in C:\BuildAgent\work\799c742886e82e6\src\ServiceStack\ServiceStackHost.cs:line 175
appHost = new BasicAppHost(typeof(AppHost).GetAssembly())
{
ConfigureContainer = container =>
{
container.Register<IDbConnectionFactory>(
new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider));
}
}
.Init();