From c9ad6880cb1bd32627faf8fcc0190ac2d2a90095 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Tue, 12 Dec 2023 23:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99=EF=BC=9ABu?= =?UTF-8?q?ildFailedException:=20Build=20path=20contains=20a=20project=20p?= =?UTF-8?q?reviously=20built=20without=20the=20"Create=20Visual=20Studio?= =?UTF-8?q?=20Solution"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Commands/StripAOTDllCommand.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Editor/Commands/StripAOTDllCommand.cs b/Editor/Commands/StripAOTDllCommand.cs index 9e0a89c..f340c1e 100644 --- a/Editor/Commands/StripAOTDllCommand.cs +++ b/Editor/Commands/StripAOTDllCommand.cs @@ -84,6 +84,10 @@ namespace HybridCLR.Editor.Commands bool oldBuildScriptsOnly = EditorUserBuildSettings.buildScriptsOnly; EditorUserBuildSettings.buildScriptsOnly = true; + string location = GetLocationPathName(outputPath, target); + string oldBuildLocation = EditorUserBuildSettings.GetBuildLocation(target); + EditorUserBuildSettings.SetBuildLocation(target, location); + switch (target) { case BuildTarget.StandaloneWindows: @@ -113,7 +117,7 @@ namespace HybridCLR.Editor.Commands BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions() { scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(), - locationPathName = GetLocationPathName(outputPath, target), + locationPathName = location, options = buildOptions, target = target, targetGroup = BuildPipeline.GetBuildTargetGroup(target), @@ -122,6 +126,8 @@ namespace HybridCLR.Editor.Commands var report = BuildPipeline.BuildPlayer(buildPlayerOptions); EditorUserBuildSettings.buildScriptsOnly = oldBuildScriptsOnly; + EditorUserBuildSettings.SetBuildLocation(target, oldBuildLocation); + switch (target) { case BuildTarget.StandaloneWindows: