<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issues porting to 2025 .net 8.0 - C# but compiler thinks Visual basic? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911624#M3210</link>
    <description>&lt;P&gt;Fairly certain I did .net 8.0 (long term support). Your template worked, thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2024 08:09:18 GMT</pubDate>
    <dc:creator>kelsey_williams_QHECPT4QJFDH</dc:creator>
    <dc:date>2024-07-22T08:09:18Z</dc:date>
    <item>
      <title>Issues porting to 2025 .net 8.0 - C# but compiler thinks Visual basic?</title>
      <link>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911490#M3208</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to port a project to 2025 / .net 8.0. It isn't working and as a sanity check ive created the "first autocad project" As per the .net 2025 guide.&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;

[assembly: CommandClass(typeof(MyFirstProject1.Class1))]

namespace MyFirstProject1
{
    public class Class1
    {
        [CommandMethod("AdskGreeting")]
        public void AdskGreeting()
        {
            // Get the current document and database, and start a transaction
            Document acDoc = Application.DocumentManager.MdiActiveDocument;
            Database acCurDb = acDoc.Database;

            // Starts a new transaction with the Transaction Manager
            using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
            {
                // Open the Block table record for read
                BlockTable acBlkTbl;
                acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
                                             OpenMode.ForRead) as BlockTable;

                // Open the Block table record Model space for write
                BlockTableRecord acBlkTblRec;
                acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
                                                OpenMode.ForWrite) as BlockTableRecord;

                /* Creates a new MText object and assigns it a location,
                text value and text style */
                using (MText objText = new MText())
                {
                    // Specify the insertion point of the MText object
                    objText.Location = new Autodesk.AutoCAD.Geometry.Point3d(2, 2, 0);

                    // Set the text string for the MText object
                    objText.Contents = "Greetings, Welcome to AutoCAD .NET";

                    // Set the text style for the MText object
                    objText.TextStyleId = acCurDb.Textstyle;

                    // Appends the new MText object to model space
                    acBlkTblRec.AppendEntity(objText);

                    // Appends to new MText object to the active transaction
                    acTrans.AddNewlyCreatedDBObject(objText, true);
                }

                // Saves the changes to the database and closes the transaction
                acTrans.Commit();
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having issues with the reference files, I've downloaded from here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://aps.autodesk.com/developer/overview/autocad-objectarx-sdk-downloads" target="_blank"&gt;AutoCAD ObjectARX SDK downloads | Autodesk Platform Services&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also tried using the same dll files from autocad civil3d installation and both are giving errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	CS0103	The name 'Application' does not exist in the current context	testclass	"my path" - Documents\Code\net8 tester\testclass\Class1.cs	20	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I compile it complains that bout different versions of microsoft.visualbasic? I'm not using visual basic?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;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.7\ref\net8.0\Microsoft.VisualBasic.dll].
        C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref\net8.0\Microsoft.VisualBasic.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\ref\net8.0\Microsoft.VisualBasic.dll".
            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.7\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
        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
            AeccDbMgd
        C:\Program Files\Autodesk\AutoCAD 2025\C3D\AeccDbMgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\C3D\AeccDbMgd.dll".
            AeccDbMgd
        C:\Program Files\Autodesk\AutoCAD 2025\C3D\AeccHydroCalcsMgd.dll
          Project file item includes which caused reference "C:\Program Files\Autodesk\AutoCAD 2025\C3D\AeccHydroCalcsMgd.dll".
            AeccDbMgd	testclass	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets	2401	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried using the nuget for the autocad references but it doesnt work, compiles fine but when I load it to a drawing none of the commands show up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone know whats up?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 06:40:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911490#M3208</guid>
      <dc:creator>kelsey_williams_QHECPT4QJFDH</dc:creator>
      <dc:date>2024-07-22T06:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issues porting to 2025 .net 8.0 - C# but compiler thinks Visual basic?</title>
      <link>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911562#M3209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;When you started your project in Visual Studio, did you choose the class library project template that targets .NET or .NET Standard (not the one that target .NET Framework)?&lt;/P&gt;
&lt;P&gt;Anyway, you could use &lt;A href="https://github.com/gileCAD/AutoCAD-Csharp-Project-Template/" target="_blank" rel="noopener"&gt;this AutoCAD plugin project template&lt;/A&gt; after having edited the different files so that the AutoCAD libraries match those on the local computer.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 07:22:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911562#M3209</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-07-22T07:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issues porting to 2025 .net 8.0 - C# but compiler thinks Visual basic?</title>
      <link>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911624#M3210</link>
      <description>&lt;P&gt;Fairly certain I did .net 8.0 (long term support). Your template worked, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 08:09:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/issues-porting-to-2025-net-8-0-c-but-compiler-thinks-visual/m-p/12911624#M3210</guid>
      <dc:creator>kelsey_williams_QHECPT4QJFDH</dc:creator>
      <dc:date>2024-07-22T08:09:18Z</dc:date>
    </item>
  </channel>
</rss>

