Related
I am running into a peculiar bug when developing on Visual Studio 2017 that I have been able to ignore for a while, but is now beginning to really bug me.
I refer to this issue as a bug rather than an error because I am still able to build my projects in Visual Studio and deploy them to my development device without errors or warnings from the build output. This might seem alright to ignore for a bit, but over time it has become an issue because my intellisense is underlining it in red as an error
every time I reference attributes from the Resource class. As you might guess, I refer this class a lot and the Visual Studio editor eventually becomes cluttered with these "errors" which (a) hinders my ability to find actual errors in my code and (b) irritates me beyond all reason...
"Error" Investigation
As shown in the last image, intellisense is picking up an "Ambiguous Reference" to each attribute in the Resource class. When I check my Resource.Designer.cs file I only see one reference, but get a second error
.
It is now telling me that that a "Member with the same name is already declared". This lead me to believe that there is a second Resource.Designer.cs file, but my solution explorer and windows explorer both show only one.
Attempted solutions
Changed the namespace from InventoryApp (the default namespace of the file) to InventoryApp.Resources. This rid me of the ghastly errors but, upon building the project, it reverts the namespace in the file back to it's default, and the errors pop back up. I was also told by somebody who knows better that this is a big no-no.
Deleted the Resource.Designer.cs file, deleted the "obj" and "bin" folders from the project, cleaned and rebuilt the solution, then added the new Resource.Designer.cs file back to my solution. This did nothing to solve the problem.
Created an entirely new project from scratch. Even after creating a Blank Android App from the Visual Studio templates, the error persists. This begs the question: Is this a problem with my installation of Xamarin.Android?
Side-notes
The Resource.Designer.cs file's Build Action is set to "Compile"
The .csproj config file contains the tags:
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
6/6/2018 Update
If you have ReSharper, you most likely will be able to disregard my per-project solution described below and, instead, simply install the latest version (currently ReSharper 2018.1.2). Apparently, the underlying issue was caused by a bug in a previous version. Upgrading resolved the issue for me.
See youtrack.jetbrains.com/issue/RSRP-469636 for more information.
Thanks to #davidbauduin over at Xamarin Forums for this information.
I believe I have figured out the underlying issue and have a viable solution.
Solution
Add the following to the <PropertyGroup> section in your .csproj file:
<AndroidUseManagedDesignTimeResourceGenerator>False</AndroidUseManagedDesignTimeResourceGenerator>
Reason
While previous versions of Visual Studio had that feature turned off by default, the latest VS2017 update (15.7.3) has it turned on. That feature generates a second Resources.Designer.cs file that results in the ambiguous reference issue.
You can verify by hovering over the resource constant with the Intellisense error, right-clicking, selecting "Go To Definition", and selecting the 1st item, which takes you to a Resource.Designer.cs file. If you repeat, but select the 2nd one, you'll be taken to a different Resource.Designer.cs file. One of these points to the obj\Debug\designtime\Resource.Designer.cs file. By setting that feature to False as described above, that Resource.Designer.cs file in the obj\Debug\designtime path will not be generated.
Information Regarding the AndroidUseManagedDesignTimeResourceGenerator Feature:
https://developer.xamarin.com/releases/android/xamarin.android_8/xamarin.android_8.1/#design-time-builds-managed-resource-parser
https://github.com/dotnet/project-system/blob/master/docs/design-time-builds.md#design-time-builds
Hope this helps!
I have Visual Studio 2013 with no plugins or anything fancy. Whenever I'm coding, every so often (maybe once every half hour) intellisense randomly stops completing my sentences or popping up at all when I press Ctrl+Space.
I have tried Tools->Import and export settings->Reset all settings but it did not help. The issue came right back.
The only thing that solves it for me now is to close VS and reopen it. But as you can imagine, this is extremely frustrating.
I was having the same problem and this seemed to work for me.
http://omegacoder.com/?p=1008
Basically, go to Tools >> Options >> Text Editor >> All Languages >> General and make sure that both Auto list members and Parameter information are checked (not the half-checked/square state).
This is still happening in VS2013 update 4 (I have a WPF project using C#).
This was relatively easy to fix by closing then reopening the file not the whole project.
For me, Unloading and Reloading a project fixes MVC cshtml intellisense. Right-click project, click Unload. Right click grayed out project, click Reload.
Just to be clear, this problem only happens to me when in C# MVC views, only when checked into TFS.
I have also submitted this as a bug to Microsoft, see https://connect.microsoft.com/VisualStudio/feedback/details/932855/vs-2013-c-default-mvc-template-breaks-upon-checkin-to-tfs-2010
Looks like my issue cleared up after deleting the settings folder from my previous VS2010 installation. I followed the instructions here (Also applies to VS2013): http://www.haneycodes.net/visual-studio-2012-intellisense-not-working-solved/
In case URL breaks:
Open the start menu and type “%AppData%” and press enter to get to your Application Data Folder.
Either you were automatically placed in the “Roaming” folder or you weren’t. If you weren’t, go to the “Roaming” folder.
Open the “Microsoft” folder.
Open the “VisualStudio” folder.
Here you’ll see a folder titled “11.0” (the VS 2012 folder) and probably also “10.0” (the VS 2010 folder).
DELETE (or rename) the “10.0” folder. Note that you can now kiss your Visual Studio 2010 settings and preferences goodbye (your projects will be safe and sound).
DELETE (or rename) all other folders that are not the “11.0” folder, assuming you used to have Visual Studio 2008 or whatever.
Now restart Visual Studio 2012 and you should be good to go!
try to delete the .suo file of your solution. It worked well for me.
The first thing I should mention is that this hasn't happened since I've upgraded my RAM. I was at 4GB when this was happening. Often had multiple instances open as well as SQL Server.
I'm finding this seems to happen when I copy/paste controls on a page. Another side affect of this is that the designer.(cs/vb/xx) file is not updated right away and I don't have access to those controls in code behind.
I've tried a handful of things and here's a summary of what I've found so far:
If only 1 file/window appears to be affected, close/reopen that file.
If that doesn't work... in Visual Studio:
Click Tools->Options->Text Editor->All Languages->General
Uncheck "Auto list members"
Uncheck "Parameter information"
Check "Auto list members" (yes, the one you just unchecked)
Check "Parameter information" (again, the one you just unchecked)
Click OK
If this doesn't work, here's a few more steps to try:
If still not working, close all windows and reopen
If still not working, close/reopen solution
If still not working, restart VS.
(I haven't yet figured out why more drastic steps are required in some cases.)
For C++ projects:
MSDN has a few things to try: MSDN suggestions
The corrupt .ncb file seems most likely. Note that in VS2013 and later, it is the .sdf file, which can be found in the root folder. Try searching for filename:*.sdf.
From MSDN:
Close the solution.
Delete the .ncb file.
Reopen the solution. (This creates a new .ncb file.)
Notes:
Tested in VS 2013/2015
Logging possible causes:
Copy/pasting controls in a source page. I found that my designer.vb file didn't update from this, either.
Copy/pasting code from another page that caused an error because the code copied referred to a control that wasn't on the page I was pasting to.
C++ project has corrupt .ncb file
Like cacau says, you must first do a clean of the entire solution. Then restart VS rebuild the entire solution.
This sometimes happens when you are using Entity Framework or WCF services (Or the combination)
VS generates a lot of files then that contain code (the service reference for example). When you regenerate that code (And for example you are running a web project) sometimes you forget to stop the site. Then VS can't overwrite every file. Resulting in a global intellisense failure.
For me, the problem happens when I have two instances of same solution opened. On one of them I'm running Tests, while on the other I am making tweaks to code. Intellisense will quit working on me usually after I've run some tests and stopped the debug session manually.
The solution for me is to close all VS windows and reopen...
Did you try a clean build on your project?
VS might have become confused with some of its generated files..
None of the solutions in this thread worked for me.
what worked was that I deleted everything in the packages folder. when I rebuilt the solution, nuget got the latest versions of all the folders I deleted, and intellisense started working fine.
If I am not mistaken, the problem initially was caused by the contents of the "Microsoft.Net.Compilers.1.0.0" folder, but I dont know why.
If you have this problem in one file, make sure that this file is included in your project. Right Click the file, Select Include In Project. If the file is not included in your project, VS will treat it as a normal text file.
I followed the instructions given in response to the question : Visual Studio 2012 - Intellisense sometimes disappearing / broken (thanks to SajjadHashmi and others). I've copied the steps I followed (which worked for me) here in an attempt to be helpful.
1: Close all the tabs and open your file again. (Thanks to russds)
2: Clean the Build > Close the Solution > Restart Visual Studio > Open the Solution again
Further steps are listed if you follow the above link but some seem to no longer apply to Visual Studio 2013 (e.g. refresh Local Cache for intellisense).
I know that these steps involve restarted Visual Studio (which you are explicitly trying to avoid) but for those who find your question (such as me) a potential solution might be useful.
In case anyone else fell into the black hole I did ... I too suffered from this issue but NONE of the above solutions worked for me. Eventually I figured out that somehow the opening <body> tag had been deleted from my .Master page and that was causing all my .aspx pages to lose 95% of the Intellisense code hinting. Once I added the missing <body> back to my .Master page, the Intellisense finally started working in my .aspx pages again! Hope this helps someone ... just cost me 1.5 hours!
Sometimes none of suggestions here works - at least that happened to me.
But don't rush with configuration resetting, cleaning up visual studio configuration files and so on. If clean/re-build + vs restart does not work - problem might be in code itself.
In my case (vs2013) I had C++ class exposed in .h like this:
class MyClass: ...
{
....
DLL_EXPORT returnArgs function(InParameters)
}
where DLL_EXPORT is defined as :
#define DLL_EXPORT __declspec(dllexport)
Same function in .cpp:
returnArgs MyClass::function(InParameters)
{
}
vs2013 was refusing to jump between function definition / implementation.
Reason seemed to be DLL_EXPORT macro - I've written function like this:
DLL_EXPORT returnArgs MyClass::function(InParameters)
{
}
After that intellisense started to work again.
It's possible also to remove that define or wipe it out - according to visual studio documentation __INTELLISENSE__ - but that define did not work for me for some reason. Code snipet like this:
#ifdef __INTELLISENSE__
#define DLL_EXPORT
#else
#define DLL_EXPORT __declspec(dllexport)
#endif
Please comment if you understand why this does not work.
In vs2015 this issue seems to be fixed, but there are other problems with vs2015.
None of these things worked for me. After lot of struggle I found why it was not working for me. I always had multiple solutions open in my machine. For suppose, One solution is for front-end layer and another solution is for back-end layer.
When it hits breakpoint kept in backend service layer intellisense was not showing up. After I closed all other solutions and rebuild the solution where I wanted to debug, everything worked fine.
There could be other reasons, but this worked for me and wanted to let this community know and it may help someone.
EDIT: Few times "delete all breakpoints" and adding again worked.
I had the same problem and in my case it was the same file being open twice. For example I have dev\include\myfile.h AND dev\include\myfile.h\ (note the backslash, making this a unique string).
This happens when I use F12 to find a symbol in an include file, but also have the original .h file open already; Visual Studio opens up a duplicate file, which is really the same file.
When saving either of the two instances, the changed file date will be noticed and I get a popup asking whether I want to reload the other instance. More problematic seems that it also confuses IntelliSense. I just tried closing all duplicate instanced files, and IntelliSense started working again without restarting or reloading anything.
I tried to fix my problem by solution VS2013 Intellisense constantly stops working
But it did not work for me.
Solution that worked for me is off/on Auto list members
Go to Tools > Options > Text Editor > General
I have stumbled into an issue that is really annoying.
When I debug my software, everything runs OK, but if I hit a breakpoint and edit the code, when I try to continue running I get an error:
Metadata file 'XYZ' could not be found
After looking around for a while, I found some a similar issues, but they were all regarding a build failure, which is not my case (this happens only after edit-continue).
What I have tried so far:
My code is compiling and running.
I cleaned the solution and restarted VS.
I made sure that the missing file's project is being build for the configuration I am running (in configuration manager).
I manually built the missing file's project.
Some extra info:
It does not matter what I change, still get the same error (the change is not related to the missing file).
This happens also when I pause and continue (not only breakpoints)
I am running the project using a custom configuration (configuration manager...). When I run it using the default Debug configuration the error does not occur.
Any ideas?
Eventually what solved the issue was:
Clean every project individually (Right click> Clean).
Rebuild every project individually (Right click> Rebuild).
Rebuild the startup project.
I guess for some reason, just cleaning the solution had a different effect than specifically cleaning every project individually.
Edit:
As per #maplemale comment, It seems that sometimes removing and re-adding each reference is also required.
Update 2019:
This question got a lot of traffic in the past, but it seems that since VS 2017 was released, it got much less attention.
So another suggestion would be - Update to a newer version of VS (>= 2017) and among other new features this issue will also be solved
As far as I can tell, this happens when the project dependencies gets messed up for whatever reason (whilst all the inter-project references are still intact). For many cases, it is NOT a code issue. And for those who have more than a few projects, going through them one at a time is NOT acceptable.
It's easy to reset project dependencies -
Select all projects and right click unload
Select all projects and right click reload
Rebuild solution
For those who have an issue in their code or some other issue that's causing this problem you'll obviously have to solve that issue first.
One possible reason could be you have upgraded the some of your projects (in the solution) to higher version e.g. from .NET 4.0 to 4.5 This happened in my case when I opened the solution in VS 2013 (originally created using VS 2010 and .NET 4.0). When I opened in VS 2013 my C++ project got updated to .NET 4.5 and I started to see the problem.
Generally this kind of error comes with human mistakes like if we change the namespace in some improper way, or changing folder names from explorer for current project etc, where compiler is unable to detect sometimes.
I came across the same error, to resolve which I tried few steps. Please follow all the steps :
Clean whole Solution
Right Click on every Project in your solution , Go to Properties and make your Default namespace as well as Default assembly name same as in your code (i.e namespace before class name)
Check Folder names for each project by going through the explorer(Where your project solution is). If not matching with your project names, make it similar (Like step 2) to them.
Remove all your references from each project relevant to another of same solution, and add it again.
In Your Project Solution folder, you will find Visual c# Project file. Right click and open with Notepad. In your initial lines you would find for lines for every project like below:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "**Client**", "**Client** \ **Client**.csproj", "{4503E259-0E3B-414A-9074-F251684322A5}"
EndProject
Check again Foldernames (I have highlighted in BOLD) and make it similar to what you did in step 2.
Clean the whole solution again
Build The Solution (If doesn't work try building individual after cleaning again)
Make sure all your dependent projects are using the same .Net Framework version. I had the same issue caused by a dependent project using 4.5.1, while all others were using 4.5. Changing the project from 4.5.1 to 4.5 and rebuilding my solution fixed this issue for me.
XYZ couldn't be found because is not built yet....
Right click on the solution and check Project Dependencies, the Project Build Order should also change according to the dependencies that have been set.
The only thing that worked for me was to delete the Solution User Options (.suo) file. Note that, this is a hidden file.
To locate this file, close your Virsual studio and search for .suo from the file explorer within your project.
PS: a new .suo file will be created again when you rebuild your project and hopefully this newly created one wont give you issues.
I hope that helps someone get rid of this anoying error :).
I had this problem for days! I tried all the stuff above, but the problem kept coming back. When this message is shown it can have the meaning of "one or more projects in your solution did not compile cleanly" thus the metadata for the file was never written. But in my case, I didn't see any of the other compiler errors!!! I kept working at trying to compile each solution manually, and only after getting VS2012 to actually reveal some compiler errors I hadn't seen previously, this problem vanished.
I fooled around with build orders, no build orders, referencing debug dlls (which were manually compiled)... NOTHING seemed to work, until I found these errors which did not show up when compiling the entire solution!!!!
Sometimes, it seems, when compiling, that the compiler will exit on some errors... I've seen this in the past where after fixing issues, subsequent compiles show NEW errors. I don't know why it happens and it's somewhat rare for me to have these issues. However, when you do have them like this, it's a real pain in trying to find out what's going on. Good Luck!
Well, my answer is not just the summary of all the solutions, but it offers more than that.
Section (1):
In general solutions:
I had 4 errors of this kind (‘metadata file could not be found’) along with 1 error saying 'Source File Could Not Be Opened (‘Unspecified error ‘)'.
I tried to get rid of ‘metadata file could not be found’ error. For that, I read many posts, blogs etc and found these solutions may be effective (summarizing them over here):
Restart VS and try building again.
Go to 'Solution Explorer'. Right click on Solution. Go to Properties. Go to 'Configuration Manager'. Check if the checkboxes under 'Build' are checked or not. If any or all of them are unchecked, then check them and try building again.
If the above solution(s) do not work, then follow sequence mentioned in step 2 above, and even if all the checkboxes are checked, uncheck them, check again and try to build again.
Build Order and Project Dependencies:
Go to 'Solution Explorer'. Right click on Solution. Go to 'Project Dependencies...'. You will see 2 tabs: 'Dependencies' and 'Build Order'. This build order is the one in which solution builds. Check the project dependencies and the build order to verify if some project (say 'project1') which is dependent on other (say 'project2') is trying to build before that one (project2). This might be the cause for the error.
Check the path of the missing .dll:
Check the path of the missing .dll. If the path contains space or any other invalid path character, remove it and try building again.
If this is the cause, then adjust the build order.
Are you using a database code generation tool like SQLMETAL in your project?
If so, you may be facing a pluralized to unpluralized transition issue.
In my case, I have noted that some old pluralized (*) table names (upon which SQLMETAL adds, by default, an "s" letter at the end) table references to classes generated by SQLMETAL.
Since, I have recently disabled Pluralization of names, after regerating some database related classes, some of them lost their "s" prefix. Therefore, all references to affected table classes became invalid. For this reason, I have several compilation errors like the following:
'xxxx' does not contain a definition for 'TableNames' and no extension method 'TableNames' accepting a first argument of type 'yyyy' could be found (are you missing a using directive or an assembly reference?)
As you know, I takes only on error to prevent an assembly from compiling. And that is the missing assemply is linkable to dependent assemblies, causing the original "Metadata file 'XYZ' could not be found"
After fixing affected class tables references manually to their current names (unpluralized), I was finnaly able to get my project back to life!
(*) If option Visual Studio > Tools menu > Options > Database Tools > O/R Designer > Pluralization of names is enabled, some SQLMETALl code generator will add an "s" letter at the end of some generated table classes, although table has no "s" suffix on target database. For further information, please refer to http://msdn.microsoft.com/en-us/library/bb386987(v=vs.110).aspx
Hope it helps!
I had this error come up. I followed all of the solutions here but nothing worked. I was using Visual Studio 2013 Professional. I couldn't get the individual project rebuilds to work and I finally figured out there was a circular dependency in my references. Visual Studio does a pretty good job normally of warning you if you are adding a reference to something that references back, but for some reason it didn't in this instance. I added a reference to a project that referenced the project I was working on - and it accepted it. VS bug perhaps?
My 5 cents.
This problem started after a solution wide clean.
I managed to get the problem to go away by setting the Active Solution configuration in: Build -> Configuration manager to release. Then build and set it back to debug again. The build succeeded after that.
Close VS, locate and remove the 'packages' folder from outside of visual studio. Restart VS and build -> all dependencies are reinstalled
Visual Studio 2019 Community 16.3.10
I had similar issue with Release build. Debug build was compiling without any issues.
Turns out that the problem was caused by OneDrive. Most likely one could experience similar issues with any backed-up drive or cloud service.
I cleaned everything as per Avi Turner's great answer.
In addition, I manually deleted the \obj\Release -folder from my OneDrive folder and also logged to OneDrive with a browser and deleted the folder there also to prevent OneDrive from loading the cloud version back when compiling.
After that rebuilt and everything worked as should.
this happens because of the difference of names in the folder name and namespace name. If u create a namespace in a certain name , and later you rename it the namespace will have the old name itself. And the compilation will take the old path to find the .dll and .exe file . To avoid this open the .csproj file of each namespace with a text file , and find the old path in the file.
remove this, clean and rebuild the solution. This worked for me. I spent an entire day working on this problem.
I had this and managed to fix it using this SO answer:
Metadata file '.dll' could not be found
I had to uncheck all of the boxes, click Apply, reenable all of the checkboxes and then click apply again, but it fixed the problem.
I just ran into this issue and after an hour of screwing around realized I had added an aspx file to my product that had the same name as one of my Linq-To-Sql classes.
Class and Page where "Queue".
Changed the page to QueueMgr.aspx and everything built just fine.
For a new build, it could be that some dependencies aren't installed. For me it was Crystal Reports.
It happens when one project dll is failing and that is referenced by number of projects. So first fix it and then Build individuals.
I ve had this problem and it has started after importing our solution to TFS as a new project.I came across this topic and found a quick solution with some inspiration from your answers.
All i needed to do is to rebuild the project thats supposedly lost its metadata file and voila , problem solved.
There's also one another silly reason which you should check with patience... as it occurred to me after wasting 4hours searching for answers:
The story to me was that I accidentally changed a small line of code among thousands of c# class files and then trying to rebuild the solution. As you could imagine, I ended up with 40+ meta data file missing errors and with 1 compilation error among them -- which I didn't check carefully, purely thinking all errors were the same!
after 4 hours searching and then accidentally double checking my error list, I found that silly code error, fixed it, compiled, and then error disappeared.
Not a good answer to your problem, but do hope my case wasn't same to yours.
I had the same problem. In my case I had by mistake I had set all the projects apart from the project with the main method as console application.
To resolve I went to every project other than the one with main function and right click> properites > output type > class library
it was happened to me because I've a strange clash in the namespaces:
I had
AssemblyA
with namespace
AssemblyA.ParentNamespace
witch defines ClassA
and in the same assembly another namespace with name
AssemblyA.ParentNamespace.ChildNamespace
witch defines a different ClassA (but with the same name)
I had then in AssemblyA.ParentNamespace IInterfaceB witch had a method that in the beginning returns IEnumerable and a ClassB witch implements IInterfaceB
I had later modified the method in ClassB to return IEnumerable but I've forgot to update the IInterfaceB definition, so the method there was still returning IEnumerable
the fun fact was that the solution still complile if I did a rebuild all, but the tests witch refers AssemblyA didsn't work and returns the "Metadata file could not be found"error.
updating InterfaceB to correctly return IEnumerable as its implementor ClassB did solved the problem, unfortunately the error message was vague and also the fact that the compilation worked makes me suppose that maybe there is something to fix in the compiler
A coworker was running into this problem and the cause was eluding us. Eventually we realized that the project directory (and therefore the path to the NuGet packages) contained %20 (thanks, some Git gui tool which shall not be named) and the error messages showed that the compiler was looking for an very similar-looking path but one which had to %20, rather a space. Apparently something in the build system somewhere performs HTML-decoding on local filesystem paths.
Renamed the working copy directory and everything started working.
I had this issue too.
It started after I did a little folder tidying in my project.
I then tried to compile and got many duplicate class errors. (despite them not being duplicated. I think the linking was just out of wack)
Upon checking these, the errors would all disappear leaving only the "Metadata file ...debug\application.exe could not be found" error.
I solved this by looking in the build output window to find which classes were duplicated.
I would then right click the class name and "go to definition".
there will be two definitions to select from, open them both, the second definition will seem to open the same file again, however the second one will identify as the error source(red underline).
Delete all the code out of the file and save(This will not effect your actual file).
This should now compile correctly.
Ensure that there are no spaces in the path to your project...
I am using Windows 10 with Visual Studio Community 2019 and I was cloning a multi project solution as it was from a GIT repo. I was having this error with all other dependencies in the solution along with a E_POINTER error. Its path, inherited from GIT, had spaces like C:/repos/MY PROJECT NAME/ ...
I deleted it, cloned it again and make sure that its path contained no spaces like C:/repos/MY_PROJECT_NAME/ ...
That fixed my problem.
I had same issue too.
In my case, I recently add an internal class to somewhere in project. One of the dependencies in solution has same class name and both of them are added correctly to references.
I changed my last activity and rebuild, it works.
Be sure that your compiler messages are valid. In my case I catch reference error from there, not listed as an error in Error List.
I am working on a C# application which I have divided it to few projects. Recently when the solution becomes larger, I get different errors such as MissingMethodException or even worse, DLL not found messages.
The only solution is to delete my bin folder and build the project again.
I wonder if this is a common problem with visual studio or might be I am doing something wrong?
UPDATE:
I am working on a winforms soloution, while one project is the form and other projects are user control, data models and etc.
I do reference the needed project in other projects using the visual studio's add reference option.
UPDATE 2
I am suspecting when I have a new .cs file to extend a class using partial keyword in any projects this happens!!!! I am 99% sure, I am going to check some more times to see of this is really the case!
It's not really a common problem but messy things can happen some times on visual studio.
What I would do is to check the settings and dependencies of every project and check things like they build in the correct order, platform, output path, etc. In our case, some times when the solution travels to many developers/computer settings can alter.
Also another thing you could do would be to copy the main project to a new solution and add the rest of the projects. This has worked form me in a similar situation.
I hope I gave you some ideas.
Why does Rebuild fail with no errors?
Since this morning, this error keeps showing up. I build the entire solution (25 C# managed projects) and a "Rebuild All failed" appears, but without any errors! (I have 13 warnings about COM not supporting Generics, but it's "normal" because one dll is exposed as COM.)
Not an answer per se - but you're better off looking at the output window and seeing what it says there.
Also, to help with that you might want to look at your MSBuild verbosity - as shown on this screenshot (last two options):
Beware - the highest level generates a MASSIVE amount of information.
Finally - running msbuild from the solution folder in a command prompt will really nail the issue - because error messages and warnings come up in red and yellow respectively.
I found my own solution and it is simple:
When this error occurs, save the project and close VS 2013. After that, re-open VS2013 and open the last project.
It works like a charm. But it is very annoying every time!
Many people reported this problem in VS2010, VS2012 and VS2013.
Could be a corrupt Solution User Options file.
Close the solution, delete its .suo (.v12.suo for VS2012+), reopen the solution, and Visual Studio will build a new one. You will lose the StartUp Project, breakpoints, bookmarks, which files are open, which projects/folders are expanded, etc. But that's all minor compared to the solution not building!
I had the same problem. I was trying to refrence a higher .net framework version(4.5.2) to lower .net framework version(4.5) which was causing build error. I made the version same in both projects and it worked.
Check the Output Window (View -> Output) as that will tell you what's going wrong. Sometimes a reference might be missing or there is an issue with the targeted version of .NET for one project in a solution.
Have you tried to clean the solution befor rebiuld it?
This is the list of checks & things I would do if I were you (try to build after each step):
Is error list activated? (Sometimes I forgot to activate and I can see only warnings & messages)
Check output window for error messages..
Clean solution.
Double check after clean that everything is deleted from debug folders.
Build it in release mode.
Build solution project to project until you isolate problematic project.
Remove COM and comment code to see if is this the source of problem.
Restart VS2010.
Restart windows.
Few moments ago I fix it with repair of .NET Framework installation (.NET Framework v4.0 Extended in my case).
I had the same issue in VS 2015. I tried the following with no success:
Close VS project and reopen
Close all open VS projects and reopen just the project that had the issue
Clean solution
Rebuild solution
Delete all files in bin\debug and bin\release
Lastly I tried Keith Robertson's answer, delete .suo (\Visual Studio 2015\Projects\[ProjectName]\.vs\[ProjectName]\v14\.suo). Although this didn't get me a good build, it did finally give me an error message stating that I had two entry points to my application. I went to application properties (Alt + Enter) and select a Startup object from the drop down.
This error seems a bit generic to me. I also went through this situation, but I managed to solve it differently than any of the ones mentioned here.
I have a project and several dependencies. And one of these dependencies has undergone a change.
When compiling the main project in debug mode, I verified that everything was ok.
However, switching to release mode and recompiling the problem occurred.Rebuild all failed and 0 Errors
By analyzing the debug output, I encountered an error:
Although the build dependencies are configured correctly. When compiling in release mode, the main project did not find the new method created in the secondary project.
So I had to recompile each secondary project one by one in release mode. After that, I recompiled the main project and everything worked.
Hope it helps someone!
I just had the same thing. For me, it helped to restart VS and run it as Administrator.
Select the appropriate target framework
- Right click on project
- Properties
- In application tab, Select the target framework
clean the solution
Try and build each project and see where the issue is.
Check each of the references (of each project) to make sure not have the yellow warning sign
Has the solution ever built?
I just had this happen to me, and realized that I left a '#error' line in my code and forgot about it. When I tried to build, the build failed but the #error line didn't show up in my errors.
Try searching all for '#error'
I fixed it on my new implementation of Visual Studio 2013 by going to the database project / Project Settings and noticing that the Target Platform was SQL Server 2014 instead of 2012 like it should be.
Once chance of getting this error is when we try re naming the service reference name, we give some other name in the service reference, but in the namespace some where it will be referring the old name, so if you delete and add a service reference then keep the same name, else we may face this error, but we can see the error in the Output window.
There are apparently many causes of this. I just found the cause of my issue: the .NET version of a new project I created was higher than the version of the top-level project. (4.5.2 vs 4.0)
I got a similar issue today, and fixed it with repair.
Start
Run…
Appwiz.cpl
(Find your installed Visual Studio version)
Right click
Change
Repair
In my case it was the wrong date and time of computer.
I was getting no feedback/messages/errors. Just that all projects failed to build.
I closed and tried again--I noticed an error saying "you are not authorized to access..."
I clicked on my account, re-entered my credentials, and rebuilt the solution.
Voila! I got what I am used to seeing when I build a solution -- plenty of errors in all their glory.
Hope this helps someone.
Here's yet another reason which may sound familiar to some. I had integrated some code into my solution that wrapped a DLL. The C# code file that came with it offered a nice managed API and handled the low-level LoadLibrary stuff to access the DLL. Both had the same base name, so I had SomeName.cs and SomeName.dll. I could just drop it into any project and it would work.
This wasn't so nice after a while as I started using it in different projects. I got copies of both the DLL and the wrapper code in multiple projects. So I figured it would be better to drop the wrapper code and the DLL into a new class library project and then reference that new project from other projects.
After I had done that, I started to get this issue. The build went well up until the very last stage and then failed without error. Output showed nothing but successes.
The problem was the name of the wrapping class library project. I used the same base name (SomeName) for this. By default the assembly name would be SomeName.dll and I already had one such file (the DLL to be wrapped), thus I had a conflict with output files.
After renaming the wrapping project and its output assembly to SomeNameWrapper, the problem went away.
This may not be your exact cause but it seems likely you have some name clash or deployment issue as well. And it is not surprising the compiler won't give you an error because there is no problem in the compilation phase, the trouble starts with deployment and apparently this does not come out in an obvious way.
I had the same problem the original poster was displaying with 0 errors and Rebuild all succeeded. The Output tab showed a message that a referenced dll was built with a higher version of the .NET Framework.
Changing the .NET framework to match resolved the issue I was having with 0 Errors and Rebuild All succeeded.
The solution:
Because Prerequisites not set for debug set only for release
01-Change solution configuration ( in main screen )
set (debug to release)
set solution platform to (Any CPU)
02-Set Prerequisites for debug ( If you want to continue in debug mode )
03-set target platform version for all Projects
Some of the files included in your solution are not in the correct directories, or you have changed the name of one or more directories in your application. In the solution explorer under Setup review the list of all files and remove those that are not properly listed in the SourcePath Property.
One of my dependency in View file caused this. Check your view files for any dependencies which is not injected yet.