VS 2012 .user file causes unnecessary builds

跟風遠走 提交于 2019-12-12 11:22:57

问题


There are a number of post in relation to Visual Studio building projects when not necessary. However, none seem to cover this particular issue.

I'm running Visual Studio 2012 Professional Update 4.

In my solution, I have a unit test project that has a project reference to a BizTalk Transforms project. This in-turn has a project reference to a BizTalk schemas project.

Every time I choose to run a unit test, the whole solution is built, even though no changes have been made.

The first line displayed in the build window is as follows:

Input file 'C:\Workspaces\rbowman\Branches\Current-branchRB\WareHouse\FFF.Enterprise.WareHouse.Schemas\FFF.Enterprise.WareHouse.Schemas.btproj.user' is modified after output file 'C:\Workspaces\rbowman\Branches\Current-branchRB\WareHouse\FFF.Enterprise.WareHouse.Schemas\bin\Release\FFF.Enterprise.WareHouse.Schemas.pdb'.

Note: it seems to be the .user file that's causing the rebuild. Does anyone know how to prevent this? Strange but I only seem to be getting the problem with BizTalk proj files. I am seeing this behavior across multiple solutions but the problem file is always identified as a btproj.user.

This screencast illustrates the problem: screencast link


回答1:


If you have just opened the solution, even if nothing has change since the last time you built, if you click Run All, it will as per the description in Test Explorer do a build.




回答2:


You should remove the *.user file from your source control.

These files store user specific settings and should never be checked into source control.




回答3:


I had the same problem. BizTalk projects insist on updating the btproj.user file on every build, resulting in a full rebuild every time.

I solved the problem with the following workaround: Set the ACL Write Flag on Deny. The build cannot update the file and the projects are only build when actually needed.

In my case build time went from 10 minutes to 2.



来源:https://stackoverflow.com/questions/33870271/vs-2012-user-file-causes-unnecessary-builds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!