Search Unity

Question Build path contains project build with "Create Visual Studio Solution" option, which is incompatible

Discussion in 'Editor & General Support' started by MinorProblems, Mar 6, 2023.

  1. MinorProblems

    MinorProblems

    Joined:
    Mar 6, 2023
    Posts:
    2
    Heya,
    I'm pretty new to coding and Unity in general, and have recently come across this build error when trying to run my game. I can still run my game in the editor but it refuses to build. The error showed up after I implemented some code for my main menu that changed the sprite when the mouse hovers over them. The only other thing I changed was my external script editor from "Open by file extension" to visual studio which fixed an issue with my new script not working.

    I assume this somehow has caused the problem but I haven't been able to fix this issue with any troubleshooting and researching. I tried changing the script editor back to open by file extension I have tried deleting my .sln file, I have tried building my game in a new empty folder. I have tried turning the "Create Visual Studio Solution" option on and off in different build attempts but still no dice. Any idea what else may be causing this error?
    Any help is greatly appreciated :)

    UnityException: Build path contains project built with "Create Visual Studio Solution" option, which is incompatible with current build settings. Consider building your project into an empty directory.
    UnityEditor.WindowsStandalone.WindowsDesktopStandalonePostProcessor.CheckSafeProjectOverwrite (UnityEditor.Modules.BuildPostProcessArgs args) (at <161e4c4538af4ce89288d3ac9704c0e2>:0)
    DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
     
  2. MinorProblems

    MinorProblems

    Joined:
    Mar 6, 2023
    Posts:
    2
    I managed to fix it on my own by going to preferences, external tools and regenerating project files. From there I made a clean build and now it seems to run fine. Hope this helps anyone who has a similar issue