ClickOnce install error: "changed since initially published." - visual-studio

I have a trouble getting a ClickOnce, C#, Visual Studio application to install. I get the following error (retyped):
Setup has detected that the file
C:\...\Reportviewer.exe
has changed since it was initially published.
Click OK to retry the download or Cancel to exit Setup.
I deleted the previously existing Reportviewer, but the error persists. I'm doing this install via VPN (if it matters). What does this actually mean, and what can I do about it?

In the end, I took the ReportViewer prerequisite (and all the other prerequisites, too) out of the published version. We install ReportViewer from here:
http://www.microsoft.com/en-us/download/details.aspx?id=4016

You say that you've deleted the previously existing Reportviewer but there's a strong likelihood that you have some temporary files that are still being referenced during setup.
Try cleaning out any files under C:\Users[Username]\AppData\Local[AppFolderName] or C:\Users[Username]\AppData\Roaming[AppFolderName] manually. If that doesn't work, try using the cleanmgr.exe utility to do a cleanup and then try reinstall.

Related

nuget dll is used by another process

I have the error from below and I'm quite out of ideas how to solve it. Tried the following until now:
Clean bin/obj/packages/packages cache
Remove manually from csproj and packages files the package and add it afterwards..still error
Update Visual Studio 2017
Reinstall Visual Studio 2017
Trace which processes are using a file with name that contains Newtonsoft
Copy the solution from another laptop where the builds works just fine
Yet, after all from above, I still get:
Error NuGet Package restore failed for project DriversApp.Android: Unable to find version '10.0.3' of package 'Newtonsoft.Json'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Newtonsoft.Json.10.0.3' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Error downloading 'Newtonsoft.Json.10.0.3' from 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/10.0.3/newtonsoft.json.10.0.3.nupkg'.
The process cannot access the file 'C:\Users\user\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.0\Newtonsoft.Json.dll' because it is being used by another process.
. Please see Error List window for detailed warnings and errors.
How to get this solved? I got really stuck on this one...
After a lot of investigation and ideas, I've solved this by uninstalling the antivirus solution as the rules added by me within my laptop were overrode by the company server policies.
As a conclusion, first check your antivirus solution, and if you are within a controlled environment, make sure your rules are not overrode by company server policies.
Thank you, #Leo Liu-MSFT for the assistance.
nuget dll is used by another process
You can try to use following troubleshooting to resolve this issue.
In Windows Explorer go to the folder where the NuGet packages are installed C:\Users\user\.nuget\packages, deleted the Newtonsoft.Json folders.
May it has something to do with the same package being referenced in multiple projects within the same solution, adding "-DisableParallelProcessing" to the nuget restore command, the final command would look like:
nuget restore "%WORKSPACE%\Solutions\App\App.sln" -DisableParallelProcessing
Excluding NuGet package files from the anti-malware products, or try to disable the antivirus. The anti-malware/antivirus products briefly locking these files during the NuGet restore operations.
Clear all referenced libraries before build the project by right click to Solution in solution explorer after click to "Clean Solution".
Most probably I was faced when there is some other error in the project (ie: project reference error etc.)
try 0: Remove all bin & obj from all project.
Try 1: Restart PC
Try 2: close vs & %temp% delete all
Try 3: Disable antivirus for the moment
Try 4: Change Debug to Release and revert back
Try 5: Clear All nuget caches
If above nothing works then shut down your pc, sit back for moments, relax and then check back.
Run this command with admin rights (net session /delete). It worked for me.

Error when rebuild the setup project in c#

Im getting below error when im going to rebuild my setup project in visual studio 2015.Please advice to resolve this:
The message means that the install of Visual Studio 2010 Shell (Integrated) is broken, so Windows is attempting to repair it. Also, it looks like it was installed from the internet, which resulted in the setup being performed from a temp folder that has since been deleted. It is always better to download the setup (such as the MSI file) and save it somewhere. It is also possible that the C:\Windows\installer folder has been damaged or has had files deleted because normally the repair would be performed from there, which might have been happening for a long time but you wouldn't have noticed until the cached MSI file was removed from /windows/installer.
The fix is to get hold of the exact same MSI file that was used to install VS 2010 Shell MSI file and save it somewhere, and browse to it when this happens again.
The cause might be a conflict between VS 2010 and VS 2015, or some removed or changed shared files. The application event log will have an MsiInstaller entry that says what is missing.

Cannot add Application Insights - Failed to install package 'Microsoft.Web.Infrastructure'

