6

If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded." lines after each project. Yet at the bottom:

========== Build: 6 succeeded or up-to-date, 1 failed, 0 skipped ==========

By building the projects one by one, I have found the 'failing' project and I tried to build it all by itself. It depends on one other project and that builds just fine all by itself. I try building the 'failing' project by itself and I get zero errors and no warnings and a build failed. However in the 'bin' folder for that project, (if I delete the old bin file) I am getting a built dll. Doesn't do me much good though, since the build is 'failing', visual studio makes no effort to launch my project in debug mode.

Here's something puzzling: In the command line, I have navigated to the directory with my .sln file in it, and I then run this command:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release

Then, in bin/Release, voila, I have my built project. The build passes in the command line but not the IDE.

Does anyone have any suggestions? This problem has happened to me twice: Once on windows server 2008 and once on windows xp sp3.

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
  • Build your projects one by one, from the lowest level going up (so, those that have 0 references to other projects first). Find the one that fails. – Oded Jun 30 '12 at 21:34
  • Just to confirm: You have rebooted and restarted Visual Studio? – Oded Jun 30 '12 at 21:35
  • Oded, I know which one is failing already, i tried each one like you suggested: but the build output says it built successfully with no errors – Isaac Bolinger Jun 30 '12 at 21:35
  • haven't rebooted, but i've restarted vs. – Isaac Bolinger Jun 30 '12 at 21:36
  • Try a reboot. It _may_ help (I have seen reboots helping when restarts don't). – Oded Jun 30 '12 at 21:38
  • That will have to wait: This is on a remote server :( – Isaac Bolinger Jun 30 '12 at 21:39
  • Are all projects selected to build under that particular configuration (in configuration manager)? – Marcel N. Jun 30 '12 at 21:46
  • Restarting didn't help. There isn't some kind of setting that fails builds due to warnings is there? – Isaac Bolinger Jul 03 '12 at 16:47
  • 1
    You will have to go to Visual Studio Options dialog and navigate to Projects and Solutions | Build and Run. Change MSBuild project build output verbosity to Detailed or Diagnostic and then analyze the output. That should give you hint on what is the root cause. – Lex Li Jul 04 '12 at 05:50
  • someone on another user account can build the project on that server, so its not hopeless at least. – Isaac Bolinger Jul 04 '12 at 19:30
  • The bug has happened on another computer, that I just installed VS2010 on fresh. – Isaac Bolinger Jul 24 '12 at 18:22
  • I seem to remember that at some point, VS used to count the "error" string in the message output to count the number of errors. so if you had a filename with "error" in it, it would generate an error event if it build properly. – Max Jul 24 '12 at 18:31
  • that could be, but this is only happening on 2 of the maybe 10 machines that are involved in this project, under the same svn checkout. – Isaac Bolinger Jul 24 '12 at 18:34

4 Answers4

4

Visual Studio 2010 says Build failed with no errors after I change a source file

One answer there suggested that I change the place from where I'm building. Here's the path of the debug directory:

C:\Users\Isaac\Documents\Visual Studio 2010\Projects\checkout\Library Projects\BaseSystemCore\BaseSystemCore\bin\Debug

Just moving the checkout directory to c:\ did the trick. Something to do with the build path being too long.

Community
  • 1
  • 1
Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
1

I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.

nldev
  • 299
  • 3
  • 15
0

Close Visual Studio. Run cmd, and type: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release yoursolution.sln Then, enter again on VS and run your project. Worked for me!

Lücks
  • 3,806
  • 2
  • 40
  • 54
0

if your solution contains too many projects ,

build projects individually,

Check which project is failing

for that project check the references of that project , if on any reference if their is yellow color mark, then delete that reference , and add that again , then build and check,

this will work

or

check in output window , each line , in some line it may be showing , dependency is their, but file didnt exist

that is the problem causing

this may be due to file corruption

Amit
  • 1
  • 2
  • 9