Skip to content

Unable to build WPF in github action with v6.0.23 #8343

Open

Description

@lindexi

I try to build WPF in github action. And my build command is:

.\build.cmd -pack -ci -configuration Debug -prepareMachine /p:Platform=x86

After I checkout the code to v6.0.23, I fail to build WPF in github action. And the error code is:

LINK : fatal error LNK1104: cannot open file 'MSVCURTD_netcore.LIB' [D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\src\Microsoft.DotNet.Wpf\src\DirectWriteForwarder\DirectWriteForwarder.vcxproj]

This isn't the first time we've had this problem, see #6251 and #2290 and #2714

The build log:

##vso[task.setvariable isSecret=False;variable=Artifacts;isOutput=True]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts
##vso[task.setvariable isSecret=False;variable=Artifacts.Toolset;isOutput=True]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\toolset
##vso[task.setvariable isSecret=False;variable=Artifacts.Log;isOutput=True]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\log\Debug
##vso[task.setvariable isSecret=False;variable=TEMP;isOutput=True]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\tmp\Debug
##vso[task.setvariable isSecret=False;variable=TMP;isOutput=True]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\tmp\Debug
Processing D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\global.json
strawberry-perl was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\.tools\bin\strawberry-perl\5.28.1.1-1\.
net-framework-48-ref-assemblies was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\.tools\bin\net-framework-48-ref-assemblies\0.0.0.1\.
dotnet-api-docs_net6.0 was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\.tools\bin\dotnet-api-docs_net6.0\0.0.0.4\.
Native tools bootstrap failed
GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
Attempting to install dotnet from public location.
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.121/dotnet-sdk-6.0.121-win-x64.zip size is 251089702 bytes.
dotnet-install: Downloaded file https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.121/dotnet-sdk-6.0.121-win-x64.zip size is 251089702 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: "D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\.dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 6.0.121
dotnet-install: Installation finished
##vso[task.prependpath]D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\.dotnet
##vso[task.setvariable isSecret=False;variable=DOTNET_MULTILEVEL_LOOKUP;isOutput=True]0
##vso[task.setvariable isSecret=False;variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE;isOutput=True]1
Downloading vswhere
Setting NUGET enhanced retry environment variables
##vso[task.setvariable isSecret=False;variable=NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY;isOutput=True]true
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT;isOutput=True]6
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS;isOutput=True]1000
Processing D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\eng\..\global.json
File 'C:\Users\runneradmin\.netcoreeng\native\temp\strawberry-perl-5.28.1.1-1-win64-x64.zip' already exists, skipping download
strawberry-perl was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\eng\..\.tools\native\bin\strawberry-perl\5.28.1.1-1\.
File 'C:\Users\runneradmin\.netcoreeng\native\temp\net-framework-48-ref-assemblies-0.0.0.1-win64-x64.zip' already exists, skipping download
net-framework-48-ref-assemblies was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\eng\..\.tools\native\bin\net-framework-48-ref-assemblies\0.0.0.1\.
File 'C:\Users\runneradmin\.netcoreeng\native\temp\dotnet-api-docs_net6.0-0.0.0.4-win64-x64.zip' already exists, skipping download
dotnet-api-docs_net6.0 was not found in D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\eng\..\.tools\native\bin\dotnet-api-docs_net6.0\0.0.0.4\.
Native tools bootstrap failed
Setting NUGET enhanced retry environment variables
##vso[task.setvariable isSecret=False;variable=NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY;isOutput=True]true
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT;isOutput=True]6
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS;isOutput=True]1000
Setting NUGET enhanced retry environment variables
##vso[task.setvariable isSecret=False;variable=NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY;isOutput=True]true
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT;isOutput=True]6
##vso[task.setvariable isSecret=False;variable=NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS;isOutput=True]1000

  renderingbuilder.cpp
  swinit.cpp
  Generating Code...
  basert.cpp
  basesurfrt.cpp
  shapeclipperforfeb.cpp
  Generating Code...
  Determining projects to restore...
  Restored D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\obj\UtilLib\Win32\Debug\CppSupport\CppSupport_UtilLib.csproj (in 32 ms).
  shared.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\shared\Win32\Debug\shared.lib
  targets.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\targets\Win32\Debug\targets.lib
  sw.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\sw\Win32\Debug\sw.lib
  UIAutomationTypes-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationTypes-ref\Debug\net6.0\UIAutomationTypes.dll
  Determining projects to restore...
  pch.cxx
  Restored D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\obj\uce\Win32\Debug\CppSupport\CppSupport_uce.csproj (in 44 ms).
  precomp.cpp
  Determining projects to restore...
  WindowsBase -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\WindowsBase\Debug\net6.0\WindowsBase.dll
  assert.cxx
  Restored D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\obj\PresentationNative\Win32\Debug\CppSupport\CppSupport_PresentationNative.csproj (in 45 ms).
  memutils.cxx
  misc.cxx
  strutil.cxx
  instrumentation.cxx
  list.cxx
  hirestimer.cxx
  registry.cxx
  debugbreak.cpp
  Generating Code...
  UtilLib.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UtilLib\Win32\Debug\wpfutil.lib
  alphamaskwrapper.cpp
  apifunc.cpp
  clientchanneltables.cpp
  serverchanneltables.cpp
  clientchannel.cpp
  clipstack.cpp
  cmdbatch.cpp
  connection.cpp
  connectioncontext.cpp
  composition.cpp
  crossthreadcomposition.cpp
  dirtyregion.cpp
  precomp.cxx
  dpiprovider.cpp
  drawingcontext.cpp
  generated_resource_factory.cpp
  geometry_api.cpp
  global.cpp
  glyphcacheslave.cpp
  graphwalker.cpp
  handletable.cpp
  Generating Code...
  System.Windows.Presentation-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\System.Windows.Presentation-ref\Debug\net6.0\System.Windows.Presentation.dll
  DirectWriteForwarder.cpp
  Compiling...
  htmaster.cpp
  htslave.cpp
  hwndtarget.cpp
  partition.cpp
  partitionmanager.cpp
  partitionthread.cpp
  precompctx.cpp
  prerender3dcontext.cpp
  printtarget.cpp
  render3dcontext.cpp
  renderdatabounder.cpp
  rendertarget.cpp
  rendertargetmanager.cpp
  resslave.cpp
  rsapi.cpp
  samethreadcomposition.cpp
  schedulemanager.cpp
  System.Windows.Presentation -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\System.Windows.Presentation\Debug\net6.0\System.Windows.Presentation.dll
  serverchannel.cpp
  VisualCache.cpp
  VisualCacheManager.cpp
  Generating Code...
  Compiling...
  VisualCacheSet.cpp
  vt_api.cpp
  Generating Code...
  UIAutomationProvider-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationProvider-ref\Debug\net6.0\UIAutomationProvider.dll
  uce.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\uce\Win32\Debug\uce.lib
  dwriteloader.cpp
  UIAutomationClient-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationClient-ref\Debug\net6.0\UIAutomationClient.dll
  UIAutomationClientSideProviders-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationClientSideProviders-ref\Debug\net6.0\UIAutomationClientSideProviders.dll
  Utils.cxx
  precomp.cpp
  main.cpp
  OtherAssemblyAttrs.cpp
  Generating Code...
  dllentry.cpp
  wpfgfx.def
  .NETCoreApp,Version=v6.0.AssemblyAttributes.cpp
     Creating library D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.lib and object D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.exp
  UIAutomationTypes -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationTypes\Debug\net6.0\UIAutomationTypes.dll
