Visual Studios repeatedly has a PDB API call fail while building project - windows

so I have a project that was housed in another directory that I copyied and moved into another directory in order to dump it into a local git repo that was previously running an earlier version of the code( I know why am I doing this copying stuff well it is a long story and irrelevant). after attmepting to build the project in visual studios 2019 I get the following error during the build.
Severity Code Description Project File Line Suppression State
Error C1090 PDB API call failed, error code '3': C:\Users\chad.lahue\AppData\Local\Programs\Git\TOC\project\TOC\Debug_sim\vc142.pdb TOC C:\Users\chad.lahue\AppData\Local\Programs\Git\TOC\project\TOC\TOC.cpp 1
so after looking up what causes this issue and trying the reboot sugestion to no avail or killing a second msbuild.exe process I have noticed in the task menu that about halfway through the build a second msbuild.exe comes up when building this project and does not on any project that builds successfully
Also the code is the same as well as the project settings as far as I can see from the original directory that it was copied from which still builds just fine.
My question is : 1 is this a code issue / project settings issue or is there some kind of directory or computer glitch?
: 2 has anyone else experienced this type of compiler error and had to resolve it in a more complicated way than what is normally suggested for this error ie. restart computer or kill the second msbuild.exe ? better yet has anyone ever had a project that generates 2 msbuild.exe's during the build process which causes it to fail as it appears to be here?
for others experiencing this issue despite updating their vs like I did the following project settings fixed the issue for me, I have also tried the /FS solution on another project that started experiencing the same issue
For those getting the issue with vc142.pdb try setting "Configuration Properties->C/C++->Output Files->Program Database File Name" to "$(TEMP)vc$(PlatformToolsetVersion).pdb"
It could also work for the other pdb's by setting "Configuration Properties->Linker->Debugger->Generate Program Database File" to "$(TEMP)$(TargetName).pdb".
My best guess is the files are being locked by mspdbsrv.exe due to parallel compilation.

for others experiencing this issue despite updating their vs like I did the following project settings fixed the issue for me, I have also tried the /FS solution on another project that started experiencing the same issue an it seemed to clear it up for good as well.
For those getting the issue with vc142.pdb try setting "Configuration Properties->C/C++->Output Files->Program Database File Name" to "$(TEMP)vc$(PlatformToolsetVersion).pdb"
It could also work for the other pdb's by setting "Configuration Properties->Linker->Debugger->Generate Program Database File" to "$(TEMP)$(TargetName).pdb".
My best guess is the files are being locked by mspdbsrv.exe due to parallel compilation.

I had a similar problem except during my CICD process. I found that removing the pdb files from my repository caused the build process to function correctly since the pdbs would no longer be locked down by the build process.

Related

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.

Exceeded retry count of 10. Failed

I am trying to run a sample code and same code was absolutely fine yesterday and Today,It started throwing following error , any ideas to solve this problem?
I tried cleaning. Stopping all processes related to the application , nothing worked :(
Severity Code Description Project File Line Suppression State
Error Could not copy "obj\Debug\TodoREST.dll" to "bin\Debug\TodoREST.dll". Exceeded retry count of 10. Failed. TodoRESTWS
Severity Code Description Project File Line Suppression State
Error Build action 'EmbeddedResource' is not supported by one or more of the project's targets. TodoASMX C:\Users\wadhw\Downloads\TodoASMX\TodoASMX\Views\TodoListPage.xaml 0
Are you working with Visual Studio? This is a known bug, an update was released yesterday to fix it.
You can see the release notes here.
Which say:
Compilation fails because process cannot access dll (after VS2017 update
2 (v15.2))
Although I now see that the error message is slightly different. You can also try this:
Close VS (or whatever)
Go to your code on the filesystem
Delete all the bin and obj folders in each of the project folders
Now open up your IDE again and try to rebuild.
Just delete your bin folder in your project it will work

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.

msvsmon is locking up my pdbs

During developement of my media center plugin (which has a few custom build steps to gac stuff and such) msvsmon has a rather annoying behaviour.
First compilation usually goes well, but subsequent compilations complain about myplugin.pdb being locked
Error 1 Unexpected error creating debug information file 'C:\Users\sam\source\myfile.PDB' -- 'C:\Users\sam\source\obj\Debug\myfile.pdb: The process cannot access the file because it is being used by another process.
If I exit VS and nuke the object directory, I am able to compile again. Also, if I kill off msvsmon.exe I am able to compile again (but can not debug)
Has anyone seen this error? Are there any workarounds?
I already disabled live semantic errors, just in case.
A simple workaround : You can often rename a locked file even if it can't be deleted, so just rename the locked pdb to .pdb_ or something. You don't have to restart the IDE then
I had the same issue today with GAC-ing some assemblies and referencing them from my StartUp project.
My solution was to edit my StartUp project, and delete the GAC reference to the assembly, and re-add the assembly as a project reference. This worked just fine for me, but is not the ideal solution...

Resources