Description
On Windows platform, ResolveAssemblyReference
in Microsoft.Common.CurrentVersion.targets
does not accept paths in form e.g. "C:\helix\work\workitem\e\wbt artifacts\nuget\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\microsoft.extensions.dependencyinjection.abstractions\9.0.0-rc.1.24412.13\lib\net9.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll". The problem might be connected either with the space or the Unicode chars.
Error:
C:\helix\work\workitem\e\dotnet-latest\sdk\10.0.100-alpha.1.24480.5\Microsoft.Common.CurrentVersion.targets(2413,5): error MSB3106: Assembly strong name "C:\helix\work\workitem\e\wbt artifacts\nuget\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\microsoft.extensions.dependencyinjection.abstractions\9.0.0-rc.1.24412.13\lib\net9.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[] C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\Program.cs(9,9): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
Reproduction:
Test WithDllImportInMainAssembly
fails on CI with the above message after we started using sdk-based apps in tests here: #109069. I cannot reproduce locally, the test got disabled.
Full log:
<test name="Wasm.Build.Tests.Blazor.MiscTests3.WithDllImportInMainAssembly(config: Release, build: True, publish: True)" type="Wasm.Build.Tests.Blazor.MiscTests3" method="WithDllImportInMainAssembly" time="12.1783771" result="Fail">
<output><![CDATA[
** -------- build -------- **
Binlog path: C:\helix\work\workitem\uploads\xharness-output\logs\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\BlazorBasicTestApp-build.binlog
[] Executing (Captured Output) - C:\helix\work\workitem\e\dotnet-latest\dotnet.exe build -bl:C:\helix\work\workitem\uploads\xharness-output\logs\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\BlazorBasicTestApp-build.binlog -p:Configuration=Release -nr:false -p:BlazorEnableCompression=false /warnaserror -p:BlazorEnableCompression=false /warnaserror - in pwd C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App
[DOTNET_ROOT] = C:\helix\work\workitem\e\dotnet-latest
[DOTNET_INSTALL_DIR] = C:\helix\work\workitem\e\dotnet-latest
[DOTNET_MULTILEVEL_LOOKUP] = 0
[DOTNET_SKIP_FIRST_TIME_EXPERIENCE] = 1
[PATH] = C:\helix\work\workitem\e\dotnet-latest;D:\a\_work\1\s\artifacts\bin\geckodriver\geckodriver;C:\helix\work\correlation\dotnet-latest;C:\helix\work\correlation\xharness-cli;C:\helix\work\correlation\dotnet-cli;C:\helix\work\correlation\chrome-win;C:\helix\work\correlation\chromedriver_win32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;C:\Python;C:\python\scripts;C:\Program Files\nodejs\;C:\7z;C:\git\cmd;C:\Users\ContainerAdministrator\AppData\Roaming\npm;C:\Users\ContainerAdministrator\.jsvu\bin
[EM_WORKAROUND_PYTHON_BUG_34780] = 1
[NUGET_PACKAGES] = C:\helix\work\workitem\e\wbt artifacts\nuget\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉
[] Determining projects to restore...
[] Restored C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj (in 8.09 sec).
[] C:\helix\work\workitem\e\dotnet-latest\sdk\10.0.100-alpha.1.24480.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(326,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[] C:\helix\work\workitem\e\dotnet-latest\sdk\10.0.100-alpha.1.24480.5\Microsoft.Common.CurrentVersion.targets(2413,5): error MSB3106: Assembly strong name "C:\helix\work\workitem\e\wbt artifacts\nuget\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\microsoft.extensions.dependencyinjection.abstractions\9.0.0-rc.1.24412.13\lib\net9.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[] C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\Program.cs(9,9): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[]
[] Build FAILED.
[]
[] C:\helix\work\workitem\e\dotnet-latest\sdk\10.0.100-alpha.1.24480.5\Microsoft.Common.CurrentVersion.targets(2413,5): error MSB3106: Assembly strong name "C:\helix\work\workitem\e\wbt artifacts\nuget\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\microsoft.extensions.dependencyinjection.abstractions\9.0.0-rc.1.24412.13\lib\net9.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[] C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\Program.cs(9,9): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. [C:\helix\work\workitem\e\wbt artifacts\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\App\BlazorBasicTestApp.csproj]
[] 0 Warning(s)
[] 2 Error(s)
[]
[] Time Elapsed 00:00:11.03
]]></output>
<failure exception-type="Xunit.Sdk.XunitException">
<message><![CDATA[ Expected 0 exit code but got 1: C:\\helix\\work\\workitem\\e\\dotnet-latest\\dotnet.exe build -bl:C:\\helix\\work\\workitem\\uploads\\xharness-output\\logs\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\BlazorBasicTestApp-build.binlog -p:Configuration=Release -nr:false -p:BlazorEnableCompression=false /warnaserror -p:BlazorEnableCompression=false /warnaserror \r\nStandard Output:\r\n[] Determining projects to restore...\r\n[] Restored C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj (in 8.09 sec).\r\n[] C:\\helix\\work\\workitem\\e\\dotnet-latest\\sdk\\10.0.100-alpha.1.24480.5\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.RuntimeIdentifierInference.targets(326,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj]\r\n[] C:\\helix\\work\\workitem\\e\\dotnet-latest\\sdk\\10.0.100-alpha.1.24480.5\\Microsoft.Common.CurrentVersion.targets(2413,5): error MSB3106: Assembly strong name \"C:\\helix\\work\\workitem\\e\\wbt artifacts\\nuget\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\microsoft.extensions.dependencyinjection.abstractions\\9.0.0-rc.1.24412.13\\lib\\net9.0\\Microsoft.Extensions.DependencyInjection.Abstractions.dll\" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\\). Those characters are Equals(=), Comma(,), Quote(\"), Apostrophe('), Backslash(\\). [C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj]\r\n[] C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\Program.cs(9,9): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. [C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj]\r\n[] \r\n[] Build FAILED.\r\n[] \r\n[] C:\\helix\\work\\workitem\\e\\dotnet-latest\\sdk\\10.0.100-alpha.1.24480.5\\Microsoft.Common.CurrentVersion.targets(2413,5): error MSB3106: Assembly strong name \"C:\\helix\\work\\workitem\\e\\wbt artifacts\\nuget\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\microsoft.extensions.dependencyinjection.abstractions\\9.0.0-rc.1.24412.13\\lib\\net9.0\\Microsoft.Extensions.DependencyInjection.Abstractions.dll\" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\\). Those characters are Equals(=), Comma(,), Quote(\"), Apostrophe('), Backslash(\\). [C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj]\r\n[] C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\Program.cs(9,9): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. [C:\\helix\\work\\workitem\\e\\wbt artifacts\\blz_dllimp_Release_鿀蜒枛遫䡫煉build_then_publish_Release_False_kcvpwszx_rwq_鿀蜒枛遫䡫煉\\App\\BlazorBasicTestApp.csproj]\r\n[] 0 Warning(s)\r\n[] 2 Error(s)\r\n[] \r\n[] Time Elapsed 00:00:11.03\r\n]]></message>
<stack-trace><![CDATA[ at Wasm.Build.Tests.CommandResult.EnsureExitCode(Int32 expectedExitCode, String messagePrefix, Boolean suppressOutput) in /_/src/mono/wasm/Wasm.Build.Tests/Common/CommandResult.cs:line 51
at Wasm.Build.Tests.CommandResult.EnsureSuccessful(String messagePrefix, Boolean suppressOutput) in /_/src/mono/wasm/Wasm.Build.Tests/Common/CommandResult.cs:line 28
at Wasm.Build.Tests.BuildTestBase.BuildProjectWithoutAssert(Configuration configuration, String projectName, MSBuildOptions buildOptions) in /_/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs:line 171
at Wasm.Build.Tests.WasmTemplateTestsBase.BuildProject(ProjectInfo info, Configuration configuration, MSBuildOptions buildOptions, Nullable`1 isNativeBuild) in /_/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs:line 152
at Wasm.Build.Tests.BlazorWasmTestBase.BlazorBuild(ProjectInfo info, Configuration config, MSBuildOptions buildOptions, Nullable`1 isNativeBuild) in /_/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs:line 110
at Wasm.Build.Tests.BlazorWasmTestBase.BlazorBuild(ProjectInfo info, Configuration config, Nullable`1 isNativeBuild) in /_/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs:line 101
at Wasm.Build.Tests.Blazor.MiscTests3.WithDllImportInMainAssembly(Configuration config, Boolean build, Boolean publish) in /_/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs:line 53
--- End of stack trace from previous location ---]]></stack-trace>