Visual Studio 2010 says Build failed with no errors after I change a source file
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?
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Has this issue when dealing with Sharepoint 2013 Workflows in VS 2013. To solve it did the following:
- Unload worklfows ( the buggy one) project.
- Delete .csproj.user file
Opened .csproj file in the notepad and delete the following lines:
<PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '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.
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!
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.
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.
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.
精彩评论