Message 1 of 3
How can I add a static 'Main' method suitable for an entry point?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am getting an error on my code that say "Error CS5001
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. Link
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."); } } }
I am not sure how to go about this error. Thank you!