Compile errors in Visual Studio 2022 for AutoCAD Map 3D 2025

Compile errors in Visual Studio 2022 for AutoCAD Map 3D 2025

subash_nallaKGZ2B
Explorer Explorer
1,791 Views
9 Replies
Message 1 of 10

Compile errors in Visual Studio 2022 for AutoCAD Map 3D 2025

subash_nallaKGZ2B
Explorer
Explorer

Hi Team, I am getting the below attached (Compile Error.png) while trying to create my first solution in AutoCAD Map 3D 2025 using Visual Studio 2022. Visual Studio is not able to show other .net frameworks (as shown in Installed Frameworks.png). Please guide me how to clear the compile errors and let me know for any other information.

0 Likes
Accepted solutions (1)
1,792 Views
9 Replies
Replies (9)
Message 2 of 10

Norman_Yuan
Mentor
Mentor

Your DLL project (class library project) is wrong. 

 

When you start a new AutoCAD .NET plugin project for AutoCAD2025 or newer, you should choose project type "Class Library:

Acad 2025 DLL project.png

Not "Class Library (Framework)":

Acad 2024 DLL project.png

 

It is obvious that your project was targeted .NET Framework, not .NET (originally known as .NET Core, but now it is simply .NET, because .NET Framework is gradually fading away).

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 10

subash_nallaKGZ2B
Explorer
Explorer

Thanks Norman for your reply. If I use Class Library instead of Class Library (Framework) am not able to add User Control (for creating pallatte) for my project, request you to suggest me on this.

0 Likes
Message 4 of 10

_gile
Consultant
Consultant

Hi,

You have to add:

<UseWindowsForms>true</UseWindowsForms>

or, if you use WPF:

<UseWPF>true</UseWPF>

 to some <PropertyGroup> of the project SDK/csproj (double click on the project in the solution explorer).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 10

subash_nallaKGZ2B
Explorer
Explorer

Hi by this I am able to include user control but not able it getting some issues in the designer. How can we attach AutoCAD.exe in this process in case to debug the code. Thanks.

0 Likes
Message 6 of 10

Norman_Yuan
Mentor
Mentor

You may want to read this long and very helpful discussion thread, initialized by @_gile 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 7 of 10

subash_nallaKGZ2B
Explorer
Explorer

I tried going through the link shared and couldn't find .Net Upgrade Assistant (Assistant.png) in Visual Studio 2022. My Visual Studio version is as attached (VS Version.png). I have vsix downloaded, can I do something with this. Thanks.

 

 

 

0 Likes
Message 8 of 10

subash_nallaKGZ2B
Explorer
Explorer

I have Visual Studio 2017 also installed in the machine.

0 Likes
Message 9 of 10

_gile
Consultant
Consultant
Accepted solution

@subash_nallaKGZ2B  a écrit :

I tried going through the link shared and couldn't find .Net Upgrade Assistant (Assistant.png) in Visual Studio 2022. My Visual Studio version is as attached (VS Version.png). I have vsix downloaded, can I do something with this. Thanks.


According to your Visual Studio version (17.14.27), you should not have to install this assitant, it is already built into Visual Studio (see this topic).

You can also create your own templates for AutoCAD plugins by following this example.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 10 of 10

subash_nallaKGZ2B
Explorer
Explorer

Thanks Norman and _gile followed your suggestions and was able to create my first project in Visual Studio 2022 for AutoCAD Map 3D 2025. Thanks a lot.

0 Likes