Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][Windows] Assembly reference with Unicode path cannot be resolved on Windows #110482

Open
ilonatommy opened this issue Dec 6, 2024 · 3 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Extensions-DependencyInjection disabled-test The test is disabled in source code against the issue os-browser Browser variant of arch-wasm
Milestone

Comments

@ilonatommy
Copy link
Member

ilonatommy commented Dec 6, 2024

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>
@ilonatommy ilonatommy added arch-wasm WebAssembly architecture disabled-test The test is disabled in source code against the issue os-browser Browser variant of arch-wasm labels Dec 6, 2024
@ilonatommy ilonatommy added this to the 10.0.0 milestone Dec 6, 2024
@ilonatommy ilonatommy self-assigned this Dec 6, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection
See info in area-owners.md if you want to be subscribed.

@lewing
Copy link
Member

lewing commented Dec 12, 2024

Adding this back to 10 as it is an internationalization requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-Extensions-DependencyInjection disabled-test The test is disabled in source code against the issue os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

3 participants