我在這行代碼得到一個錯誤:團結 - 依賴解析失敗(沒有註冊)
using (IMaterialClient rawMaterialServiceProxy =
ServerUtility.Container.Resolve<IMaterialClient>())
錯誤:
Resolution of the dependency failed... The current type, Xxx, is an interface and cannot be constructed. Are you missing a type mapping?
我不是註冊一個具體的IMaterialClient。在剛剛看過的Pluralsight視頻中,他們說你不必註冊所有類型,因爲如果沒有指定,Unity會找到一個實現。有改變嗎?我錯過了什麼嗎?爲什麼不解決?運行此程序時,具有實際IMaterialClient實現的程序集位於bin文件夾中。