Move Archive location in VS 2019 Windows

Every time I archive my solution so I can get it ready for distribution, I get an error on the iOS project's archive. If I archive a second time, I get the error again, but the previous archive shows up in XCode so I can upload it. So the long and the short of it is that I have to archive twice, which is stupid and a waste of time (and aggravating since I have to babysit Visual Studio).

I'm doing all my work on Win10 Pro 1909 with VS 2019 latest version (as of this writing I have 16.3.6 installed). The error appears to be a problem with the file path being too long.

Cannot create an IOS archive '{name of my app}.iOS'. Process cannot be executed on XMA server.
There was an error unzipping the file C:\users{my username}\AppData\Local\Xamarin\MonoTouch\Archives{today's date}{some GUID}.zip: the specified path, file name, or both are too long. The fully qualified name must be less than 260 characters.

I'm guessing that within the ZIP is some file that pushes it over the 260 character limit. The root of the ZIP file listed has a folder named for the iOS app and today's date/timestamp.xcarchive so yeah, it gets a little long before we ever get to the files in the archive.

I've dug through the VS2019 options, and it's possible I missed it, but Google hasn't been helpful and I didn't find anything. I found a thread in MS's forums saying to download a tool to allow longer file names, and I tried that, and of course that didn't help either.

This process is dumb. How did this ever get out of QA? And more importantly, how can I move the Archives from the default location?

Posts

  • advantechadvantech AUMember

    Same problem here. There is a registry entry to allow long path names but that didn't work for me either. I know I a missing something obvious given the number of companies deploying iOS apps and developing in VS2019 (probably).

  • HamittirpanHamittirpan Member ✭✭✭

    Hi @BenjaminFunk

    To archive iOS archives in a different location, you must add the following code to the cproj file of the iOS project ;

    <PropertyGroup>
        <ArchiveBasePath>C:\Ex</ArchiveBasePath>
    </PropertyGroup>
    
  • BenjaminFunkBenjaminFunk USMember ✭✭

    @Hamittirpan said:
    Hi @BenjaminFunk

    To archive iOS archives in a different location, you must add the following code to the cproj file of the iOS project ;

    <PropertyGroup>
        <ArchiveBasePath>C:\Ex</ArchiveBasePath>
    </PropertyGroup>
    

    This is great. Thank you!

Sign In or Register to comment.