[英]Force Visual Studio Rebuild on Embedded Resource Changed
We have a SQL file that's an embedded resource in our solution. 我们有一个SQL文件,它是我们解决方案中的嵌入式资源。 When the sql file changes, and we click debug, the solution doesn't rebuild the project with the embedded resource if no actual C# code has changed.
当sql文件发生更改并且我们单击debug时,如果没有更改实际的C#代码,则解决方案不会使用嵌入式资源重建项目。
I've had this issue with other solutions as long as I can remember, and I personally know to do Build Solution to make sure it gets built...but this has become an issue for a number of new developers who can't remember to do this and get confused when their changes to the SQL file aren't reflected at debug time...so I was wondering if anyone knows an easy fix. 我已经遇到过其他解决方案的这个问题,只要我记得,而且我个人知道要做Build Solution以确保它已经构建......但这已成为一些不记得的新开发人员的问题当他们对SQL文件的更改没有在调试时反映时,这样做并感到困惑...所以我想知道是否有人知道一个简单的修复。
The easiest fix is to "rebuild" instead of "build". 最简单的解决方法是“重建”而不是“构建”。 Other people will "clean" and then "build" to be 100% sure.
其他人将“清理”,然后“建立”100%肯定。
Embedded Resources are not updated in the debugging DLLs unless the output DLL is truncated, which can only be guaranteed to occur with rebuild and clean. 除非输出DLL被截断,否则嵌入式资源不会在调试DLL中更新,只能通过重建和清理来保证。
Unfortunately, a clean and rebuild does not seem to always work for Resource files. 不幸的是,干净和重建似乎并不总是适用于资源文件。 My issue was with a string resource file, and how I fixed was as follows in VS2016:
我的问题是使用字符串资源文件,我在VS2016中如何修复如下:
I ran into the same issue with VS2017. 我遇到了与VS2017相同的问题。
This is what worked for me: 这对我有用:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.