Visual Studio compiles but the exe isn't there

后端 未结 13 801
终归单人心
终归单人心 2021-01-17 11:22

Source code that compiles fine on other peoples environments won\'t correctly work in my environment. When I do a rebuild the compile occurs but when visual studio goes to

相关标签:
13条回答
  • 2021-01-17 11:41

    I got TWO Release folders: one in the solution folder and one in the project folder. The former contains the .exe file, the latter does not.

    0 讨论(0)
  • 2021-01-17 11:43

    I just wanted to chime in and ask: have you looked for the *.exe file name from the directories above? What I found in my case was it was writing to the directory right above the /release subdirectory. Not sure how I missed that detail, but I did! I suppose it never occurred to me earlier because I saw the buildlog.htm being written to the /release subdirectory, and the very existence of the directory itself. In my case it was compiling, linking, etc. I just wasn't able to see the *.exe in that /release subdirectory.

    0 讨论(0)
  • 2021-01-17 11:44

    Maybe VS creates the exe, and before it tries to move it to the final destination your virus scanner grabs it and removes it, or moves it to a save location.

    0 讨论(0)
  • 2021-01-17 11:44

    In my case, my network security team released an unannounced security update that preventing me from creating any .exe files. I figured that out at midday after trying all the solutions (+ more) here.

    0 讨论(0)
  • 2021-01-17 11:46

    It happened with me today:

    TL;DR; You might be using some C# code in your project who belong to a language version which is not supported by the .NET Framework version targeted by your project

    Details:

    I had two projects in my solution. One project was already existing. I added a new project targeting most recent .NET Framework v4.6.1 supported by Visual Studio(VS) 2017 class library project template. I used some C# language features which is present in C# v7.0. In such a case, VS can compile the project but can't create the output in bin directory.

    Eventually I had to merge the new project code files into the existing old project which was targeting .NET Framework v4.5.1.

    So I changed the target Framework version to the latest .NET Framework v4.6.1 for the existing projects also. Then the old project also started supporting my newly pasted C# language features.

    0 讨论(0)
  • 2021-01-17 11:48

    If the exact same solution works on other machines, then it's an environment problem and no amount of looking at the project, linker, etc is going to resolve this. What is different about the environments? Are the same service packs and QFE's applied for not just Studio, but also the OS? Is there a difference in processors (64/32-bit)? Are your permissions the same? Do you have the same SDKs installed?

    I'd agree with Shahi that just trying to build a "hello world" app against the same SDK and see if it will compile is valuable info.

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