LINK : fatal error LNK1104: cannot open file 'MSVCURTD_netcore.LIB' [D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\src\Microsoft.DotNet.Wpf\src\DirectWriteForwarder\DirectWriteForwarder.vcxproj]
##vso[task.logissue type=error;sourcepath=LINK;linenumber=0;columnnumber=0;code=LNK1104;](NETCORE_ENGINEERING_TELEMETRY=Build) cannot open file 'MSVCURTD_netcore.LIB'
  wpfgfx.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.dll
  wpfgfx.vcxproj -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.pdb (Full PDB)
  PresentationCore-ref -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\PresentationCore-ref\Debug\net6.0\PresentationCore.dll
  UIAutomationProvider -> D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\bin\UIAutomationProvider\Debug\net6.0\UIAutomationProvider.dll

Build FAILED.

LINK : fatal error LNK1104: cannot open file 'MSVCURTD_netcore.LIB' [D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\src\Microsoft.DotNet.Wpf\src\DirectWriteForwarder\DirectWriteForwarder.vcxproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:05:26.77
Build failed with exit code 1. Check errors above.
See log: D:\a\dotnetCampus.CustomWpf\dotnetCampus.CustomWpf\artifacts\log\Debug\Build.binlog
##vso[task.complete result=Failed]msbuild execution failed.
Killing running build processes...

The github action is : https://github.com/dotnet-campus/dotnetCampus.CustomWpf/actions/runs/6595089616/job/17919705232

Activity

  1. lindexi commented on Oct 21, 2023

    @lindexi
    MemberAuthor

    As @singhashish-wpf says in #6251 (comment), the visual studio 17.3 Preview 2 can fix this issues. But the github action still fail with Visual Studio Enterprise 2022 17.7.34202.233. Is this VisualStudio's issues?

  2. singhashish-wpf commented on Oct 23, 2023

    @singhashish-wpf
    Contributor

    Not sure if your github action is installing vs workloads specified in the vsconfig file. This should ideally not be there if the vsconfig workloads are installed with VS and during a clean build.

  3. lindexi commented on Oct 23, 2023

    @lindexi
    MemberAuthor
  4. singhashish-wpf commented on Oct 23, 2023

    @singhashish-wpf
    Contributor

    Are you installing the vs workloads in wpf.vsconfig file as well or not?
    Are you running a clean build? (Is there a clean task in your github action?)

  5. added
    Question
    on Oct 23, 2023
  6. lindexi commented on Oct 23, 2023

    @lindexi
    MemberAuthor

    @singhashish-wpf I just run in github action. And the github action will use the default windows-latest development enviroment, but I am not sure it installed the vs workloads in wpf.vsconfig file. And the github action will clone the repo to the new folder which means I do the clean before build.

  7. lindexi commented on Dec 6, 2023

    @lindexi
    MemberAuthor

    Install as follow still fail.

    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" --quiet --norestart --nocache --add Microsoft.Component.CodeAnalysis.SDK --add Microsoft.Component.MSBuild --add Microsoft.Component.VC.Runtime.UCRTSDK --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.Net.Component.4.7.2.TargetingPack --add Microsoft.NetCore.Component.DevelopmentTools --add Microsoft.NetCore.Component.SDK --add Microsoft.VisualStudio.Component.Git --add Microsoft.VisualStudio.Component.NuGet --add Microsoft.VisualStudio.Component.Roslyn.Compiler --add Microsoft.VisualStudio.Component.Roslyn.LanguageServices --add Microsoft.VisualStudio.Component.TextTemplating --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.VC.Modules.x86.x64 --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VSSDK --add Microsoft.VisualStudio.Component.Windows10SDK.19041
    

    Fail:

     LINK : fatal error LNK1104: cannot open file 'MSVCURTD_netcore.LIB' [D:\a\wpf\wpf\src\Microsoft.DotNet.Wpf\src\DirectWriteForwarder\DirectWriteForwarder.vcxproj]
    ##vso[task.logissue type=error;sourcepath=LINK;linenumber=0;columnnumber=0;code=LNK1104;](NETCORE_ENGINEERING_TELEMETRY=Build) cannot open file 'MSVCURTD_netcore.LIB'
      hw.vcxproj -> D:\a\wpf\wpf\artifacts\bin\hw\Win32\Debug\hw.lib
      precomp.cpp
      dllentry.cpp
      wpfgfx.def
         Creating library D:\a\wpf\wpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.lib and object D:\a\wpf\wpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.exp
      wpfgfx.vcxproj -> D:\a\wpf\wpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.dll
      wpfgfx.vcxproj -> D:\a\wpf\wpf\artifacts\bin\wpfgfx\Win32\Debug\wpfgfx_cor3.pdb (Full PDB)
    
    Build FAILED.
    
    LINK : fatal error LNK1104: cannot open file 'MSVCURTD_netcore.LIB' [D:\a\wpf\wpf\src\Microsoft.DotNet.Wpf\src\DirectWriteForwarder\DirectWriteForwarder.vcxproj]
        0 Warning(s)
        1 Error(s)
    
    Time Elapsed 00:03:40.89
    Build failed with exit code 1. Check errors above.
    See log: D:\a\wpf\wpf\artifacts\log\Debug\Build.binlog
    ##vso[task.complete result=Failed]msbuild execution failed.
    
  8. riverar commented on Mar 14, 2024

    @riverar

    @lindexi For some reason, it appears the build process (or Visual Studio command prompt?) is latching onto an earlier MSVC toolchain. I have C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33521 on disk but VSpre during build is using 14.39.33519 during build for some reason.

    So as a workaround, ensure you have C++/CLI support for v143 build tools installed for one or two toolchains earlier.

    Screenshot from Visual Studio installer:
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions