Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Error when trying to switch to Universal Windows Platform

Discussion in 'Editor & General Support' started by dadamsj1, Nov 8, 2022.

  1. dadamsj1

    dadamsj1

    Joined:
    Jul 25, 2017
    Posts:
    42
    I get the following error when clicking on Build Settings -> Universal Windows Platform.

    ArgumentException: Illegal characters in path.
    System.IO.Path.Combine (System.String path1, System.String path2) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
    Utility.GetVSDevEnvPath (System.String vsEnvVariable) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/Utility.cs:957)


    My best guess is this is caused by some issue with environment variable for VS or something else within the registry.

    Things I've tried so far:
    1) Uninstall all versions of Visual Studio and run InstallCleanup.exe
    2) Checked all environment variables for missing paths or weird characters
    3) Uninstall Unity and the UWP module
    4) Run in a different version of Unity (2020.3 and 2022.1 give same error)
    5) Check devenv path in vs developer command prompt (seems normal)

    Please help!
     
  2. dadamsj1

    dadamsj1

    Joined:
    Jul 25, 2017
    Posts:
    42
    I completely deleted VS 2022 and VS 2017, cleared all the environment paths, and restarted my system. It seems to have resolved the issue.