VS build error, Could not find type ‘System.Resources.SatelliteContractVersionAttribute’ in assembly System.Runtime.dll

I am in the process of upgrading a C# plugin library from .net framework 4.8 to .net 8.0 targeting windows. However for compatibility I also want to continue compiling for older versions using framework 4.8 I have done this with another project successfully, using the in-place upgrade built into Visual Studio and hand editing the csproj as necessary. On the second project that I am upgrading I received following error when compiling.

MC1000  Unknown build error, 'Could not find type 'System.Resources.SatelliteContractVersionAttribute' in assembly 'C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.8FacadesSystem.Runtime.dll'.'    *ProjectName*
C:Program Filesdotnetsdk8.0.302SdksMicrosoft.NET.Sdk.WindowsDesktoptargetsMicrosoft.WinFX.targets

In my csproj I have tried multiple things. The only thing that removes the error is setting <UseWPF> to false. However that breaks the build in other ways as I have several WPF UI elements that need to be compiled.
When I compile against .net 8.0, the build succeeds. It is only against framework 4.8 that it fails.

Below is a sanitized version of the csproj.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
    <Configurations>Release;ReleaseR24;ReleaseR23;ReleaseR22;ReleaseR21;ReleaseR20;Debug;DebugR24;DebugR23;DebugR22;DebugR21;DebugR20</Configurations>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <OutputType>Library</OutputType>
    <RootNamespace>Internal</RootNamespace>
    <NoWarn>1701;1702;SYSLIB0011;CA1416;MSB3270;CA2213;CA1060;msb3277</NoWarn>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>false</Prefer32Bit>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <UseWindowsForms>true</UseWindowsForms>
    <UseWPF>true</UseWPF>
    <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <Deterministic>false</Deterministic>
  </PropertyGroup>
    
  <!-- Generic imports Debug/Release> -->
  <PropertyGroup Condition="$(Configuration.Contains('Release'))">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition="$(Configuration.Contains('Debug'))">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
  </PropertyGroup>
    
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net8.0-windows</TargetFramework>
    <OutputPath>binRelease</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net8.0-windows</TargetFramework>
    <OutputPath>binDebug</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseR24|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binReleaseR24</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugR24|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binDebugR24</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseR23|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binRelease$23</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugR23|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binDebugR23</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseR22|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binReleaseR22</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugR22|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binDebugR22</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseR21|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binReleaseR21</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugR21|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binDebugR21</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseR20|AnyCPU'">
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binReleaseR20</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugR20|AnyCPU'">
    <DefineConstants>TRACE;DEBUG</DefineConstants>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>binDebugR20</OutputPath>
    <AssemblyName>Internal</AssemblyName>
  </PropertyGroup>
    
  <ItemGroup Condition="'$(Configuration)' == 'Release' Or '$(Configuration)' == 'Debug'">
    <Reference Include="LibsInternal25***.dll" />
  </ItemGroup>
  <ItemGroup Condition="$(Configuration.Contains('R24'))">
    <Reference Include="LibsInterna24***.dll" />
  </ItemGroup>
  <ItemGroup Condition="$(Configuration.Contains('R23'))">
    <Reference Include="LibsInternal23***.dll" />
  </ItemGroup>
  <ItemGroup Condition="$(Configuration.Contains('R22'))">
    <Reference Include="LibsInternal22***.dll" />
  </ItemGroup>
  <ItemGroup Condition="$(Configuration.Contains('R21'))">
    <Reference Include="LibsInternal21***.dll" />
  </ItemGroup>
  <ItemGroup Condition="$(Configuration.Contains('R20'))">
    <Reference Include="LibsInternal20***.dll" />
  </ItemGroup>
    
  <!-- .NET 8 (Core) -->
  <ItemGroup Condition="'$(TargetFramework)' == 'net8.0-windows'">
    <Reference Include="Libsnetcoredevexpress*.dll" />
      
    <PackageReference Include="Ribbon.Fork.NET" Version="6.0.0" />
    <PackageReference Include="DocumentFormat.OpenXml" Version="3.0.2" />
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
    <PackageReference Include="SpreadsheetLight.Core" Version="3.4.0" />
    <PackageReference Include="unvell.ReoGrid8.dll" Version="8.1.0" />
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.6" />
    <PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
    <PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
    <PackageReference Include="System.ServiceModel.Duplex" Version="6.0.0" />
    <PackageReference Include="System.ServiceModel.NetTcp" Version="8.0.0" />
    <PackageReference Include="System.ServiceModel.Security" Version="6.0.0" />
    <PackageReference Include="System.ServiceModel.Federation" Version="8.0.0" />
    <PackageReference Include="System.Windows.Forms.DataVisualization" Version="1.0.0-prerelease.20110.1" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
    <PackageReference Include="System.Drawing.Common" Version="8.0.6" />
    <PackageReference Include="System.IO.Packaging" Version="8.0.0" />
    <PackageReference Include="System.Text.Json" Version="8.0.3" />
  </ItemGroup>
    
  <!-- .NET Framework 4.8 -->
  <ItemGroup Condition="'$(TargetFramework)' == 'net48'">
    <Reference Include="Libsnetframeworkdevexpress*.dll" />
      
    <PackageReference Include="SpreadsheetLight" Version="3.4.9" />
    <PackageReference Include="unvell.ReoGrid.dll" Version="3.0.0" />
  </ItemGroup>
    
  <!-- Common -->
  <ItemGroup>
    <Reference Include="LibsPrivate.Internal.dll" />
    <Reference Include="LibsPrivate.Internal.dll" />
    <Reference Include="LibsPrivate.Internal.dll" />
    <Reference Include="LibsPrivate.Internal.dll" />  
      
    <PackageReference Include="SpreadsheetGear" Version="9.2.44" />
    <PackageReference Include="TaskScheduler" Version="2.11.0" />
    <PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="1.3.0" />
  </ItemGroup>  
</Project>

I have tried a number of things.
Clean and Build. Updated Visual Studio. Included a package reference to System.Runtime from Nuget. Set <ImportFrameworkWinFXTargets> to false and true just to make sure. I’ve looked at the output in diagnostic mode (not sure it told me a lot more about what is happening). I’ve re-installed the dev SDK and the runtime for .net framework 4.8. Restarted my computer. Asked a co-worker.

Using IlSpy I’ve looked at the Nuget version of System.Runtime and the version referenced in the error message and they don’t have the SatelliteContractVersion attribute set.

Not sure how best to proceed from here.

New contributor

chunkles is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật