How to quickly clear thousands of CS0234 errors in Visual Studio 2019 - visual-studio

This is a shared project that was working for me until today. It still compiles without errors in our CI system and for all of my teammates, but my computer started getting more than 3000 CS0234 errors when I compile this solution.
I tried cleaning the solution, I manually deleted the bin and obj folders, I deleted the packages folder and got all the NuGet packages again from the package source, I even rebooted my machine. Nothing helps.
These are not real errors, if I double click an error message, the source file opens initially with red ink, but this quickly disappears, then the error is removed from the error list.
I can fix my problem by simply double clicking each error and waiting a few seconds, but there are over 3000 error messages. My question is, is there a faster way to get Visual Studio back in sync. Since this only affects my machine there must be some kind of cache somewhere that's broken and if I could find it and delete it, maybe this situation would be resolved quickly.

Related

Visual Studio 2015 debugging: Symbols cannot be loaded until I restart my computer

Recently, whenever I change something in my code, rebuild, and attempt to debug, I get the error "This breakpoint will not currently be hit, No symbols have been loaded for this document."
But then as soon as I restart my computer, everything is fine and I can debug properly. Why is this happening? It's really frustrating having to restart my desktop every time I try to debug my code. I've looked all over stack overflow and MSDN and can't find any solution to my particular problem. Any help is appreciated
"This breakpoint will not currently be hit, No symbols have been loaded
for this document."
(As for this error message, it's common error which has different causes. I can't give the most direct correct answer for this issue, I can only give you some tips for trouble-shooting. In order to avoid losing contact in the round-trip comments, I post those content as answer instead of comments.)
Since VS2015 have been released for long time, I would think this issue is a particular one, not found similar issues online.
First of all, please create a new simple project to check if this issue occurs in new project when debugging.
If it persists in new project, I think this issue has something to do outside environment like VS settings, VS config files or Debug options.
You can try:
1.Go Tools=>Import and Export Settings=>Reset all settings =>No,just reset settings=>Finish
2.Repair VS IDE since it seems to work well in the past, and just got the issue recently, so maybe something is broken for your IDE(In Control Panel find VS2015, right-click=>change=>repair). Also, make sure you have the latest VS2015 Update3 instead of earlier versions.
And if it works well in new project, then maybe the issue is about the whole project or solution itself. You can try:
1.Navigate to solution folder, close all vs instance, delete the .vs, bin and obj folders and restart VS to check if it helps.
2.Make sure you've loaded the required symbols, check the content in your Modules window during debugging, there's possibility you don't load necessary symbols successfully.
3.Check the output folder after your rebuild, check in folder like bin\debug folder if you have both the .exe and .pdb files. And make sure the .exe and .pdb files are up-to-date after your rebuild by checking their Date Modified.
Hope it helps and more info about the project type, dependencies would be better:)

VS2017 - Build returns D8050: failed to get command line into debug records

