<?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 How can I add a static 'Main' method suitable for an entry point? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11353707#M12068</link>
    <description>&lt;P&gt;I am getting an error on my code that says "Error CS5001&lt;BR /&gt;Program does not contain a static 'Main' method suitable for an entry point" I am coding in C# using Microsoft Visual Studio and .NET. This is my code. &lt;A href="https://www.jbbess.com/" target="_blank" rel="noopener"&gt;&lt;FONT color="#fbfbfb"&gt;Link&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;    using System.IO;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using System;






class projectsummer
{
    [CommandMethod("OpenDrawing", CommandFlags.Session)]
   

    public static void OpenDrawing()

    

    {
        string strFileName = "C:\\DRAFT.dwg";
        DocumentCollection acDocMgr = Application.DocumentManager;

        if (File.Exists(strFileName))
        {
            acDocMgr.Open(strFileName, false);
        }
        else
        {
            acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName +
                                                            " does not exist.");
        }
    }
}&lt;/PRE&gt;&lt;P&gt;I am not sure how to go about this error. Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2022 12:37:26 GMT</pubDate>
    <dc:creator>Iamhamidd</dc:creator>
    <dc:date>2022-08-16T12:37:26Z</dc:date>
    <item>
      <title>How can I add a static 'Main' method suitable for an entry point?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11353707#M12068</link>
      <description>&lt;P&gt;I am getting an error on my code that says "Error CS5001&lt;BR /&gt;Program does not contain a static 'Main' method suitable for an entry point" I am coding in C# using Microsoft Visual Studio and .NET. This is my code. &lt;A href="https://www.jbbess.com/" target="_blank" rel="noopener"&gt;&lt;FONT color="#fbfbfb"&gt;Link&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;    using System.IO;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using System;






class projectsummer
{
    [CommandMethod("OpenDrawing", CommandFlags.Session)]
   

    public static void OpenDrawing()

    

    {
        string strFileName = "C:\\DRAFT.dwg";
        DocumentCollection acDocMgr = Application.DocumentManager;

        if (File.Exists(strFileName))
        {
            acDocMgr.Open(strFileName, false);
        }
        else
        {
            acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName +
                                                            " does not exist.");
        }
    }
}&lt;/PRE&gt;&lt;P&gt;I am not sure how to go about this error. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 12:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11353707#M12068</guid>
      <dc:creator>Iamhamidd</dc:creator>
      <dc:date>2022-08-16T12:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I add a static 'Main' method suitable for an entry point?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11353838#M12069</link>
      <description>&lt;P&gt;[There is a &lt;A href="https://forums.autodesk.com/t5/net/bd-p/152" target="_blank" rel="noopener"&gt;&amp;gt;.NET-specific Forum&amp;lt;&lt;/A&gt; where you may find people better able to help you.]&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 14:12:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11353838#M12069</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-08-11T14:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I add a static 'Main' method suitable for an entry point?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11356107#M12070</link>
      <description>&lt;P&gt;While you wait for a moderator to move this, you should take a look at your project type. It looks like you may have created an exe project. Only exe's require a Main sub. Projects for use in AutoCAD need to be made from the template called "Class (.NET Framework)".&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 15:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-add-a-static-main-method-suitable-for-an-entry-point/m-p/11356107#M12070</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-08-12T15:07:32Z</dc:date>
    </item>
  </channel>
</rss>

