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

Visual Studio-2010Visual StudioBuild

Visual Studio-2010 Problem Overview


I have a Visual Studio 2010 solution with a few projects. I can successfully build with Build -> Build Solution or Build -> Build MyCompany.MyProduct.MyProject. After building I press CTRL+F5 and successfully run the start up project. This works as expected.

After I change a source file, save it and then again build (with either Build -> Build Solution or Build -> Build MyCompany.MyProduct.MyProject) it builds successfully. I am still able to press CTRL+F5 and run the startup project. This again works as expected.

The problem is in the following scenario: After I change a source file, save it and directly press CTRL+F5 then Visual Studio 2010 says BUILD FAILED and there are no errors. And it doesn't start my startup project (of course).

Am I missing something?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

Close Visual Studio, delete the .suo file for your solution. It's a 'hidden file' in Windows and contains user preferences, but it can also do nasty things.

Solution 2 - Visual Studio-2010

Seems a bit late, but what worked for me was to check my Output window.

I had a reference to a Function that didn't exist yet. I don't know why it never came up in the Error List, but the Output window told me exactly where the problem was.

Solution 3 - Visual Studio-2010

Try repeating the same steps by changing the location where you compile/run. Make sure your new location has less folders to traverse when compared to your old location. A lengthy path to the source code had resulted in a similar issue to me and I overcame it by choosing a shorter path.

Solution 4 - Visual Studio-2010

I closed my visual studio.

Deleted every bin folder. (I had a weird permission error, so I deleted the files and back track deleted the folders including bin).

Reopened visual studio. Performed build or rebuild and everything was working again.

Solution 5 - Visual Studio-2010

Check your project physical path , If is to long , Copy project to some root directory folder with very short name. And try to build your project.

Solution 6 - Visual Studio-2010

I had this problem and had one warning but couldn't find any errors. Eventually I copied the build command from the output window into a command window and ran it manually - it spat out four errors after the warning. I have no idea why this worked.

The command required should be labelled "CoreCompile" and look something like this: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;SILVERLIGHT;WINDOWS_PHONE /errorendlocation /preferreduilang:en-US /highentropyva- /reference:"C:\Dropbox\code

If you don't see it, try changing your build output settings under Tools->Options->Projects and Solutions->Build and Run, set "MSBuild project build output verbosity" to Normal or higher.

Solution 7 - Visual Studio-2010

In case some other folks are experiencing this issue (I had tried deleting the SUO file first but this didn't work for me):

I solved it by creating a blank new Project in my solution and importing all source files into the new project. Likely the problem sat in project file.

Solution 8 - Visual Studio-2010

I had the same problem, solved by the following step

go to Tool->option->projects and Solution->General, make sure to check the box "Always show Error List if build finishes with errors", in this case, visual studio will show the error list.

Solution 9 - Visual Studio-2010

In my case I did not see a Code Contracts bug in the output window:

CodeContracts: xxx: Unhandled Exception: System.IO.FileNotFoundException:
Could not load file or assembly 'System.Data.SqlServerCe, Version=3.5.1.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies.
The system cannot find the file specified.

I solved it by disabling Cache Results in the Code Contracts windows for that project, as suggested in this answer.

Solution 10 - Visual Studio-2010

I was working on a web site project that referenced a library project (in the same solution) when I ran into this issue. Build failed while the editor was highlighting syntax and navigating to the source. Very frustrating.

None of the other answers worked for me; I thought this issue might be related as I recently used DBML for the first time on this machine. Still not entirely sure it wasn't a contributing factor.

After cleaning solution, temp files, restarting VS, etc., I ended up excluding the 2 offending files, which allowed the solution to build successfully, then when I included them again everything built correctly.


p.s. I later discovered an error in the website's masterpage codebehind (referencing an enum value that had been removed), which was not being displayed as an error. I've had errors in masterpage codebehind cause (apparently) unrelated problems before; I try to remember to check there when a simple solution doesn't present itself.

Solution 11 - Visual Studio-2010

My issue arose from converting a functional vs2008 project to vs2010. All other projects in the solution came across fine, but this one would build the MIDL portion, then stop and fail. Detailed build setting revealed nothing, so finally I created a whole new project with all files the same. This worked. Then I compared the settings, and finally after changing the various parts to match, I discovered that the converted project had MIDL->General -> "MkTypeLib Compatible" set to blank. This was a valid setting in vs2008 apparently, but in vs2010, it apparently must be set to Yes or No (or inherit).

This has fixed my issue.

Solution 12 - Visual Studio-2010

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 didnt found it , that is the problem causing

this may be due to file corruption

Solution 13 - Visual Studio-2010

Has this issue when dealing with Sharepoint 2013 Workflows in VS 2013. To solve it did the following:

  1. Unload worklfows ( the buggy one) project.

  2. Delete .csproj.user file

  3. Opened .csproj file in the notepad and delete the following lines:

     <PropertyGroup>
      <VisualStudioVersion Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0'">11.0</VisualStudioVersion>
     <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
    

After RELOADING project into solution, the VS added exactly the same lines AGAIN, but no LoaderException issues now.

Solution 14 - Visual Studio-2010

I had this issue today as well... after changing the verbosity of build to diagnostic like @Jac suggested, i discovered that the problem relies in one my resx files. Apparently, one image was corupted or was too big, i deleted it and it worked!

Solution 15 - Visual Studio-2010

I faced that problem two days ago. I checked on Windows output and I founded there was a missing reference to VBIDE: Cannot find wrapper assembly for type library VBIDE. I showed all files on the solution explorer, expanded references and I found there was a reference to that assembly. I do not know how that reference came into my project and I was sure I did not need it. I just removed it and everything was fixed.

Solution 16 - Visual Studio-2010

Another thing to check is that if any of your source files are open it will not be able to build. I had to restart my computer.

Solution 17 - Visual Studio-2010

Some times if the Directory path is more than 248 chars it will fail the Solution. Make sure complete path is less than that.I have faced the same issue than i made short and it did worked for me.

Regards Venkateshwarlu, MSBI Developer, Hyderabad.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCecoView Question on Stackoverflow
Solution 1 - Visual Studio-2010keremView Answer on Stackoverflow
Solution 2 - Visual Studio-2010OrtundView Answer on Stackoverflow
Solution 3 - Visual Studio-2010GopiView Answer on Stackoverflow
Solution 4 - Visual Studio-2010ValamasView Answer on Stackoverflow
Solution 5 - Visual Studio-2010BJ PatelView Answer on Stackoverflow
Solution 6 - Visual Studio-2010JacView Answer on Stackoverflow
Solution 7 - Visual Studio-2010mottoView Answer on Stackoverflow
Solution 8 - Visual Studio-2010FionaView Answer on Stackoverflow
Solution 9 - Visual Studio-2010Daniel A.A. PelsmaekerView Answer on Stackoverflow
Solution 10 - Visual Studio-2010brichinsView Answer on Stackoverflow
Solution 11 - Visual Studio-2010Josh DaltonView Answer on Stackoverflow
Solution 12 - Visual Studio-2010AmitView Answer on Stackoverflow
Solution 13 - Visual Studio-2010dbardakovView Answer on Stackoverflow
Solution 14 - Visual Studio-2010Ofir WinegartenView Answer on Stackoverflow
Solution 15 - Visual Studio-2010JC NunezView Answer on Stackoverflow
Solution 16 - Visual Studio-2010xelanosatView Answer on Stackoverflow
Solution 17 - Visual Studio-2010user10103647View Answer on Stackoverflow