I'm using VS2017 (Enterprise) to build a project. I'm pretty new to VS and especially to setting up my machine for a big project, so please do let me know if you need more info.
A while ago, my build was working fine, all cpp files were compiling well. Then I made some changes to a few cpp files (harmless little changes). But after I restarted my machine, I keep getting a
D8050: failed to get command line into debug records
The full error message is:
D8050 cannot execute 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\c1xx.dll': failed to get command line into debug records projectnameC:\Users\username\Documents\reponame\projectname\cl 1
However, this seems to be a really outdated error. I can't find the official support doc for this error (when I click on the error code on VS, it leads me to the support main page) and all the S/O questions are from 3-4 years ago. This question's answer suggests changing the TMP variable, but this can't be found under Properties anymore.
Just fyi, my OS is Windows 8, and my computer shut down abruptly while the project was building (it's a borrowed laptop, battery is old). I'm wondering if that has anything to do with this issue.
Again, please let me know if you need more details (eg logs).
I was able to solve this by switching to a user with admin rights, I had a feeling this was something related to user-permission rights
I was suggested by a friend to do a clean build (clean + rebuild), but this also failed.
What did solve my problem was deleting and reinstalling VS all over again. This reset the program files folder for VS and my build is working again.
I did uninstall McAfee at the same time, because I saw somewhere that antivirus software might be disturbing the build, but I'm not sure if this affected the build.

VS 2015 Xamarin: Warning IDE0006 Error encountered while loading the project

I am developing an Android app using Xamarin.
Visual Studio shows this warning, and I don't know what it means. I've followed the instructions but I can't seem to find the temp\\file
Severity Code Description Project File Line Suppression State Detail Description
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. daijoubu-app 1 Active To see what caused the issue, please try below.
1. Close Visual Studio
2. Open a Visual Studio Developer Command Prompt
3. Set environment variable “TraceDesignTime” to true (set TraceDesignTime=true)
4. Delete .vs directory/.suo file
5. Restart VS from the command prompt you set the environment varaible (devenv)
6. Open the solution
7. Check 'C:\Users\Noli\AppData\Local\Temp\\daijoubu-app_*.designtime.log' and look for the failed tasks (FAILED)
The full source is available on github.
I just followed the instructions but it did not eradicate the warning,
although I ignored it, it does not appear now.
When rebuilding the project, I noticed it takes a long time because it downloads a zipfile on your %userprofile%/AppData/Local/Xamarin/zips/*
-Make sure to not interrupt the build because it will stop downloading and will cause an invalid zip later on, thus reproducing this issue?
Another hypothesis is that I included a component(referenced a dll) and then deleted it, and then re-added it. (as I'm having trouble with intellisense)
Firstly, it's not an 'Error' it's a warning.
Here's what actually happens:
Visual studio/xamarin check for required sdkbuild tools for your project
If you have it already in your SDK then no problem
If not, your project will show above warning in most of project cases.
How to fix this :
Clean your solution
Rebuild it (at this stage visual studio will automatically try to download zips)
If you get Rebuild canceled error, then close visual studio and start again
At this stage it will definitely download required zips.
Again Clean -> Rebuild -> Build -> Close the visual studio and open it again
Or Simplest alternative is
Download all SDKBuild tools available.
Your warning will be gone.
Let me know if it works, coz its worked for me several times.
I too had both Intellisense and compilation issues.
On my Xamarin Forms and Android project, what worked for me is checking out the Resource.Designer.cs file in my Android project, quitting Visual Studio, and then re-opening it.
Hope that helps somebody.
I had this error also. The error was totally my fault, I was adding some strings to my strings.xml file and accidentally left an empty item in there
<string name=""></string>
This broke the R.java file in a really bad way, as the string/resource didn't have a name/id this is how it was created within R.java.
public static final int =0x7f080060;
As you can see it's missing its identifier. The moral of the story is: check all of your XML for any errors.
i had got this warning for 5 days. i applied this suggestion and problem is end.
to install package: 'Xamarin.Android.Support.[BLABLA]'
unzipping has failed:
Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
in the C:\Users\[UserName]\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.0.1.3\content directory
Reason: File C:\Users\[UserName]\AppData\Local\Xamarin\zips\96659D653BDE0FAEDB818170891F2BB0.zip is not a ZIP archive
1) Downloading the zip and installing it didn't solve my issues, I got fewer errors, but in general, the messages stayed the same, Please install package [BLABLA], Unzipping failed,...
2) Next I took a look at the zip file they mention in C:\Users\[UserName]\AppData\Local\Xamarin\zips and indeed, 96659D653BDE0FAEDB818170891F2BB0.zip was corrupt. I deleted this zip, did build my project again, and after the build process (this takes a while, leave it 'building': you see your zip reappear and growing to 135MB) all the previous warnings/errors were gone!
Save and close your project.
Go to your path folder.
Move the bin and obj folders from the Android folder to another
location.
Run the project again.
Moving these folders means deleting them and backing them up just in case!
I solved it this way. I hope it helps. :)
I also had this annoying experience, in App2.Droid
"Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled."
... but I seem to have fixed it on my pc.
At certain times when rebuilding my project I also had other errors than the usual ones, telling me
to install package: 'Xamarin.Android.Support.[BLABLA]'
unzipping has failed:
Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
in the C:\Users[UserName]\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.0.1.3\content directory
Reason: File C:\Users[UserName]\AppData\Local\Xamarin\zips\96659D653BDE0FAEDB818170891F2BB0.zip is not a ZIP archive
1) Downloading the zip and installing it didn't solve my issues, I got fewer errors, but in general, the messages stayed the same, Please install package [BLABLA], Unzipping failed,...
2) Next I took a look at the zip file they mention in C:\Users[UserName]\AppData\Local\Xamarin\zips and indeed, 96659D653BDE0FAEDB818170891F2BB0.zip was corrupt.
I deleted this zip, did build my project again, and after the build process (this takes a while, leave it 'building': you see your zip reappear and growing to 135MB) all the previous warnings/errors were gone!
It seems manually putting the unzipped files in place didn't work because VS was still trying to unzip the corrupt zip file.
This zip file is unzipped after the first build of the droid project. I remember initially I manually stopped the building of the droid project several times because it was extremely slow and it appeared to hang: probably the first build action tried to download the zip file and unzip it,
canceling (I might have even shot down VS one time) that build that took like forever (I had a terribly slow internet connection that evening) corrupted the zip.
Note:
in C:\Users[UserName]\AppData\Local\Xamarin\zips there are several zip files, my error did tell me the name of the right one.
in C:\Users[UserName]\AppData\Local\Xamarin\Xamarin.Android.Support.Design I had several 23.X folders, one with content in its 'content' subdir, and one without: the 23.0.1.3 one, as specified in the error texts.
Edit: basically what #trycatch answered, his first option is confirmed ;)

Visual Studio 2015 can't open project.exe for writing. Access to path denied

I am developing a VB.NET (4.5 framework) solution in Visual Studio 2015, Win10 OS, and have been able to run the builds uninhibited for several months, but now I am receiving the following error upon starting the build:
vbc : error BC2012: can't open
'C:\MyProject\ProjR5\ProjR5\obj\Debug\ProjR5.exe' for writing: Access
to the path 'C:\MyProj\ProjR5\ProjR5\obj\Debug\GenTagR5.exe' is
denied.
At first, VS2015 would give me the option to run the last successful build, but even that is no longer an option. After exhaustive internet searches on this problem, none of the dozen or so given solutions are solving my issue.
Here is what I have tried in order to resolve the error so far:
Ran sfc /scannow (elevated prompt)
Using ProcessExplorer, find handle or DLL substring that included my project
Made sure there were no hanging procs (including procs with my project name, devenv.exe, [project].exe, [myproject].vhost.exe, etc.)
Restarted VS2015
Restarted VS2015, running "as Administrator"
Restarted Computer
Full Shutdown of computer
Complete Rebuild of Solution
Build->Clean Solution
Build->Clean Solution, then Build->Build Solution
Build->Rebuild Solution
Uninstalled and Reinstalled VS2015
Disabled all indexing
Removed "Read Only" attribute from entire project folder and files within
Checked startup scripts for like- or identical processes
Disabled all AV apps
Disabled all antispyware apps
Disabled all firewalls
Verified that Application Experience (services.msc) wasn't disabled (I'm using
Win10 ... it isn't even in the list of services)
Set Tools->Options->Projects and Solutions->Build and Run->Max. parallel
builds to 1
Rerun aspnet_regiis.exe (under .NET\Framework)
Checked Local Security Policies and verified account was listed under
"Impersonate a client after authentication"
Removed \bin and \obj folders
Put \bin and \obj back when removing them didn't help
Removed \bin and \obj folders, then Rebuilt
None of these have worked. Any suggestions?
The problem ended up being Samsung Magician's Rapid Mode losing data during its write-caching phase to my solid state drive. I turned off Rapid Mode, and now the project builds without any problems.
Sorry for came too late, but i had this problem and i wanted to show how i fixed for the next devs who need a solution:
It's quite simple, just change your proyect assembly name:1) On your solution explorer: Right click on your proyect.
2) Properties>> aplication>> assembly name>> change it.
3) Compile, run to test it.
4) Change the name again if u wanted the original name.
Adding a description:
Changin the assembly name
New 2 programing in VS but i had same problem of Access or Write exe file ON BUILD.
Problem came out of nowhere. I didn't use or make changes 2 exe file in months,
made exe file, used it now and then and forgot about it....
Then after few months i wanted 2 start exe but no icon on desktop ??? ....tried everything, lost 3 days of searching inside code for error in VS and then called Google....
I read last comment ABOVE which mentioned Bitdefender, opened it and found BitD did block and isolate exe files ..... so i tried exluding files and folders which made problems inside BitD but no help....
So i went back 2 VS.
Within debug i got some X86 processor error which didnt make problem to build but it was warning (free component name in error description helped me ), - errors you can ignore but they are here on build ....
So i made last move before starting it all over again. Removed COMPONENT from application, deleted it on PC ...started VS from start .. and ALL was OK !!!
So in my case it was all about FREE component i used in app inside VS .... Bitdefender found some add / virus in it and blocked build progress.
BitD deleted or blocked exe file in start....
Hope this help anyone with similar problem !
The cause of this error for me was that Team Foundation Server had pulled in a bunch of files to my work space as Read-only. Not sure why it pulled them down from the server with read-only checked, but all I had to do was uncheck it.
Ok. Create a new solution and add its directories to the exception list and copy all your work, except for the '.vbproj' and except for the '.csproj' and the directory files to the directory of the directory of the new solution. I have tried that and it works, due that I have Bitdefender, it will be the only way to sort that issue. After doing so, try to build the app again. If it does not work, then I am definitely out of ideas.

Crash of the visual basic 6 IDE just before loading the project ends; only when source safe is active

I am at my wits end with this one.
I have a vb6 project that edits, compiles and runs well as long as I do not try to synchronize its files with the visual source safe 6.0d database at loading. I tried removing the .scc files, I tried filling the working folder from the database and vice versa, all to no avail.
The problem started when I tried to add a new class module to the project, for which VB6 complained that the .vbp project file should be checked out first. Somewhere after that I got an error and now this is the result.
What file could be the culprit in such a way that it does not interfere with 'source safe-less' execution, but causes a crash when I do use it???
I have been unable to reliably reproduce the error, but it seems to happen when the number of files in the project reaches a certain level. A workaround I found is to disable sourcecontrol before loading the project and loading the sourcecontrol AddIn after all files are present in the IDE.

Resources