diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..3920829e6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = crlf
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+insert_final_newline = true
+guidelines = 80, 120
+
+[*.{c,h}]
+cpp_new_line_before_open_brace_block=same_line
+cpp_new_line_before_open_brace_function=new_line
+cpp_space_before_function_open_parenthesis=insert
+cpp_new_line_before_else=false
diff --git a/src/cc65.props b/src/cc65.props
index ef5a37fea..19fb0b646 100644
--- a/src/cc65.props
+++ b/src/cc65.props
@@ -21,6 +21,7 @@
true
_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WINVER=0x0601;NTDDI_VERSION=0x06010000;%(PreprocessorDefinitions)
common
+ /utf-8 %(AdditionalOptions)
$(IntDir)..\..\common\$(Configuration)\common.lib
@@ -42,13 +43,13 @@
false
- true
MultiThreaded
true
MaxSpeed
+ true
false
false
@@ -57,6 +58,7 @@
true
true
UseLinkTimeCodeGeneration
+ /EMITTOOLVERSIONINFO:NO /NOVCFEATURE /NOCOFFGRPINFO %(AdditionalOptions)
diff --git a/src/msbuild.cmd b/src/msbuild.cmd
index 2e1821f0a..092bfb578 100644
--- a/src/msbuild.cmd
+++ b/src/msbuild.cmd
@@ -1,18 +1,23 @@
@echo off
+setlocal
-if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" goto vs2017
-if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" goto vs2019
+where msbuild.exe 1>nul 2>&1 && goto :ready
-echo Error: VsDevCmd.bat not found!
-goto:eof
+set VSWHERE_PATH=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe
+if not exist "%VSWHERE_PATH%" set VSWHERE_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
+if not exist "%VSWHERE_PATH%" goto :error
+for /f "usebackq delims=#" %%a in (`"%VSWHERE_PATH%" -latest -property installationPath`) do set VSDEVCMD_PATH=%%a\Common7\Tools\VsDevCmd.bat
+if not exist "%VSDEVCMD_PATH%" goto :error
+set VSCMD_SKIP_SENDTELEMETRY=1
+call "%VSDEVCMD_PATH%" -no_logo -startdir=none
-:vs2017
-call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"
-goto run
+where msbuild.exe 1>nul 2>&1 && goto :ready
-:vs2019
-call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
-goto run
+:error
+
+echo Error: Can't find MSBuild.
+exit /b 1
+
+:ready
-:run
msbuild.exe %*