diff --git a/main.go b/main.go index 33d65ac294c81447a0ce138ff39ccac5c6531274..8dfa7b5d22742e057a4ba6915a162b20aeb85700 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( // Some options here. Would be improved in beta release. const DEDUCT_PKGNAME_FROM_VARNAME = true const USE_PROJECT_NETVER_INSTEAD_OF_HINTPATH_NETVER = false -const OPENXT_VERSION = "1.2-2" +const OPENXT_VERSION = "1.2-3" func print_help_and_exit() { println("Usage: openxt <subcommand> [options...]") diff --git a/tools/csproj-to-5/main.go b/tools/csproj-to-5/main.go index ce50f0a711b448aca62537ce839f07d162e444e3..0718bc6214bdb44ef8b3e4b54c824413cbcaf542 100644 --- a/tools/csproj-to-5/main.go +++ b/tools/csproj-to-5/main.go @@ -130,6 +130,11 @@ func main() { resultTxt += line + "\n" } + // patch: if the csproj has no <TargetFramework> and <TargetFrameworkVersion> at all, we must fix this error with a default targetFramework. + if ! (stringContainsInsensitive(resultTxt, "<TargetFramework>") || stringContainsInsensitive(resultTxt, "<TargetFrameworkVersion>")) { + stringReplaceOnceInsensitive(resultTxt, "<PropertyGroup>", "<PropertyGroup><TargetFramework>net472</TargetFramework><GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>") + } + err = ioutil.WriteFile(fname, []byte(resultTxt), 0644) panicErrorIfAny(err, "WriteFile " + fname) }