天天看點

Unity Ioc 類型初始值設定項引發異常,The type name or alias SqlServer could not be resolved. Please check your configuration file and verify this type name.

先看一下unity的配置資訊

其中WzzApi.Db.DataBase是接口程式集命名空間,WzzApi.Db.DataBase.Sqlserver是接口實作程式集命名空間。

報錯資訊如下所示:

Unity Ioc 類型初始值設定項引發異常,The type name or alias SqlServer could not be resolved. Please check your configuration file and verify this type name.

出錯原因:啟動程式裡沒有引入這兩個程式集,無法找到這兩個程式集,是以會報unity初始化出錯。

解決辦法:啟動程式裡右鍵,添加引用,将這兩個程式集添加到引用中。雖然你的啟動程式裡并沒有直接使用到這兩個命名空間,但是依然需要添加這兩個項目程式集。

本文來自部落格園,作者:搖曳de風筝,轉載請注明原文連結:https://www.cnblogs.com/pinzi/p/15571999.html

繼續閱讀