Visual Studio project not building when I click debug or press F5

前端 未结 8 1431
梦谈多话
梦谈多话 2020-12-29 18:27

VS2010 c#, winforms project.

It does not build automatically when I click on debug or press f5. If I manually build the project before I debug, it compiles and chan

相关标签:
8条回答
  • 2020-12-29 18:42

    Was scratching my head on this for a while, turns out our office's Folder Redirection configuration (e.g. My Documents to point to a Network location) did not integrate well with VS.

    0 讨论(0)
  • 2020-12-29 18:48

    Check your settings in Tools->Options.

    Go to the projects and Solutions area, Build and Run page.

    There is a setting "On Run, when projects are out of date:" Make sure this is set to 'Always build.'

    0 讨论(0)
  • 2020-12-29 18:48

    Because my project was independend from other projects by using prism I had to uncheck 'Only build startup projects and dependencies on Run' in Tools->Options->Projects and Solutions->Build and Run.

    0 讨论(0)
  • 2020-12-29 18:55

    When you work on a dependency

    In my case, I am working on a library used by an executable. It was necessary to say to the solution to include the dependency of the library in the executable project solution to build the executable code and the library code before launching the debugging:

    • Tools Menu, click on Options. Go to "Projects and Solutions/Build and Run", "On Run, when projects are out of date" needs to be on "Always build".
    • Right-click the Solution (not project) in the Solution Explorer and select "Project Dependencies". Check the boxes of dependencies "Lib1" and "Lib2".
    0 讨论(0)
  • 2020-12-29 19:04

    Just in case someone else runs into the same problem as I did: for me it turned out to be a setting in my web.config as follows:

    <httpRuntime fcnMode="Disabled" targetFramework="4.5" maxRequestLength="40960" executionTimeout="1200" requestValidationMode="2.0" />
    

    What this guy does is he disables File Change Notification, which is used to restart the application domain when a change is detected in critical files e.g. anything in the bin or .config files. Without fcn, I would make code changes, press F5 and still see the old code, and all breakpoints would be whited out because the source was different to what IISExpress was serving up.

    0 讨论(0)
  • 2020-12-29 19:05

    Right-click the Solution (not project) in the Solution Explorer and select Configuration Manager. Check if Build is turn off for the current configuration.

    0 讨论(0)
提交回复
热议问题