Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with Xamarin.VisualStudio "file already exists" #24

Open
matthiaslischka opened this issue Jan 29, 2022 · 5 comments
Open

Exception with Xamarin.VisualStudio "file already exists" #24

matthiaslischka opened this issue Jan 29, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@matthiaslischka
Copy link

Hi,
I'm stuck with the installer because it fails with the Xamarin.VisualStudio package.

29.01.2022 19:42:38 - Package 'Xamarin.VisualStudio,version=17.0.0.343' failed to install. System.IO.IOException: The file 'C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Microsoft.Common.CrossTargeting.Targets\ImportBefore\Xamarin.Common.CrossTargeting.targets' already exists.
   at Microsoft.VisualStudio.Setup.Installer.VsixInstaller.<InstallCoreInternal>g__install|31_1(PackagePart part, Boolean saveExtensionManifest, <>c__DisplayClass31_0& , <>c__DisplayClass31_1& , <>c__DisplayClass31_2& , <>c__DisplayClass31_3& , <>c__DisplayClass31_4& )
   at Microsoft.VisualStudio.Setup.Installer.VsixInstaller.InstallCoreInternal(String localPath, String installDir, InstallablePackage pkg)
   at Microsoft.VisualStudio.Setup.Installer.FileInstaller.<>c__DisplayClass7_0.<InstallCore>b__0()
   at Microsoft.VisualStudio.Setup.Installer.FileInstaller.DoAction(Func`1 action)
   at Microsoft.VisualStudio.Setup.Installer.FileInstaller.InstallCore(String localPath, String installDir, InstallablePackage pkg)
   at Microsoft.VisualStudio.Setup.Installer.InstallerBase.InstallHelper(InstallData installData)

I'm just wondering if that's something you have control of or if its a "visual studio extensions installer" thing.
Failing an installer because a file already exists seems kinda wrong.

BR Matthias

@matthiaslischka matthiaslischka added the bug Something isn't working label Jan 29, 2022
@matthiaslischka
Copy link
Author

Even uninstalling Xamarin via the Visual Studio Installer did not fix this issue.

@matthiaslischka
Copy link
Author

Ok, WOW. This installer is really error-prone and self-sabotaging.
When the installer fails half way through and you resolve that issue, on the next run it will fail because the files it copied in the first install attempt already exist. Are you kidding me? 🤣

It would be really great, a necessity really, if the installer could just ignore files that "already exist" when the are just the same.
Especially if they already exist because the installer itself copied them to that location on the last try 2 minutes ago.

My solution now was to first uninstall Xamarin via Visual Studio Installer, then run the installer several time to get a list of all files that it has issues with and before each try delete all those files by hand. Somehow that worked.

BR Matthias

@neikeq
Copy link
Contributor

neikeq commented Jan 29, 2022

I'm just wondering if that's something you have control of or if its a "visual studio extensions installer" thing.

We only tell Visual Studio that we need the Xamarin component, but we don't actually control how it's installed:

<Prerequisite Id="Component.Xamarin" Version="[16.0,)" DisplayName="Xamarin" />

We need that component in order to be able to use the Mono debugger.

@Alriightyman
Copy link

I got this error too. However, my issue was I needed to have the Visual Studio installer install the "mobile development with .NET" tools. After that, the addon installed just fine.

@larinius
Copy link

larinius commented Mar 24, 2022

Installer creates file, and later says "file already exists". Its obviously bug in installer code.

Package 'Xamarin.VisualStudio,version=17.1.0.309' failed to install. System.IO.IOException: The file 'd:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Microsoft.Common.Targets\ImportAfter\Xamarin.Common.targets' already exists.

The issue solved as advised - must install "Mobile dev tools" from VS Installer. (Why this never mentioned in docs?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants