I've been trying to install Visual Studio 2017 Community edition for about a week, but I keep getting the following errors.
Message Id: 1310 Message Details: Error writing to file:
Microsoft.SqlServer.Types.dll.
Message Id: 1310 Message Details: Error writing to file:
Microsoft.VisualStudio.PerformanceTools.Detours.dll.
I'm trying to install the desktop applications workload, or whatever it's called.
I've searched around on the internet, and tried a few things. Including
- Installing all pending windows updates.
- Uninstalling the VS installer, running a clean up utility, and rebooting.
- Trying to manually run the msi that is failing (they still fail).
- Uninstalling every SQL server thing on the machine.
I haven't been able to find anything on the internet, that solved my problem. Any help would be appreciated.
I think what might have happened is you might have some older versions of DLLs in place that you don't have permission to overwrite. Please uninstall VS 2017 again, then manually delete C:\Program Files (x86)\Microsoft Visual Studio 15.0 and/or C:\Program Files\Microsoft Visual Studio 15.0 then try the installation again.
This is assuming you don't need any pre-existing stuff in those directories.
The detours dll for example would be in something like C:\Program Files (x86)\Microsoft Visual Studio 15.0\Common7\IDE\PrivateAssemblies
It can be folder permissions related. Do you have permission to write to the directories you need? Try running the installer "as administrator", and make sure the user you are installing as will have the permissions to write to that folder and the program files folders. Maybe try installing in another directory.
Download the installer fresh again, it could be corrupted.
Make sure you did not run out of disk space.
Since there is a SQL Server DLL conflicting, maybe try uninstalling SQL server, clearing out directories manually that contain that DLL, then reinstall.
One of these things should help but it's hard for me to be sure without access to the environment. Good luck! I hope this helps.
Wanted to add this question to the pool in case someone has the same problem
I was unable to update Visual Studio 2017 on Windows 7 and got the following error:
Unable to install the files to target location. Error: The folder
'c:\Program Files (x86)\Microsoft Visual Studio\Installer' or a file
within it is locked by another program. Close any applications that
might be using it and try again.
The initial solution I found was to reinstall Visual Studio but felt that it might be unnecessary. The solution I found was to close down visual studio, go to "c:\Program Files (x86)\Microsoft Visual Studio\Installer", rename the folder "Installer" to something else then run vs_installer.exe from the renamed folder.
Hope that help someone.
I just recently encountered the same error while trying to update the Visual Studio 2017 installer on Windows 10. In my case, the c:\Program Files (x86)\Microsoft Visual Studio\Installer directory was locked because of virus/malware scanning software running in the background. After stopping that, the installation of the VS 2017 installer had no more problems.
What initially misled me about the source of the problem was that the process which had a lock on the files in that directory was the special System process in Process Explorer, so I was initially going down the wrong rabbit hole.
If you have malwarebytes then you can add to the allow list C:\Program Files(x86)\Microsoft Visual Studio and it will work.
I got it working by downloading the installer separately, rebooting, and running the installer directly.
VS Installer Downloads
I encountered this when trying to update VS2019. I could not rename the Installer folder. Rebooting didn't help. I tried uninstalling everything related to Visual Studio via Control Panel, but the uninstall failed. It removed everything except a subfolder containing VSIXAutoUpdate.exe and some dlls. The installer still would not run.
This final step allowed me to delete the Installer folder and do a fresh install of Visual Studio.
Open Task Manager > Processes Tab
End Process "VSIXAutoUpdate"
Delete folder "C:\Program Files (x86)\Microsoft Visual Studio\Installer"
TL;DR
Stop the Task Scheduler service and ensure no open handles for the C:\Program Files (x86)\Microsoft Visual Studio\Installer dir
Details
I just had the same problem, and even rebooting didn't help. So, I dug in!
Process Hacker revealed there was a lock on the following file by the System process:
C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXConfigurationUpdater.exe.
If I used Process Hacker to close the handle, it just immediately reopened again :/
I thought to check Task Scheduler (since it runs as SYSTEM in svchost), and sure enough there were tasks in there that run VSIXConfigurationUpdater.exe, even though they weren't actually running at that time.
So I stopped the Task Scheduler service, then used Process Hacker to close the handle on VSIXConfigurationUpdater.exe - and this time it didn't return! After ensuring there were no open handles on anything inC:\Program Files (x86)\Microsoft Visual Studio\Installer, the Visual Studio installer was able to update.
I found the culprit for me was Malwarebytes disabled this and all worked well. Hope this helps somebody.
I tried to run through the steps #Janspeed specified, but there were a couple of language folders in the resources directory that were corrupted/locked, so just renaming wouldn't work. I managed to copy most of the file/dir structure (minus the corrupted ones) to a new directory but had to run a chkdsk /f on a restart before I could get those folders freed up and deleted. Once I had this worked out, #Janspeed's steps worked fine, including just deleting the new directory that I had copied everything into.
I ran into this issue today, turns out it was MalwareBytes Endpoint Protection that was blocking the update which is rather annoying.
Luckily I'm the admin and developer so I was able to drop my laptop from the antivirus to enable the update and then re-add it but in a larger corporate environment with red tape this isn't great at all.
I had faced the same issue while updating Visual Studio 2017 and 2019. I tried to open the Visual Studio Installer directly as admin and then it worked as expecred.
Update kept failing when using the "Check for Updates" menu item in the VS2019 IDE. When I ran the Visual Studio Installer from the Windows Start bar it immediately prompted to download the latest version of the installer. Once that was done it then offered to update VS2019.
I'm trying to update Visual Studio 2012 C++ projects so that I can compile them in Visual Studio 2015 (Update 3). I've gotten it narrowed down to just one error in one project that I'm completely stumped on:
LNK1104 cannot open file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib.obj'
I've installed all the C++ language options (they don't get installed by default) and even uninstalled and reinstalled Visual Studio.
That file doesn't exist in that directory, and it also doesn't exist in the Visual Studio 2012 directory either.
Anyone have any ideas on how to solve this?
The problem might be that you added something like "$(VC_LibraryPath_x86)xxxx.lib" to the Linker input additional dependencies. This goes wrong, resulting in the error. It should just be "xxxx.lib".
Check your path. If that's correct then make sure you've written xxx.lib rather than xxx
I was trying to build one of my x86 projects in x64 and I tried the solution given here
set _IsNativeEnvironment=true
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" YourProject.sln
Now, I am getting the following error prompt when I try to open any of the visual studio solutions ....... is not a valid win32 application.
Note: I have been working on this solution for quite a while and there was no such problem.
Edit: My devenv.exe itself has got corrupted and it's size is 0 KB. I reckon that's the problem. Will try to reinstall visual studio and see if the problem persists.
I'm running visual studio 2013 professional on windows 8
Now, every time I try to start a new project solution in C++ win32 application, the idle-cursor turns to wait-cursor, nothing seems to happen for a long time, the minute i hit the screen, windows tells me visual studio isn't responding, then I'm forced to kill visual studio.
It keeps crashing
I tried searching for answers, found one about not able to create a win32 console application had a resolution, tried it but I get access denied.
C:\Program Files (x86)\Microsoft Visual Studio 12.0>devenv /setup
Microsoft Visual Studio 2013 Version 12.0.30723.0.
Copyright (C) Microsoft Corp. All rights reserved.
The operation could not be completed. Access is denied.
C:\Program Files (x86)\Microsoft Visual Studio 12.0>
After first feedback
I rebooted, retried using the visual studio command prompt, while running it as an administrator. This time it didn't complain, nor outputted anything.
I also tried running visual studio itself as an administrator, but still get same the effect when attempting to create a new c++ win32 console project.
After more searching
Based on this reference
I tried
devenv /Resetsettings ... didn't resolve it
devenv /ResetSkipPkgs ... didn't resolve it
devenv /Safemode ... resolved it, but not sure if it's ideal
The current resolution is to create a project in safe mode
Procedure
Run visual studio command prompt
Type in: devenv /Safemode
Create a new project
The project should now be accessible by going through the standard way of opening visual studio
Update
I uninstalled visual studio, then reinstalled. Unfortunately, I still can't run visual studio normally just to create a project, it continues to hang indefinitely every time I do. The procedure above is still the only resolution at the moment.
I guess you run this on Windows 8 ?
In win8, folder "program files" are not allowed to write except for adminstrators