Author Topic: Novice Getting started with forms?  (Read 1611 times)

0 Members and 1 Guest are viewing this topic.

GILESP

  • Newt
  • Posts: 42
Novice Getting started with forms?
« on: July 23, 2013, 06:23:07 AM »
Hi again.

Took some advice on a previous thread and took a step back. Did some reading, and managed to sucessfully compile my first project.

So now I'm onto my second project, and this one has a form in it.

I've created a short code fragment that will launch/open the form when you type the command, and a basic form with just a close button on it.

Problem is that when I go to debug I get an error:

"A project with an output type of class library cannot be started directly"
"In order to debug this project, add an executable project to this solution which references the library project, set the executable project as the startup project"

I did a bit of searching on the above phrases, and got a variety of conflicting advice from modifying some XML files in the project folder to setting a startup project using menus that don't exist...

Can anyone help me here?

p.s. I've used the autocad wizard to set up the basic project, was there a setting on that I should have used?


Edit: Just gone back to my previous project (Which doesn't have forms) and that's asking the same thing, so it looks like I've managed to break something in VS2010 express, maybe???
« Last Edit: July 23, 2013, 06:36:53 AM by GILESP »
..END OF LINE..

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Novice Getting started with forms?
« Reply #1 on: July 23, 2013, 09:36:34 AM »
Quote
The Class Library project template creates a DLL. For more information, see Class Library Template. Because the class library is a DLL, you cannot run it directly. It must be called by an application (usually an EXE). The calling application may be built in another project in the same Visual Studio solution that contains the DLL, it may be an existing program already deployed on a test or production machine, or it may be located on the Web and accessed through a URL.
Link
 
 

GILESP

  • Newt
  • Posts: 42
Re: Novice Getting started with forms?
« Reply #2 on: July 23, 2013, 09:53:18 AM »
I've seen that screenshot (or similar) elsewhere, unfortunately the options on my debug tab are not the same..

I did notice that my configuration was different - mine was Active (release), so on changing it using the cofiguration manager (build menu) the debug now works, so I kinda got it fixed, even if it wasn't the way intended.

Thanks :)
..END OF LINE..

CADDOG

  • Newt
  • Posts: 82
  • wishbonesr
Re: Novice Getting started with forms?
« Reply #3 on: July 23, 2013, 02:28:03 PM »
Add Post-build event command line:
xcopy /Y "$(TargetDir)*.*" "$(appdata)\Autodesk\ApplicationPlugins\"

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Novice Getting started with forms?
« Reply #4 on: July 23, 2013, 06:10:37 PM »
I believe Jeff posted the how you would setup Visual Studio.  You are using Visual Studio Express which does not have that option.  Check out this post which shows how to use the AutoCAD Wizard to debug with Visual Studio Express.
 
http://through-the-interface.typepad.com/through_the_interface/2011/08/debugging-autocad-net-projects-using-express-editions.html
 
If you are not using the wizard then I believe you can modify the same files manually.  This link should point you in the right direction.
 
http://through-the-interface.typepad.com/through_the_interface/2006/07/debugging_using.html
 
 
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013