How to fix the visual basic version conflict in Visual studio with AutoCAD 2025?

How to fix the visual basic version conflict in Visual studio with AutoCAD 2025?

shricharana_bharadwaj
Enthusiast Enthusiast
1,203 Views
5 Replies
Message 1 of 6

How to fix the visual basic version conflict in Visual studio with AutoCAD 2025?

shricharana_bharadwaj
Enthusiast
Enthusiast

Hi,

 

I've started working with AutoCAD 2025 and I get the below warning in the project.

The primary visual basic (used by .net8) is older (10.0.0.0) version and AutoCAD references the new version 10.1.0..0.

How do I make the project use the newer version?

I don't want to suppress the warning since the issue may cause problems at runtime.

 

Severity	Code	Description	Project	File	Line	Suppression State
Warning (active)	MSB3277	Found conflicts between different versions of "Microsoft.VisualBasic" that could not be resolved.
There was a conflict between "Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "Microsoft.VisualBasic, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "Microsoft.VisualBasic, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\Microsoft.VisualBasic.dll].
        C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\Microsoft.VisualBasic.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\Microsoft.VisualBasic.dll".
            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref/net8.0/Microsoft.VisualBasic.dll
    References which depend on or have been unified to "Microsoft.VisualBasic, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Program Files\Autodesk\AutoCAD 2025\accoremgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\accoremgd.dll".
            accoremgd
            Acmgd            
        C:\Program Files\Autodesk\AutoCAD 2025\acdbmgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\acdbmgd.dll".
            Acdbmgd
            accoremgd
            acdbmgdbrep
            Acmgd            
        C:\Program Files\Autodesk\AutoCAD 2025\acdbmgdbrep.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\acdbmgdbrep.dll".
            acdbmgdbrep            
        C:\Program Files\Autodesk\AutoCAD 2025\acmgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\acmgd.dll".
            Acmgd            
        C:\Program Files\Autodesk\AutoCAD 2025\AcTcMgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\AcTcMgd.dll".
            Acmgd            
        C:\Program Files\Autodesk\AutoCAD 2025\AcMNUParser.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\AcMNUParser.dll".
            Acmgd            	
	C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets	2412	

 

0 Likes
1,204 Views
5 Replies
Replies (5)
Message 2 of 6

murugamaha
Contributor
Contributor
I had this issue previously, regarding visual basic version, visual studio has decided which version to go based on the message, maybe you have to check and change things like X64 or x86 in configuration manager, also check whether the references you use are from object arx 2025 sdk rather than from the autocad installation folder
0 Likes
Message 3 of 6

norman.yuan
Mentor
Mentor

Sounds like your project setup may not be correct. You may want to post your *.vbproj file (in Solution Explorer, right click the project and select "Edit project file").

 

BTW, if you are to keep doing AutoCAD programming going after AutoCAD2025 or later, you might want to switch to C# ASAP. Microsoft has already stopped advancing VB.NET with its .NET progress (since .NET6?). The earlier, the transition is easier.

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 4 of 6

shricharana_bharadwaj
Enthusiast
Enthusiast

Hi, 

 

Actually I am using C#, not VB. I don't know why I get the VB warning. I do have other warnings related to version issue as well.  They are,

 

System.Drawing (V4.0.0.0 and V8.0.0.0) V4.0.0.0 is being used because it is primary.

WindowsBase (V4.0.0.0 and  V8.0.0.0) V4.0.0.0 is being used because it is primary.

 

AutoCAD seems to use v8.0.0.0 while Windowsbase.dll and System.Drawing.dll seems to use V4.0.0.0. 

Below is what is in .csproj file.

 

 

 

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <PlatformTarget>x64</PlatformTarget>
	  <!--<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>-->
  </PropertyGroup>

  <ItemGroup>
    <Reference Include="accoremgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD 2025\accoremgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Acdbmgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD 2025\acdbmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="acdbmgdbrep">
      <HintPath>C:\Program Files\Autodesk\AutoCAD 2025\acdbmgdbrep.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Acmgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD 2025\acmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>

</Project>

 

 

 

0 Likes
Message 5 of 6

norman.yuan
Mentor
Mentor

Ah, what you are talking is the warning VS2022 prompts when compiling the project. As long as your project compiles, you can ignore it. It is internal thing of how AutoCAD2025 handle its compatibility issues with .NET Framework and .NET 8, I believe.

 

If your project need UI, then you would add following <ItemGroup />:

<ItemGroup>
		<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
		<FrameworkReference Include="Microsoft.WindowsDesktop.App.WPF" />
    </ItemGroup>

 

Note, you probably only need either WindowsForm, or WPF, depending your choice.

 

Once you add this <ItemGroup /> in the *.csproj file, the warning you saw when compiling your project would be gone.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 6 of 6

wilbertholkema
Community Visitor
Community Visitor

For some reason I need them both. But thank you for the help

0 Likes