简体   繁体   English

在Visual C#Express 2010中进行编译时,不包含代码更改

[英]Code changes not being included when compiling in Visual C# Express 2010

At seemingly random times, whenever I load up VC# Express for the day and start working, any changes I make to my code don't get reflected in my debug runs. 在看似随机的时间,每当我一天加载VC#Express并开始工作时,我对代码所做的任何更改都不会反映在调试运行中。 It's as if VC just refuses to compile the code and just runs the old already-compiled version. 就像VC只是拒绝编译代码,而只是运行已编译的旧版本一样。 Deleting the "bin" folder in the project directory doesn't help, as then VC just complains that it can't find the *.exe instead of recompiling. 删除项目目录中的“ bin”文件夹无济于事,因为VC仅抱怨它找不到* .exe而不是重新编译。 Doing a rebuild helps, but only for that one rebuild, so I'm continuously having to rebuild the solution to see any changes, which is really slow. 进行重建是有帮助的,但仅适用于一次重建,因此,我不断不得不重建解决方案以查看任何更改,这确实很慢。

The only way I've found to get rid of this problem (for maybe a week or two) is to create a new project and manually copy over my code. 我发现摆脱这个问题(大约一两个星期)的唯一方法是创建一个新项目并手动复制我的代码。 Needless to say, this is really frustrating and tedious. 不用说,这确实令人沮丧和乏味。 Is this a documented issue? 这是有记录的问题吗? What can be done to fix it? 该如何解决? Searching online doesn't really turn up any answers, as the search terms most applicable to the problem bring up a lot of noise results. 在线搜索实际上并不能提供任何答案,因为最适用于该问题的搜索词会带来很多噪音结果。

You might see if the project you are working on is set to Build when the solution builds. 解决方案生成时,您可能会看到正在处理的项目是否设置为“生成”。 To check this, right-click your Solution and go to Properties. 要对此进行检查,请右键单击“解决方案”,然后转到“属性”。 Click the Configuration Properties node on the left and make sure all of the projects you want to build are checked on the ride side for your given build type. 单击左侧的“配置属性”节点,并确保在运行侧检查了要构建的所有项目中给定的构建类型。

UPDATE: Also, what is the timestamp on your build files? 更新:另外,您的构建文件上的时间戳是什么? Is the timestamp getting updated on your build? 时间戳是否在您的构建中更新?

I had this problem when working on a network drive, and the time on the server was out of sync. 在网络驱动器上工作时出现此问题,并且服务器上的时间不同步。 Linux+Samba accessed by Win7 Pro and VB 2010 Express. Win7 Pro和VB 2010 Express访问Linux + Samba。

Correcting the time-difference solved the issue. 纠正时差可以解决此问题。

单击BUILD-> REBUILD SOLUTION,您现在可以开始了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM