Visual Studio 2017 install fails due to Microsoft.DiagnosticsHub.KB2882822 error - visual-studio

anybody an idea why this might fail? VS2017 installation stops with that error in the log. I had similar issue with VS2017 RC builds.
Package 'Microsoft.DiagnosticsHub.KB2882822.Win7,version=15.0.25904.2,chip=x64' failed to install. Return code: 0, Details: Invalid source and/or destination paths

One possible reason this could occur is that antivirus programs are being configured to be more aggressive at blocking executable files running from a temp directory. The installation of this component executes DISM.EXE which in turn executes DISMHOST.EXE from the user APPDATA\LOCAL\TEMP folder.
The quickest way to confirm this is to temporarily disable your antivirus program. The safer way to confirm this would be to review your antivirus program configuration and corresponding log files.

The issue is most likely that the windows username has a space in it and when one portion of the installer wants access to a temp folder under the user profile directory it throws an error due to a bug because it can't handle the space in the username. (Shout out to Wong Man Wei who identified the root cause!)
A work around, is to create a new user on the machine that does not have a space in the name. Then run the installer again and repair the existing install that was done from the other user and the repair will work successfully since it has access to a temp directory under this user that has no space in the name.
Now once the repair is successful you can delete this user account and go back to using the one with the space in it.

Related

I got "the project couldn't be opened:access to the path is denied"

I got This message"The project 'C:\Users\abrar\Documents\Uipath\BlankProcess2\project.json' could not be opened:Access to the path 'C:\Users\abrar.nuget\packages\uipath\10.0.7004.31775\build\UiPath\aahook.dll' is denied" when I open a new project on UIPATH, I have tried to change the permission but it didn't work
This could be a nuget caching issue. Try running Studio with elevated permissions first (Run as Administrator) to see if the issue persists - if not, close it and run it again, this time not in elevated mode.
If that does not work, just remove UiPath's packages entirely (C:\Users\abrar\.nuget\packages\uipath in your case), then run Studio again. Open your project, and UiPath will automatically restore all missing packages (you will need to be connected to the internet though).
I guess you are trying to run it from a different Windows user account.
(Can't comment on question, so i'm writing as answer. Also, you may have solved the problem already, but if not or for someone that could have this issue it may help)
It may be a typo, but seems like you're missing a backslash \ between username and .nuget:
'C:\Users\abrar\.nuget\packages\uipath\10.0.7004.31775\build\UiPath\aahook.dll'
Also make sure that this folder and files exist, seems to be a package published from UiPath Studio.

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.

"The feature you are trying to access..." from MSI with simple install package

I created a MSI package with visual studio. It works fine for 80% of the users (some have errors with privileges and the like), but for two users the installation fails with the error message:
The feature you are trying to use is on a network resource that is unavailable
Which I find very odd because all the MSI does is set some registry values and put an OCX control into the system. Nothing with any network devices or anything else.
It also refers to a install[1].msi (when the actual MSI is called install.msi) which it supposedly can't find, which is obvious, because such a file never existed and is neither required for the installation nor even referenced in it in any way.
The package tries to locate this non-existent other package under C:\Documents and Settings\XYZ\Local Settings\Temporary Internet Files\Content.IE5\M84S9GA4\, even though I started the MSI out of the local drive D:.
How can I resolve this / get closer the underlying cause?
A verbose log file should show you the exact error causing the issue. If it doesn't happen consistently, you'll probably be best served turning on the logging policy to get a log file all the time and when it repros, grab the log file really quick.
Alternatively, if you have a repro situation you can get a log file immediately by doing:
msiexec /i path\to\your.msi /l*v install.txt
As for the root cause, the fact that that the name is install[1].msi makes it sound like the MSI was downloaded using a web browser and launched out of the browser cache. The Windows Installer is very particular about the name of the MSI, you can read about that in an old blog entry of mine. The end result is that shipping a 'naked' MSI on the internet is never a good idea. Maybe you're seeing these errors when shipping a newer MSI? If so, that would make a lot of sense.
A verbose log file will show you for sure.

msi rolling back and no error logged

I am having a problem installing an msi on to a windows 2008 web server. The exact same msi previously installed successfully. The msi is for a .net 4.0 web application that I have created and being installed in to IIS.
What happens is that the msi seems to be installing correctly, and it reaches 0 seconds remaining on the progress bar, then suddenly it starts rolling back. I checked the event viewer for information on this but none appeared there, to assist with getting to the bottom of what the issue may be.
As the msi previously installed without issue on to the box, I believe the problem may be to do with a change to the server rather than to do with the msi.
Anyone experience this before or have an idea as to where I may be able to find more information as to why the msi installer is rolling back?
Ok, what I have done with the help of Bogdan Mitrache reply was to compare logs from a successfull server and the server causing the problem and this is the section where I found the error to occur:
FAILED: -2147024864
FAILED: -2147024864
Custom Action failed with code: '32'
Custom Action failed with code: '32'
Custom Action completed with return code: '32'
Info 1903. Scheduling reboot operation: Deleting file << root directory >>\TBD2D0E.tmp. Must reboot to complete operation.
Info 1903. Scheduling reboot operation: Deleting file << root directory >>\TBD2ED3.tmp. Must reboot to complete operation.
Info 1903. Scheduling reboot operation: Deleting file << root directory >>\TBD2F41.tmp. Must reboot to complete operation.
And then at the very end of the process:
Return value 3.
I have done searching on the internet but I have found no concrete reason as to why the above may be occuring. Anyone have further information on the above, or where i may look?
The best method to see exactly why the MSI package fails is to create a verbose log, using this command line: msiexec /i "msi path" /L*V "debug.log"
The log should contain more details about the cause of the rollback. As you suspected probably you have a duplicate IIS web site/app that conflicts with the package.
The return code mentioned in the log means this: "The process cannot access the file because it is being used by another process.". The reboot messages are automatically included by Windows Installer when a file that needs to be updated is currently in use.
According to Windows Installer standards, the return code of a custom action must be 0 to be considered it executed successfully. Any return code different from 0 is considered failure.
What you should do is to add another custom action, scheduled in the beginning of the installation, that stops any services/applications that could use resources updated by the package.
You should be using virtual machines with snapshots to rule out changes to the environment vs changes to the installer. And you should certainly be logging and reading your windows installer log.

Understanding Vital attribute in Windows Installer File Table

Suppose you have an MSI that's trying to add or replace file Foo.bar, and that operation fails. If Foo.bar is marked as vital (with msidbFileAttributesVital) in the File table of the MSI, then the installation will roll back. If the file is not vital, then the user is prompted and allowed to decide if the error should be ignored or if the installation should be rolled back.
What if the operation fails and the installer is running in silent mode (/qn)? The user cannot be prompted.
It appears (from an MSI log I have) that the installation rolls back, even though the file is not vital. Is there some way to have a silent install proceed in this case?
From my knowledge silent installations always rollback if an error is encountered, no matter what flags and settings you use. This prevents broken installations (for example missing files).
In your case a solution is to use basic UI to prompt the user. Another solution is to use a non-MSI installer which can ignore installation errors.

Resources