.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

InvalidProgramException - Common Language Runtime detected an invalid program.

13 REPLIES 13
Reply
Message 1 of 14
tarikpeterson
3384 Views, 13 Replies

InvalidProgramException - Common Language Runtime detected an invalid program.

Currently I've got code that is failing when I try to run StartTransaction() using the TransactionManager. I keep getting a InvalidProgramException.

 

Is this due to me not actually having AutoCAD installed on my development box?  I do have references to AcDbMgd and AcMgd loaded in my project if that makes a difference.

13 REPLIES 13
Message 2 of 14

Yes, you need either a AutoCAD based product or RealDWG for your program to work.

 

Just and FYI since I don't know what you are tyring to achieve but if you are trying to use those dll files without one of the above products you are looking a legal licensing issues also.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 3 of 14

Mike,

 

Thanks for your speedy response. I downloaded ObjectArx and thought that was all I needed. I'm a software developer and was hoping to not have to install the full AutoCAD package just to do my development. Is there any way other way to accomplish that? If not I guess I'll suck it up and install it.

 

Thanks,

Tarik

Message 4 of 14
surfer989
in reply to: tarikpeterson

I'm also receiving this error, I installed RealDWG in my development machine.  Do I still need to have AutoCAD installed?

Message 5 of 14
Balaji_Ram
in reply to: surfer989

With RealDwg, your application can read and save DWG files. It does not include the editor functionality to display the drawing as AutoCAD does. Also, you do not need to have AutoCAD installed in the same machine.

 

Can you provide more details about your application setup and the assembly references that you are using in it ?

Can you provide me a minimal sample project that gives the error ? 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 6 of 14
neil.motley
in reply to: tarikpeterson

Hi Tarik,

 

Did you get a response to this as I too am receiving the same exception ?

 

Thanks

 

Neil

Message 7 of 14

I'm building a Windows Forms app using Visual Studio 2015. My app will be installed on machines that use AutoCAD 2016. I need to create batch plot list files (DSD) outside of AutoCAD. I've included ObjectARX managed dlls in my project (per AutoDesk documentation), and I have AutoCAD 2016 installed. My code compiles but at runtime, I get a System.InvalidProgramException when I try to call a C# method that accesses the managed dlls. Does anyone have any ideas why this might be occurring? Thanks!
Message 8 of 14

Is your Windows Form a standalone exe or an addin that runs inside AutoCAD?

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 9 of 14


@shawn.davies wrote:
I'm building a Windows Forms app using Visual Studio 2015. My app will be installed on machines that use AutoCAD 2016. I need to create batch plot list files (DSD) outside of AutoCAD. I've included ObjectARX managed dlls in my project (per AutoDesk documentation), and I have AutoCAD 2016 installed. My code compiles but at runtime, I get a System.InvalidProgramException when I try to call a C# method that accesses the managed dlls. Does anyone have any ideas why this might be occurring? Thanks!

Because it is impossible use ObjectARX managed dll outside of AutoCAD process (e.g. in external exe-file). Those dlls can be used only in AutoCAD .NET plugins (e.g. in process acad.exe). How much I remember the only exception from this rule - AcCui.dll

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 10 of 14

My Windows Forms app is a stand-alone windows forms application. Is it not possible to create a batch plot list file outside of AutoCAD?

 

Thanks for your reply!

Message 11 of 14


@shawn.davies wrote:

My Windows Forms app is a stand-alone windows forms application. Is it not possible to create a batch plot list file outside of AutoCAD?

 

Thanks for your reply!


This file is a simple text file. So you can create it with help of usual .NET classes/methods for creating/writing files.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 12 of 14

I wondered about whether I could get away with doing that or not. Thanks!
Message 13 of 14

In this sample DSD-file created with help of  StreamWriter class: Publish Layouts to PDF using COM

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 14 of 14

Hi I am not getting any installer for RealDWG application.

Could you please provide me the link to download RealDWG software?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost