我試圖爲我的MVC5應用程序創建單元測試,我正在使用資源。我的問題是,當我執行測試時,會拋出這個異常。資源大會沒有找到
System.Resources.MissingManifestResourceException:無法爲指定的文化或中性文化找到適當的資源。確保「Resources.Ressources.resources」正確嵌入或在編譯時鏈接到裝配「GestionSaisieExternaliséeV2」,或者確保所有需要的附屬程序集都可加載並已進行了完全簽名
我的行動使用的資源的控制器。
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals(resourceMan, null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Ressources", typeof(Ressources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
的VS解決方案項目:
- MVC 5項目。
- 單元測試項目。
您是否驗證了錯誤消息中提到的所有內容?如果是的話 - 請確保用您的發現更新您的文章。 – 2014-09-25 14:04:31
我不知道要驗證什麼,我的資源文件「.resx」是bin文件夾和MVC應用程序的DLL也。 – HLS 2014-09-25 14:10:45
您是否缺少測試項目中的參考? – 2014-09-25 14:18:12