Error BC31091 Import of Type MarshalByRefObject from Assembly or Module failed
Hi, I Received the Above Error when I tried to run A VB.Net program that ran fine in 2022 in 2025. I Migrated the Program to .Net8.0 according to Giles instructions and I'm still receiving this error. Below is my.VBProj File. Any Help Would be Much Appreciated. Thanks.
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Library</OutputType> <RootNamespace>List_XL</RootNamespace> <AssemblyName>CD2</AssemblyName> <MyType>Windows</MyType> <PublishUrl>publish\</PublishUrl> <Install>true</Install> <InstallFrom>Disk</InstallFrom> <UpdateEnabled>false</UpdateEnabled> <UpdateMode>Foreground</UpdateMode> <UpdateInterval>7</UpdateInterval> <UpdateIntervalUnits>Days</UpdateIntervalUnits> <UpdatePeriodically>false</UpdatePeriodically> <UpdateRequired>false</UpdateRequired> <MapFileExtensions>true</MapFileExtensions> <ApplicationRevision>0</ApplicationRevision> <ApplicationVersion>1.0.0.%2a</ApplicationVersion> <IsWebBootstrapper>false</IsWebBootstrapper> <UseApplicationTrust>false</UseApplicationTrust> <BootstrapperEnabled>true</BootstrapperEnabled> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <UseWindowsForms>true</UseWindowsForms> <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets> <TargetFramework>net8.0-windows</TargetFramework> <Copyright>Copyright © </Copyright> <AssemblyVersion>1.0.0.0</AssemblyVersion> <FileVersion>1.0.0.0</FileVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DocumentationFile>CD2.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DefineDebug>false</DefineDebug> <DocumentationFile>CD2.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn> </PropertyGroup> <ItemGroup> <Reference Include="AcCoreMgd, Version=25.0.58.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\ObjectARX 2025\inc\AcCoreMgd.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="AcDbMgd"> <HintPath>C:\ObjectARX 2025\inc\AcDbMgd.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="AcMgd"> <HintPath>C:\ObjectARX 2025\inc\AcMgd.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="AcWindows, Version=20.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Private>False</Private> </Reference> <Reference Include="AdWindows, Version=6.3.0.14, Culture=neutral, processorArchitecture=MSIL"> <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> <FrameworkReference Include="Microsoft.WindowsDesktop.App" /> </ItemGroup> <ItemGroup> <Compile Update="Exel_Frm.Designer.vb"> <DependentUpon>Exel_Frm.vb</DependentUpon> </Compile> <Compile Update="My Project\Application.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Application.myapp</DependentUpon> </Compile> <Compile Update="My Project\Resources.Designer.vb"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Update="My Project\Settings.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> </ItemGroup> <ItemGroup> <None Update="My Project\Application.myapp"> <Generator>MyApplicationCodeGenerator</Generator> <LastGenOutput>Application.Designer.vb</LastGenOutput> </None> </ItemGroup> <ItemGroup> <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> <Visible>False</Visible> <ProductName>.NET Framework Client Profile</ProductName> <Install>false</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> <Visible>False</Visible> <ProductName>.NET Framework 2.0 %28x86%29</ProductName> <Install>false</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> <Visible>False</Visible> <ProductName>.NET Framework 3.0 %28x86%29</ProductName> <Install>false</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> <Visible>False</Visible> <ProductName>.NET Framework 3.5</ProductName> <Install>false</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> <Visible>False</Visible> <ProductName>.NET Framework 3.5 SP1</ProductName> <Install>true</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> <Visible>False</Visible> <ProductName>Windows Installer 3.1</ProductName> <Install>true</Install> </BootstrapperPackage> </ItemGroup> <ItemGroup> <COMReference Include="Microsoft.Office.Core"> <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid> <VersionMajor>2</VersionMajor> <VersionMinor>8</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False</Isolated> <EmbedInteropTypes>True</EmbedInteropTypes> </COMReference> <COMReference Include="Microsoft.Office.Interop.Excel"> <Guid>{00020813-0000-0000-C000-000000000046}</Guid> <VersionMajor>1</VersionMajor> <VersionMinor>9</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False</Isolated> <EmbedInteropTypes>True</EmbedInteropTypes> </COMReference> <COMReference Include="VBIDE"> <Guid>{0002E157-0000-0000-C000-000000000046}</Guid> <VersionMajor>5</VersionMajor> <VersionMinor>3</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False</Isolated> <EmbedInteropTypes>True</EmbedInteropTypes> </COMReference> </ItemGroup> </Project>