Visual Studio locks output file on build

前端 未结 16 1352
一生所求
一生所求 2020-12-02 06:28

I have a simple WinForms solution in VS 2010. Whenever I build it, output file (bin\\debug\\app.exe) ends up locked, and subsequent builds fail with a message like \"

16条回答
  •  隐瞒了意图╮
    2020-12-02 06:43

    There is also a known issue 533411 where the usage of automatically updating build numbers can cause the locking issue. Workaround from bug report

    Temporary workaround would be disable assembly version update after the rebuild. In AssemblyInfo.cs file, remove the wild card from the AssemblyVersion attribute, for example:
    replace this:
    [assembly: AssemblyVersion("1.4.*")]
    [assembly: AssemblyFileVersion("1.4")]
    with this:
    [assembly: AssemblyVersion("1.4.0.0")]
    [assembly: AssemblyFileVersion("1.4.0.0")]

提交回复
热议问题