MSTest 找不到 App_GlobalResources 程序集

发布于 2024-09-19 09:12:52 字数 142 浏览 2 评论 0原文

尝试使用 mstest 对 Web 应用程序进行单元测试时,我遇到了 Web 应用程序中 App_GlobalResources 文件夹中包含的资源的问题。

这些资源是在运行时构建的,因此在运行单元测试时找不到它们。

你如何解决这个问题?

Trying to unit test a web application using mstest I have that problem with resources included in App_GlobalResources folder in the web applications.

Those resources are built at runtime and because of that they are not found when running the unit tests.

How are you solving this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

今天小雨转甜 2024-09-26 09:12:56

我发现的最可接受的解决方案是避免使用 App_GlobalResources 并在编译时配置资源构建:

http://odetocode.com/Blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-项目.aspx

The most acceptable solution I have found is to avoid using App_GlobalResources and configure resource building at compile time:

http://odetocode.com/Blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-projects.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文