.NET

Reply
*Corey A. Layton
Message 1 of 17 (1,396 Views)

VB.NET: "A project with an Output Type of Class Library cannot be started directly"

1396 Views, 16 Replies
06-01-2006 12:35 PM
Hey there.

I'm *very green* in using VS2005.
With no former .NET experience.

I am pretty savvy in VBA for AutoCAD/ADT, however;
and am trying to convert some VBA code over to VB.NET.

Anyway,

How do I debug a *.dll for ADT?

I've tried to search past threads here,
but I *think* many of the older solutions for 2003/2004/2005 and
earlier versions of Visual Studio and .NET Runtime are no longer applicable?

What I've done so far:
1. added the location of my AutoCAD/ADT executable to the:
Project>Properties>Debug>Start Options>WorkingDirectory
2. Changed my references properties for:
acmdg.dll
acdbmgd.dll
AecArchMgd.dll
AecBaseMgd.dll
to 'Copy Local' = False

From what I can tell from past threads,
I *think* that I need to create somesortof "Startup Object" in
Project>Properties>Application?
(which is now set to "(None)")

Would someone be kind enough to outline the steps/settings required to allow
me to step through my code?
Distinguished Contributor
RonnieWilkins
Posts: 453
Registered: ‎04-07-2003
Message 2 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-01-2006 02:49 PM in reply to: *Corey A. Layton
1. Select Project > {YourProjectName} Properties.
2. Select the Debug tab.
3. Set 'Start Action' to 'Start external program: {Path to ADT's acad.exe}'.
4. Select Debug > Start Debugging.
5. After ADT finishes loading, type NETLOAD at the command prompt and browse to the 'VB.NET Project Location\bin\Debug' folder and select the dll for your project.

Make sure to turn off Loader Lock by selecting 'Debug > Exceptions...', expand Managed Debugging Assistants, and finally uncheck Loader Lock.
Ronnie Wilkins, Jr.
AMS CAD + CAFM Solutions
Sr. Solutions Developer
Autodesk Certified Instructor: Inventor
*Corey A. Layton
Message 3 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-02-2006 05:03 AM in reply to: *Corey A. Layton
rwilkins wrote:
> 1. Select Project > {YourProjectName} Properties.
> 2. Select the Debug tab.

ok, so far..

> 3. Set 'Start Action' to 'Start external program: {Path to ADT's
> acad.exe}'.

I don't have this choice.
only:
Debug>Start Options>Command Line arguments:
Debug>Start Options>Working Directory:
Debug>Start Options>Enable the Visual Studio hosting process

those are all of my settings available under the Debug tab in Project
Properties.

Are you *sure* your instruction is compatible with Visual Basic 2005
Experess Edition?

> 4. Select Debug > Start Debugging.
> 5. After ADT finishes loading, type NETLOAD at the command prompt and
> browse to the 'VB.NET Project Location\bin\Debug' folder and select
> the dll for your project.
>
> Make sure to turn off Loader Lock by selecting 'Debug >
> Exceptions...', expand Managed Debugging Assistants, and finally
> uncheck Loader Lock.

Obviously, the rest of your steps are not applicable either...
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 4 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-02-2006 09:09 AM in reply to: *Corey A. Layton
A really cool feature of dotnet is you do not even need an ide to write and debug code.
I use VS2005 pro and have no way to test this with the express editions, but it SHOULD work (famous last words).

Assuming a name of "myproject" for the dll project.

1) Shut down visual studio

2) Edit the xml file myproject.csproj.user for C# or myproject.vbproj.user for vb.net.
Make sure the "Start*" nodes are all present and fill them in, here is an example for ADT2007 running as plain AutoCAD.
You will have to change the arguments to match the desktop icon for ADT proper.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2004">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Autodesk Architectural Desktop 2007\acad.exe</StartProgram>
<StartArguments>/p "AutoCAD"</StartArguments>
<StartWorkingDirectory>C:\Program Files\Autodesk Architectural Desktop 2007\UserDataCache</StartWorkingDirectory>
</PropertyGroup>
</Project>

You should now be able to restart VS and hit F5 to debug.

Chris Arps
www.visionrez.com
Valued Contributor
Paul Richardson
Posts: 87
Registered: ‎10-06-2005
Message 5 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-02-2006 09:26 AM in reply to: *Corey A. Layton
Works fine in C# Express
*Corey A. Layton
Message 6 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-02-2006 09:53 AM in reply to: *Corey A. Layton
CArps wrote:
> Make sure the "Start*" nodes are all present and fill them in,

Chris,

Thank you so much for helping...

here's my xml:



C:\Program Files\Autodesk Building Systems
2007\



C:\Program Files\Autodesk Building Systems
2007\


It doesn't loook *quite* like your example?What would be the
syntax for adding the 'start nodes'?Can you help further?
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 7 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-02-2006 11:29 AM in reply to: *Corey A. Layton
You will have to attach the xml file or replace "<" with &amplt; and ">" with &ampgt; for me to see it here.

Chris Arps
*Corey A. Layton
Message 8 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-05-2006 06:02 AM in reply to: *Corey A. Layton
CArps wrote:
> You will have to attach the xml file

ok, Chris.

Hereyago...

(remove the *.txt extension)
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 9 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-05-2006 07:55 AM in reply to: *Corey A. Layton
I have edited the file and added the three nodes to the xml.

However, the current StartArguments node is set for ADT as Autocad. I don't have ABS installed to get the proper values.

You will need to right click on your ABS icon and copy everything after ".exe" to the StartArguments node so ABS will run correctly.

<StartArguments>PLACE ABS ARGUMENTS HERE</StartArguments>
*Corey A. Layton
Message 10 of 17 (1,396 Views)

Re: VB.NET: "A project with an Output Type of Class Library cannot be started directly"

06-05-2006 08:13 AM in reply to: *Corey A. Layton
CArps wrote:
> I have edited the file and added the three nodes to the xml.

thank you so much, Chris!

I'll try and run the debig now...

I'll report back here either way...

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community