From 20ea356b2c0b4ab4d29778b4958d5b363f735f1f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 2 Nov 2020 19:43:20 -0600 Subject: More .NET 5 updates. Fix tests when running on machine with .NET 5. Update frameworks for .NET Core MBA (3.1 vs 5.0). --- src/dnchost/dnchost.vcxproj | 2 +- src/dnchost/dncutil.cpp | 9 ++++++++- src/dnchost/packages.config | 2 +- .../EarliestCoreMBA/Example.EarliestCoreMBA.csproj | 4 ++-- .../FullFramework2MBA/Example.FullFramework2MBA.csproj | 2 +- .../FullFramework4MBA/Example.FullFramework4MBA.csproj | 2 +- .../examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | 12 +++++------- src/test/examples/TestEngine/TestEngine.cpp | 14 +++++++++++--- src/test/examples/TestEngine/TestEngine.h | 1 + src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj | 6 +++--- 10 files changed, 34 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/dnchost/dnchost.vcxproj b/src/dnchost/dnchost.vcxproj index c6c2360c..d46c3a59 100644 --- a/src/dnchost/dnchost.vcxproj +++ b/src/dnchost/dnchost.vcxproj @@ -28,7 +28,7 @@ - ..\..\packages\runtime.win-x86.Microsoft.NETCore.DotNetAppHost.5.0.0-preview.7.20364.11\runtimes\win-x86\native\ + ..\..\packages\runtime.win-x86.Microsoft.NETCore.DotNetAppHost.5.0.0-rc.2.20475.5\runtimes\win-x86\native\ shlwapi.lib;$(NetHostPath)libnethost.lib diff --git a/src/dnchost/dncutil.cpp b/src/dnchost/dncutil.cpp index 4a82d961..89fe707f 100644 --- a/src/dnchost/dncutil.cpp +++ b/src/dnchost/dncutil.cpp @@ -182,7 +182,14 @@ static void HOSTFXR_CALLTYPE DnchostErrorWriter( __in LPCWSTR wzMessage ) { - BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "error from hostfxr: %ls", wzMessage); + BOOTSTRAPPER_LOG_LEVEL level = BOOTSTRAPPER_LOG_LEVEL_ERROR; + + if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, 0, wzMessage, -1, L"The requested delegate type is not available in the target framework.", -1)) + { + level = BOOTSTRAPPER_LOG_LEVEL_DEBUG; + } + + BalLog(level, "error from hostfxr: %ls", wzMessage); } static HRESULT InitializeHostfxr( diff --git a/src/dnchost/packages.config b/src/dnchost/packages.config index d40327be..113d005c 100644 --- a/src/dnchost/packages.config +++ b/src/dnchost/packages.config @@ -4,7 +4,7 @@ - + diff --git a/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj b/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj index 19fbd249..cb66c138 100644 --- a/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj +++ b/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0 + netcoreapp3.1 win-x86;win-x64 true Earliest .NET Core MBA @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj b/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj index 20c5c65c..21079ed1 100644 --- a/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj +++ b/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj b/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj index fff76795..a05e7888 100644 --- a/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj +++ b/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj index ccc642f0..9f3f02d9 100644 --- a/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj +++ b/src/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj @@ -1,23 +1,21 @@ - netcoreapp3.1 + net5.0 win-x86;win-x64 true Latest .NET Core MBA - - false - true - - + + + - + \ No newline at end of file diff --git a/src/test/examples/TestEngine/TestEngine.cpp b/src/test/examples/TestEngine/TestEngine.cpp index a6a21174..4c7ec1c3 100644 --- a/src/test/examples/TestEngine/TestEngine.cpp +++ b/src/test/examples/TestEngine/TestEngine.cpp @@ -69,11 +69,19 @@ LExit: } HRESULT TestEngine::Log( + __in BOOTSTRAPPER_LOG_LEVEL level, __in LPCWSTR wzMessage ) { - LogStringLine(REPORT_STANDARD, "%ls", wzMessage); - return ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%ls", wzMessage); + switch (level) + { + case BOOTSTRAPPER_LOG_LEVEL_NONE: + case BOOTSTRAPPER_LOG_LEVEL_DEBUG: + return S_OK; + default: + LogStringLine(REPORT_STANDARD, "%ls", wzMessage); + return ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%ls", wzMessage); + } } HRESULT TestEngine::RunApplication() @@ -169,7 +177,7 @@ HRESULT TestEngine::BAEngineLog( __in BAENGINE_LOG_RESULTS* /*pResults*/ ) { - return Log(pArgs->wzMessage); + return Log(pArgs->level, pArgs->wzMessage); } HRESULT TestEngine::BAEngineQuit( diff --git a/src/test/examples/TestEngine/TestEngine.h b/src/test/examples/TestEngine/TestEngine.h index 14b69999..44e813bd 100644 --- a/src/test/examples/TestEngine/TestEngine.h +++ b/src/test/examples/TestEngine/TestEngine.h @@ -28,6 +28,7 @@ public: ); HRESULT Log( + __in BOOTSTRAPPER_LOG_LEVEL level, __in LPCWSTR wzMessage ); diff --git a/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj b/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj index b488159d..296e5be9 100644 --- a/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj +++ b/src/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0-windows win-x86;win-x64 true WPF .NET Core MBA @@ -11,6 +11,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb