启动模板项目时出错: Abp.AbpException
:
没有给定id为2的租户
我已经检查了数据库,有默认的租户和用户将被创建。但加载swagger失败,出现错误:
获取错误内部服务器错误http://localhost:21021/swagger/v1/swagger.json。
检查了txt日志,下面是错误堆栈,我搞不清楚租户id 2应该传递到哪里。
错误2019-01-09 14:54:25221[7]microsoft.aspnetcore.server.kestrel-连接id“0hljlvt04bst8”,请求id“0hljlvt04bst8:00000003”:应用程序引发了未处理的异常。abp.abpexception:在abp.multi Tenancy.tenantcache中没有给定id为2的租户 2.Get(Int32 tenantId) in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\MultiTenancy\TenantCache.cs:line 35 at Castle.Proxies.Invocations.TenantCache
2\u在castle.dynamicproxy.abstractinvocation.procedure()在castle.dynamicproxy.abstractinvocation.procedure()在castle.proxies.tenantcache获取get.invokemethodontarget() 2Proxy.Get(Int32 tenantId) at Abp.Zero.EntityFrameworkCore.DbPerTenantConnectionStringResolver.GetNameOrConnectionString(DbPerTenantConnectionStringResolveArgs args) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore.EntityFrameworkCore\Zero\EntityFrameworkCore\DbPerTenantConnectionStringResolver.cs:line 50 at Abp.Zero.EntityFrameworkCore.DbPerTenantConnectionStringResolver.GetNameOrConnectionString(ConnectionStringResolveArgs args) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore.EntityFrameworkCore\Zero\EntityFrameworkCore\DbPerTenantConnectionStringResolver.cs:line 45 at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext[TDbContext](Nullable
1 multi-tenancyside,字符串名称)位于d:\github\aspnetboilerplate\src\abp.entityframeworkcore\entityframeworkcore\uow\efcoreunitofwork.cs:abp.entityframeworkcore.repositories.efcorerepositorybase的第107行 3.get_Table() in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 39 at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.getallincluding(表达式) 1[] propertySelectors) in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 88 at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.getalllistasync(表达式) 1 predicate) in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 108 at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task
1实际返回值,func 1 postAction, Action
在abp.configuration.settingstore.getalllistasync(可为空)中的1个finalaction 1 tenantId, Nullable
1个用户标识)位于d:\github\aspnetboilerplate\src\abp.zero.common\configuration\settingstore.cs:abp.threading.internalasynchHelper.awaittaskwithpostactionandfinallyandgetresult[t](任务 1 actualReturnValue, Func
1动作、动作 1 finalAction) at Abp.Configuration.SettingManager.<>c__DisplayClass40_0.<<GetUserSettingsFromCache>b__0>d.MoveNext() in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 436 --- End of stack trace from previous location where exception was thrown --- at Abp.Runtime.Caching.CacheExtensions.<>c__DisplayClass9_0
2.<b\uu 0>d.movenext()---来自引发异常的上一个位置的堆栈结束跟踪---在abp.runtime.caching.cachebase.getasync(字符串键,func 2 factory) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheBase.cs:line 182 at Abp.Runtime.Caching.CacheExtensions.GetAsync[TKey,TValue](ICache cache, TKey key, Func
2工厂)在d:\github\aspnetboilerplate\src\abp\runtime\caching\cacheextensions.cs:abp.configuration.settingmanager.getusersettingsfromcache(useridentifier user)的第60行,在d:\github\aspnetboilerplate\src\abp\configuration\settingmanager.cs:abp.configuration.settingmanager.getreadonlyusersettings(useridentifier user)的第430行d:\github\aspnetboilerplate\src\abp\configuration\settingmanager.cs:abp.configuration.settingmanager.getsettingvalueforuserornullasync(useridentifier user,string name)中的第403行 1 tenantId, Nullable
1个用户ID,d:\github\aspnetboilerplate\src\abp\configuration\settingmanager.cs中的布尔值fallbacktodefault):abp.aspnetcore.localization.abpuserrequestcultureprovider.determineprovidercultureresult(httpcontext httpcontext);d:\github\aspnetboilerplate\src\abp.aspnetcore\aspnetcore\localization\abpuserrequestcultureprovider.cs中的第29行microsoft.aspnetcore.localization.requestlocalizationmiddleware.invoke(httpcontext上下文)位于microsoft.aspnetcore.authentication.authenticationmiddleware.invoke(httpcontext上下文)位于microsoft.aspnetcore.staticfiles.staticfilemiddleware.invoke(httpcontext上下文)位于microsoft.aspnetcore.cors.infrastructure.corsmidlware.invoke(httpcontext上下文上下文)位于abp.aspnetcore.security.abpsecurityheadersmiddleware.invoke(httpcontext httpcontext),位于d:\github\aspnetboilerplate\src\abp.aspnetcore\aspnetcore\security\abpsecurityheadersmiddleware.cs:microsoft.aspnetcore.server.iisintegration.iismiddleware.invoke(httpcontext httpcontext)的第26行microsoft.aspnetcore.server.kestrel.core.internal.http.httpprotocol.processrequests[tcontext](ihttpapplication`1 application)info 2019-01-09 14:54:25227[7]soft.aspnetcore.hosting.internal.webhost-请求在182.7895ms内完成
1条答案
按热度按时间deyfvvtc1#
这是浏览器 swagger 缓存问题,我授权 swagger 昨天。
最好清除浏览器缓存。这就是为什么有一个租户id 2。