.NET

.NET

Reply
Contributor
ohioDeveloper
Posts: 13
Registered: ‎05-03-2013
Message 1 of 8 (410 Views)
Accepted Solution

What files are needed to deploy my .NET application to other machines?

410 Views, 7 Replies
08-07-2013 10:17 AM

I am creating an application for AutoCAD 2012 using Visual Studio in C#.

 

My work so far includes new commands, graphical tools and additions to the ribbon with PNGs to use as Ribbon icons included as Properties.Resources. I have references to AdWindows, PresentationCore, PresentationFramework, and more.

 

If I want to roll out my application to another machine, what do I need to include? For my testing purposes I've been able to debug from Visual Studio to create my DLL and then NETLOAD that in.

The machines I'm deploying to do not have any special setup - they don't have ObjectARX installed, they (as far as I know) don't have any special DLLs.

 

Loading my one DLL on another machine didn't work (duh) but I'm not sure if I should include acdbmgd, acmgd, if they should be in the same path, how to configure that, etc.

 

Ideally, once I know where everything is to go, I will provide a batch script or Inno Setup to make it easy for a user to install the application component.

Then check acad.exe.config file of that AutoCAD. Sometimes it can happen that something in config file is commented out and therefore creates problem. Please share your acad.exe.config file of that . Please also make sure that you are trying to load the DLL from local disk like C drive

Some of that "garbage" may also help with the diagnosis.

Mentor
conormccartney3897
Posts: 187
Registered: ‎08-18-2010
Message 2 of 8 (389 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-07-2013 02:19 PM in reply to: ohioDeveloper

You shouldn't need to include anything other then the DLL. First check your target Framework, found under project properties>Compile>Advanced Compile Options. 2012 wants 3.5? I think the Visual Studio install adds extra framework packages which allow things to run on your comp that wont on others. And you dont need to install it, I personally prefer to netload through the Acad.lsp.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 3 of 8 (371 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-08-2013 12:39 AM in reply to: ohioDeveloper
Contributor
ohioDeveloper
Posts: 13
Registered: ‎05-03-2013
Message 4 of 8 (357 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-08-2013 10:52 AM in reply to: ohioDeveloper

I'm using Visual Studio Express 2010, whose menus aren't quite the same as regular VS2010... but I have it set with Target Framework of 4.0, which I'm pretty sure it what AutoCAD 2012 wants (and it works on my machine with 2012).

 

If I build, and grab my DLL (Status.dll) and have another machine NETLOAD it, instead of running, a bunch of garbage appears in the editor.

 

Within the project, I reference other DLLs like acdbmgd, acmgd, and AdWindows... should these be set up differently? Relative location vs. local? Maybe my DLL isn't including their functionality when it is created and expects these to be present on the new machines?

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 5 of 8 (353 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-08-2013 11:05 AM in reply to: ohioDeveloper
Then check acad.exe.config file of that AutoCAD. Sometimes it can happen that something in config file is commented out and therefore creates problem. Please share your acad.exe.config file of that . Please also make sure that you are trying to load the DLL from local disk like C drive
*Expert Elite*
dgorsman
Posts: 5,698
Registered: ‎10-12-2006
Message 6 of 8 (349 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-08-2013 11:20 AM in reply to: mzakiralam

Some of that "garbage" may also help with the diagnosis.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Contributor
ohioDeveloper
Posts: 13
Registered: ‎05-03-2013
Message 7 of 8 (342 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-08-2013 12:12 PM in reply to: ohioDeveloper

Hey, you were both right!

 

The problem was that I was loading from a network location instead of the local hard drive. Placing the DLL locally made it run.

 

Furthermore, I should have read through that "garbage" because it included that exact diagnosis.

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

 Anyway, thanks for that help. I still haven't tackled setting up an installer but with all the links provided here I'm sure I can figure it out. I also need to learn how to sign the DLL, but that's a different story.

Distinguished Mentor
BlackBox_
Posts: 785
Registered: ‎02-25-2013
Message 8 of 8 (309 Views)

Re: What files are needed to deploy my .NET application to other machines?

08-09-2013 07:37 PM in reply to: ohioDeveloper
FWIW - to NETLOAD an assembly in 2012 (or 2011, 2010 for that matter), you need to enable the LoadFromRemoteSources XmlAttribute within Acad.exe.config (after making a backup copy, of course).

Kean has a good article on this you should be able to find via Google.

I've done this for all of our user machines so that I can mitigate all local install assemblies, and instead place a single one on the network each NETLOADs from. Autoloader .bundles are the only internal customizations I've had to deploy to each machine.

Cheers


"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.