I try to monitor the memory usage of my CloudService and stumbled upon Application Insights.
When I try to add it I get following error message:
right click on WebProject -> Add Application Insights Telemetrik
Insert Subscription-Data -> click Add-Button
Now the error occurs when VS tries to install 'Microsoft.ApplicationInsights.Web.2.0.0'
We are using VS2015 and Windows 10
Edit:
The fun thing is I can install Microsoft.ApplicationInsights.Webversion 2.0.0 via the nuget-console. But when I afterwards try to add the ApplicationInsights again it throws the same error and the package-manager-console displays:
The package at \Path\To\Project\packages\Microsoft.Bcl.1.0.14 failed to uninstall. Restart Visual Studio to finish the process.
Things you can try:
close VS, and start it once as admin. You may have old auto-updated extensions, etc that haven't been cleaned up until you run as admin. then close that admin VS and go back to your normal non-admin VS.
clear out your nuget packages in your solution, and then doing a full re-build to ensure that all of the current packages in your project are correctly and fully installed. when we try to install the AI nuget packages programmatically, Nuget tries to validate all of the existing packages and sometimes something goes wrong there validating things that already installed
then try re-adding AI through the tool.
if you still get the error, look in the directory shown in the error message, and comment and let me know if (a) that folder exists at all and (b) if it does exist, what's in it?
If things are still failing, you should be able to add the Microsoft.ApplicationInsights.Web nuget package manually from nuget package manager, and after that is done, right click the "ApplicationInsights.config" file that was added by the nuget package install, and you should see a "configure application insights" option that will let you pick your account, subscription, and AI resource, and that will get updated in the config file for you. If none of that works, you can send me a mail to jgardner # microsoft and i can try to track down more details for you.
Edit to add: If you get this error about Microsoft.Bcl, then your project is probably targeting .NET 4.0 and this is probably an issue we just found today. hypothetically, if you manually install microsoft.bcl into the project first, then that specific error for that specific package should go away? (we're working on verifying this specific dependency and fixing this asap).
A simple Visual Studio restart fixed the issue for me.

Microsoft installer error in VS 2013

I am using Microsoft Visual Studio Installer Projects released for VS 2013. This allowed me to load my .vdproj file created on VS 2010. It all compiled fine. I ran the set up. It ran all the way and at the end displayed this
After that the installation just reverses and goes back and installs nothing.
OK I found a way to recreate the Config.InstallState file.
I found an answer in here
Custom Action - Error 1001: Could not find file myApp.InstallState
The solution is to add the custom action to both the Install and the Commit phases, although it does nothing >> during the install phase.
So this is what I did
Removed my old Config.Install from the Setup project.
Added the custom action to both the Install and Commit phase like the above solution.
Ran the Install - this created a new Config.InstallState file.
Copied this new Config.InstallState into my setup project and removed the custom action from the Install (only kept it for Commit phase)
you can find an answer here:
The problem is that the MSI infrastructure is looking for the installation state file which is usually created during the Install phase. If the custom action does not participate in the Install phase, no file is created.
The solution is to add the custom action to both the Install and the Commit phases, although it does nothing during the install phase.

Web setup project removes files after upgrade from VS2008 to VS2010

I have a web setup project built using VS2008. I've converted my solution to VS2010 and now when I build my new installer and run the install from the MSI it installs fine, then at the last step, removes all the files it's just installed.
I have RemovePreviousVersions set to true. If I turn this off the files remain in place (but I get multiple instances in the Programs and Features in the control panel).
If I run the install again, the files reappear. From then on, the files always remain, even when installing another version. So, the problem seems to be with running an installer built using VS2008 and then running the same installer built by VS2010. The upgrade GUIDs on each installer are the same.
What is the cause and how can I fix this?
I haven't tried porting a setup from VS2008 to 2010, but having the same upgrade code for different build versions will cause problems; simple explanation is the msiexec installer fails when it tries to remove the old components because the older components have the same upgrade version as the newer components being installed. There is a VS project setting where you can automatically generate a new upgrade code each time you rebuild your .msi; I generally select this and saves a lot of these versioning headaches.
Uninstall all copies of your app using
add/remove programs
Delete the contents of your %TEMP% folder ( to
get rid of any "old" (VS2008) copies
of your .msi)
Update the GUID for the VS2010 version (I think you do this by right clicking on the
GUID in the properties window and clicking "genereate new GUID")
rebuild the project and try again!
I just encountered this error. Had the exact problem when upgrading. I tried the solution at:
https://connect.microsoft.com/VisualStudio/feedback/details/559575
I edited my MSI-file in Orca resequenced RemoveExistingProducts right after InstallInitialize (sequence number 1501). This was found in the InstallExecuteSequence table. This was originally sequence number 6550.
That solved my problem.
What I've discovered is that changing the UpgradeCode will prevent the files from being removed, however it's then treated as a separate installed program - i.e. in the control panel (Programs and Features) my program appears twice. Logically, I think, this is because it's not the same program.
My only option seems to be to programmatically uninstall the old version in the installer of the new version by writing a custom action.
I've submitted a bug to Microsoft Connect and they've confirmed it's reproducible.

Resources