Revit 2025 encountered a could not load file or assembly System.Drawing.Common, Version 9.0.0.0

Revit 2025 encountered a could not load file or assembly System.Drawing.Common, Version 9.0.0.0

MartenSKBISAB
Contributor Contributor
308 Views
0 Replies
Message 1 of 1

Revit 2025 encountered a could not load file or assembly System.Drawing.Common, Version 9.0.0.0

MartenSKBISAB
Contributor
Contributor

When debugging from Visual Studio 2022 (17.12.3)
on line "System.Drawing.Size size = new System.Drawing.Size(800, 280);"
Project settings below

 

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PlatformTarget>x64</PlatformTarget>
		<UseWindowsForms>true</UseWindowsForms>
		<UseWPF>true</UseWPF>
		<ApplicationIcon>SDB3.ico</ApplicationIcon>
		<SignAssembly>False</SignAssembly>
		<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
		<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
		<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
		<Platforms>x64</Platforms>
		<OutputType>Library</OutputType>
		<FrameworkReference>Microsoft.WindowsDesktop.App</FrameworkReference>
	</PropertyGroup>
  <ItemGroup>
    <COMReference Include="Shell32">
      <WrapperTool>tlbimp</WrapperTool>
      <VersionMinor>0</VersionMinor>
      <VersionMajor>1</VersionMajor>
      <Guid>50a7e9b0-70ef-11d1-b75a-00a0c90564fe</Guid>
      <Lcid>0</Lcid>
      <Isolated>false</Isolated>
      <EmbedInteropTypes>true</EmbedInteropTypes>
    </COMReference>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Azure.Identity" Version="1.13.1" />
    <PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="9.0.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="System.Formats.Asn1" Version="9.0.0" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="RevitAPI">
      <HintPath>C:\Program Files\Autodesk\Revit 2025\RevitAPI.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RevitAPIUI">
      <HintPath>C:\Program Files\Autodesk\Revit 2025\RevitAPIUI.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>

 

0 Likes
309 Views
0 Replies
Replies (0)