mvc 单元测试提供程序未返回 ProviderManifestToken 字符串
目前正在使用 NUnit 进行测试,我得到了 “提供商未返回 ProviderManifestToken 字符串” 每当我执行测试时都会出错。我认为它无法访问位于单独项目中的 web.config 。我想知道如何将连接字符串传递到单元测试项目?或者我是否必须在单元测试项目本身中存储连接字符串? .resx 文件是什么?不? 任何帮助表示赞赏。 谢谢!
currently using NUnit to test and I'm getting a
"Provider did not return ProviderManifestToken String"
error whenever i execute the test. I figured it's not able to access the web.config which is situated in separate project. I was wondering how to go about passing the connection string to the Unit Test project? Or do i have to store a connection string in the Unit test project itself? resx file? no?
any help is appreciated.
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的单元测试程序集名为 School.Student.Tests.dll,那么您需要确保 School.Student.Tests.dll.config 具有正确的连接字符串。
或者您需要将连接字符串从 web.config 复制到单元测试项目中的 app.config
If you have your unit-test assembly named School.Student.Tests.dll, then you need to make sure that School.Student.Tests.dll.config is there with the proper connection string.
Or you need to copy your connection string from web.config to app.config in your unit test project