Unable to resolve service for type的問題


今天寫了一個方法和接口,需要將接口通過依賴注入的方式注入到Controller里面,但是卻出現了InvalidOperationException: Unable to resolve service for type 'WebAPI.Services.IPropertyCheckerService' while attempting to activate 'WebAPI.Controllers.CompaniesController'.在網上搜了之后才發現,需要在StartUp的Service里面注冊一下。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM