Visual Studio 2017 - Access Denied Error on Rebuild - visual-studio-2017

I have a solution I created in Visual Studio 2017. All solution files are stored on a network location, accessed via a mapped drive. Up until earlier this week (April 10, 2018), everything worked fine. I could perform all required functionality.
Now, when I attempt to debug or build the release files, I get the following error:
Unable to copy file "obj\x64\Release\program.exe" to "bin\x64\Release\program.exe". Access to the path 'bin\x64\Release\program.exe' is denied.
The file is completely locked at this point. I can't do anything with it. I've done all of these suggestions found in other posts:
Make sure all instances of VBCSCompiler.exe are killed
Install the latest version of VS 2017
Install version 1.0.8 of Microsoft.CodeDom.Providers.DotNetCompilerPlatform
None of it works. I still get the error.
Now the real strangeness...
After I rebooted my machine the .exe file is removed from the release and debug folders. I can open the solution and rebuild the project successfully at that point, complete with a new, fully accessible .exe file. If I attempt to rebuild right away, with no changes made, the error shows up again.
I have to reboot my machine to release this file. That's hardly efficient.
If I copy the solution locally everything works fine. I don't have any issues.
I'm willing to move to working locally (as I'm sure it's a more advisable approach, but please spare me lectures on that topic) but I'd like to get to the bottom of this, if possible.
Thanks for any help you can offer...

Related

Visual Studio IDE error - Cannot access a disposed object

I'm getting the following error when trying to open any .cs file in my solution.
I've tried 1) restarting Visual Studio, 2) restarting computer, 3) delete all obj folders, 4) delete all .vs files and folders and still I can't open any files.
Same error message if I double click on the file in solution explorer or use F7.
The files do exist.
I've also tried disabling resharper in case it was that causing the issues, but it doesn't help.
I've also tried navigating to classes using Ctrl+T, entering class name and selecting the class. No error messages, but nothing loads.
This is the error I got when I tried to open an old solution: Cannot access a disposed object. Object name: 'WorkspaceContext'. I found the solution from Refat Eid's blog.
You just need to open the following directory and delete the content there:
%LocalAppData%\Microsoft\Team Foundation\7.0\Cache
Depending on your Visual Studio, you may have a different version number in your %LocalAppData%\Microsoft\Team Foundation. If you are not sure, copy the content to a temp folder first.
Other answers, either upgrading or reinstalling, basically serve the same purpose.
The problem here was that my solution folder was inside my OneDrive folder, which was doing automatic syncing with my OneDrive account.
Moving the solution folders out of the one drive folder made the errors go away.
I have the same issue but in Visual Studio 2019 Community Edition latest update which is Version 16.7.2.
After the update, all of my solutions that was bound in Azure Devops were experiencing problems when I try to checkin with the same error message as OP.
So, I deleted the folder but instead of:
%LocalAppData%\Microsoft\Team Foundation\7.0\Cache
I deleted this instead:
%LocalAppData%\Microsoft\Team Foundation\8.0\Cache
Then re-open my solution and it will rebind automatically after this message box:
In case it didn't rebind. Try to re-open your solution via Team Explorer -> Source Control Explorer and double click the solution directly on the Source Control Explorer.
In my case it was solved by simply restarting the visual studio.
I solved this problem, by re-downloading the vs installer (i apparently deleted my old copy), and telling it to run an update as well.
This is insane. Why should OneDrive synchronization cause this problem?
My Windows 10 system just installed a bunch of new updates today (4/11/2018). Immediately after those updates were installed I was unable to open any of my C# files in VS 2017 (error: Cannot access disposed object). All of these files opened without problem prior to today's updates.
Moving the projects off OneDrive solved the problem, as did opening the files in a previous version of VS (I tried VS 2015).
All of my VS projects are stored on OneDrive, with copies on my local drive. OneDrive claims that all my files are up to date, so I don't understand how this can be related to OneDrive synchronization.
Has anyone else suddenly run into this problem?
In my case, I have the solution file and its folder under OneDrive sync folder. Right click OneDrive system tray and click Settings. Under the Settings tab, uncheck Save space and download files as you use them checkbox (Files On-Demand)
I had the same issue, however after I upgraded to the latest version of Visual Studio 2017 (15.6.7), the error message disappeared, so I could open all files in the solution again. Hope this helps.
In my case this was due to deleting solution configurations which were not immediately saved, just saving all and restarting Visual Studio solved the problem.
In my VS2019. Closed VS. Disable Sync of One Drive Files, and reload project. Problem gone! It definitely seems somewhat related to OneDrive. Even though in my case all files were Sync'ed still pausing it and re-opening VS resolved. It could have been just restart of VS...
I had the same error. My solution is not stored in onedrive, but locally.
the full error message was :
error performing rename. cannot access a disposed object. object name invisibleEditor
the error happened when I renamed first the file from the solution-explorer window then clikced yes, which normally changes the class name as well, however this did not happen.
then when i tried to change the class name the error was thrown.
I restarted VS 2019 Enterprise 16.11.3 few times but that did not help.
I resolved this by:
undoing the renaming of the file in the solution explorer
deleting the .vs folder in my solution directory
deleting all the bin and obj folders in on my projects within then solution.
the renaming was then successful.
the error stack was :
System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'InvisibleEditor'.
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.InvisibleEditor.get_TextBuffer()
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyTextDocumentChange(DocumentId documentId,SourceText newText)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyDocumentTextChanged(DocumentId documentId,SourceText newText)
at Microsoft.CodeAnalysis.Workspace.ApplyChangedDocument(ProjectChanges projectChanges,DocumentId documentId)
at Microsoft.CodeAnalysis.Workspace.ApplyProjectChanges(ProjectChanges projectChanges)
at Microsoft.CodeAnalysis.Workspace.TryApplyChanges(Solution newSolution,IProgressTracker progressTracker)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.TryApplyChanges(Solution newSolution,IProgressTracker progressTracker)
at Microsoft.CodeAnalysis.Workspace.TryApplyChanges(Solution newSolution)
at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.ApplyRename(Solution newSolution,IWaitContext waitContext)
at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.CommitCore(IWaitContext waitContext,Boolean previewChanges)
at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.<>c__DisplayClass78_0.b__0(IWaitContext waitContext)
at Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.VisualStudioWaitIndicator.Wait(String title,String message,Boolean allowCancel,Boolean showProgress,Action`1 action)
at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.CommitWorker(Boolean previewChanges)
at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.Dashboard.Commit()
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Can't get past Microsoft.VisualStudio.MinShell.Msi.msi in VS2017 RC Update

I previously successfully installed Visual Studio 2017 RC Enterprise on Windows 10 Home. I saw in the Notifications area an update to a later version of the RC, and so I clicked on that notification to install it.
The installation got as far as the attempting to install the Android Emulators, but failed and the log said it needed Win10 Pro.
So I removed the emulator from the install options, but the install didn't complete and this time the log said:
[27ac:0038][2017-01-31T10:08:47] Download requested: https://download.microsoft.com/download/8/7/A/87AEAAB0-D624-400E-899E-61FAFAE42BA5/Microsoft.VisualStudio.MinShell.Interop.Msi.msi
[27ac:003a][2017-01-31T10:08:47] Attempting download 'https://download.microsoft.com/download/8/7/A/87AEAAB0-D624-400E-899E-61FAFAE42BA5/Microsoft.VisualStudio.MinShell.Interop.Msi.msi' using engine 'WebClient'
[27ac:0026][2017-01-31T10:08:48] Completed: Installing Microsoft.VisualStudio.MinShell.Msi
[27ac:0026][2017-01-31T10:08:48] Error: Package 'Microsoft.VisualStudio.MinShell.Msi,version=15.0.26109.1' failed to install. MSI: C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.MinShell.Msi,version=15.0.26109.1\Microsoft.VisualStudio.MinShell.Msi.msi, Properties: REBOOT=ReallySuppress ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL="7" VSEXTUI="1" VS7.3643236F_FC70_11D3_A536_0090278A1BB8="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise" , Return code: 1316, Details: The specified account already exists.
I tried to follow the instructions from Visual Studio 2017 RC Install Error "The specified account already exists." however its says the action is only valid for installed products
Yesterday I did notice MinShell in the Programmes Uninstall list and tried removing it from there.
However it makes no difference and every time I try and run the installer I get the same error. I have tried making sure that no VS2017 related items are installed in Programs and Features, and deleting directories manually from Program files etc
Starting to get really annoyed as I had a completely working compiler and IDE and I've already been totally unable to upgrade Win10 to the Anniversary Update due to the 0x8007002C – 0x400D error during Migrate-Data operation. I tried the fix of resetting the Storage app to make all defaults C:, and then the Documents link, but that didn't fix it, although I see I've missed Downloads, Pictures and Video, so will try again tonight but I still don't see it working, although I think the failure moved from 79% to 83%
#Peter Nimmo I had the same issue. Solve it by:
Go to C:\Program Data\Microsoft, go to Properties then click the Security tab and add System, then give full permission. The reason why it couldn't install is because it can't access the folder required.
Hope it works for you. If it doesn't, you could try the following additional steps:
Go to C:\ then at the search box type %temp% then delete everything in it.
Run this script in Powershell Admin mode: https://gist.github.com/heaths/77fbe0b44496960fab25c2eb0b9e8475.
This problem might be caused by setting a separate cache folder when installing. The steps below should fix it.
delete the visualstudio folder in your Registry editor HKEY_LOCAL_MACHINE\SOFTWARE(under Microsoft?)
run InstallCleanup.exe---> C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout
delete contents in your temp folder C:\Users\yourusername\AppData\Local\Temp(skip items that cannot be deleted)
run InstallCleanup.exe
inside C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout
then restart your computer
Go to %ProgramData%\Microsoft and rename VisualStudio folder (e.g. to VisualStudio_old)
Try again with fresh install.
Please temporarily disable 3rd party anti-virus software and try the following steps to check if it works for you:
Type “Administrative Tools” in search box
Open “Local Security Policy”
Navigate to “Software Restriction Policies” (If it displays “No Software Restrictions Defined”, please right-click on the “Software Restriction Policies” node and select “New Software Restriction Policies”)
Double-click on “Enforcement”
Select “All users except Local Administrators” and click on OK
Restart your computer and run the Visual Studio Installer as administrator to repair the installation
Please Refer : https://learn.microsoft.com/en-us/answers/questions/147767/visual-studio-2019-can39t-install-microsoftvisuals.html
similar error for me sort of, it starts installing then gets stuck on shell(minimum) and shell interops and the shell(minimum) resources and interop resources..then i get a fatal error, tells me that Visual Studio Devenv resource fails.. no matter what i try i cannot install on my windows 10 1607 anniversary update 3 64-bit with all updates to this minute. I read microsoft is aware and its become a huge problem, programming error. Anyone figures out how to install let me know please.
EDIT: so its a huge pain to get visual studio 2015 to install, i kept reinstalling it and everytime the error window came up i read the log, then i manually searched and installed components listed, and also had to manually create folders almost each time following the path listed in the log file. after 12 hours and alot of searching and installing i now have a fully functional visual studio 2015 pro edition back on my computer..i wanted 2017 but thats even worse to install..lol..

Can't run VS 2015 Community without /resetsettings; Getting CANTLOADLIBRARY on opening new projects, and crashing on new .cpp files

I have Windows 10, fully updated.
I downloaded and installed Visual Studio Community 2015 last week for the first time, (previously programmed in Code:blocks, still installed) and selected custom install to allow for C++ and Python programming.
Installation ran smoothly, but VS always fails on launch.
On first launch ever, it said it was setting things up for first startup; asked me for sign-in which I did, at which point it briefly showed something about my profile before saying 'An error occurred while starting for the first time. Please restart Microsoft Visual Studio'. Imgur images of all dialog boxes here, including parts of a processmonitor log I estimated to be around the general time of the error.
Closing and restarting several times didn't help.
Uninstalling and re-installing didn't help.
Rebooting didn't help.
And uninstalling, running Ccleaner's Cleaner and Registry Cleaner, rebooting computer and re-installing VS didn't help either.
Repairing the install from Programs also didn't help.
I managed to find the exact same error on Google Search for VS 2013 but the only solution was where one person got a completely new OS and re-installed VS on that.
I tried the other suggestions they had including running:
devenv.exe /safemode
devenv.exe /resetskippkgs
devenv.exe /resetuserdata
devenv.exe /installvstemplates
devenv.exe /resetsettings
the first 3 took me to the same sign-in screen. Regardless of signing-in or not, or running VS from the Administrator Profile or not, these option always give the same failed on first startup error.
Installvstemplates gives an error saying the operation could not be completed, but /resetsettings finally got me into VS.
That's about all it does though, I can go to the home page and access options/menu buttons, but signing-in makes it crash and reload again (but it does sign me in and take me to the home screen)
Signed-in/not and Administrator or not, VS crashes on opening a new .cpp file.
When I click Start a New Project I get "Error loading type library/DLL.(Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)). Closing VS and trying to open it normally from start menu still always throws the original error, despite working if I open it via /resetsettings.
I've also checked [HKEY_CLASSES_ROOT\CLSID{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32] in Regedit and found it is apparently correct.
I also used devenv /log to generate an xml file of the process when I open it.
Just to mention I have .NET Framework 4.5-4.6 installed with VS as well.
Looking forward to any advice.
So, for anyone else getting the same problem, I haven't gotten any other advice, since this post.
If you're still having probs # this point the only real solution seems to be a clean install of your OS .
I can confirm it solved all my issues, with VS + some OS problems I wasn't aware of . I can only assume they might've been related, good luck.

How to make a c++ project run on a different PCs

I developed a small c++ program in Visual Studio 2012 on Windows7, 64bit (let's call it PC1). On that pc it runs fine!
Since I didn't have a versioning control system like SVN at hand, I copied ALL the project data (the exact folder structure, DLLs, source files, project files...) to a usb stick and moved it to another computer.
On that other engine there's Visual Studio 2010 on Windows7, 64bit (PC2).
So I just changed the platform toolset to v100 as described here.
I successfully compiled the project on PC2 (clean, build) and wanted to run the exe, but the command prompt stayed empty.
I then tried to debug and added a breakpoint at the very first line of main - which wasn't reached, the command prompt was still empty.
Ok, a usb stick is certainly not the most secure solution for data storage, so I gave it another try and moved it again - the problem remains.
Visual Studio's output on PC2 is the same as on PC1, so I couldn't find any anomalies there.
Yeah, there might be many error sources, so where can I start?
And how can I get a more verbose output for troubleshooting?
Or is this even a common phenomenon (perhaps due to different VS versions) and there's an simple way fix it?
This is not a full solution, but at least I'm a tiny step ahead:
In my last comment I wrote:
I took your advices into account and created a brand new project on PC2, VS2010. I exactly followed this guide: http://frozenhamster.wordpress.com/2011/02/11/lapack-on-windows-with-visual-studion-2010/
That didn't work either, so I removed I "out-commented" everything except for a single cout. Voila, that worked!
But as soon as I make use of the desired Armadillo (LAPACK and BLAS), the project compils but does not run.
What's going wrong here?
I don't get any compiler errors!

Microsoft Visual C++ 2010 Express installation/run problems

I am running windows 7 and I am trying to get this IDE to work and I am have an incredibly frustrating time making it work.
I am following these instructions
Quick guide:
File > New > Project
Select "Win32 Console Application"
Enter a name and location, select OK
In the Win32 Application Wizard under "Application Settings", select "Console Application" and select "Empty project".
Click Finish.
On the right (or left) hand pane should be Solution Explorer. Open it and right click on the "Source Files" folder and Add > Add New Item.
Select C++ file (.cpp)
Write code, hit F5 to start with debugging, ctrl+f5 to start without debugging.
After step 4 I get the error, "The platform root directory "E:..........\MSBuild\Microsoft.cpp\v4.0\Platforms" does not exist.
What do I do? I installed it in my E drive, maybe what it wants is on my C drive? It is not possible for me to install it there though because I am using a SSD for my C drive.
Update, I have tried to uninstall and reinstall and then clear my temp folder and then reinstall and then uninstall with the uninstall utility and then reboot and the reinstall and none of that works.
I turning off my firewall and antivirus and installing and running and that did not help at all. Next I am going to format my hard drives and try and install again.
I tried installing the ultimate version and I had the same problem. I have no idea what to do, it seems like I am out of options.
Any ideas?
My best guess now is that I have to manually install the missing files somehow, where can I find those?
I installed Dev C++ and it works fine, should I just continue using this (as far as I can tell superior program) or try and fix Express?
Microsoft Visual C++ 2010 Express
The platforms root directory "E:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms" does not exist.
OK
--------------------------- The microsoft.cpp part is missing but it exists in the C drive. I copied that over to the E drive and now when I open a project I get a blank screen, if I open older ones it says I need .net framework 4.0 which I do have.
This has to be the worst program I have ever had to deal with, I have played video games in beta that worked better than that.
I think I got this working, I am not sure though.
It appears to be working but I get some strange errors, I am just going to accept this because at least now after an entire weekend I can begin my homework.
Since - as you've pointed out - you've already reinstalled VC++ and nothing seems to work and you've tried everything - you may also try this (if you've not given up yet):
you may try trial version of full visual studio VS2010 trial
you may try to install your VS express on friends PC on 'non-C' drive
perform antivirus check of your system
after installing full version - install service pack (VS SP)
ensure you uninstall all (if any) prior versions of VC, VB, VC# or visual studion that you may have
always reboot after installation
If (1) works this may suggest your VS express is somehow corrupted (would be weird to be able install it than - but I've seen so many weird things that I may believe it ;-)
If (2) works this may suggest your PC/OS is causing problems.
Let me/us know if any of above helps.
I would uninstall and reinstall the whole thing rather than keep spinning your wheels. Honest!
Q: Your "E:" drive is a read-write drive, isn't it?
Q: E: is the drive you installed to, correct?
Q: Hopefully, E: is a normal disk drive, isn't it?
If not (if it's a shared network drive, or a nice'n'slow USB drive), please consider installing VS2010 to a hard drive.
MSVS should not be hard to install or use. It takes awhile ... but it's usually pretty straightforward.
If you've having problems, then I strongly urge you to 1) uninstall, 2) reboot, 3) reinstall.
IMHO...
http://social.msdn.microsoft.com/Forums/vstudio/en-US/69925677-8a07-46a4-8b0e-c9ddef17a7af/visual-studio-2010-fails-in-c-trying-to-set-the-references-parameter?forum=vssetup
The solution in a similar case of installing VS2010 C# on a seperate drive was to copy the Reference Assemblies folder from C:\Program Files to E:\Program Files.
When I had the the same error as the poster above on VS2010 C++, when installing to a different drive, I did the same for the MSBuild Directory and the errors in VS2010 C++ disappeared.
It seems that Visual Studio installs/creates those directories on the same drive as windows 100% of the time, but the registry values still look for them on the same drive that you installed Visual Studio on.