InvalidProgramException - Common Language Runtime detected an invalid program.

InvalidProgramException - Common Language Runtime detected an invalid program.

Anonymous
Not applicable
4,762 Views
13 Replies
Message 1 of 14

InvalidProgramException - Common Language Runtime detected an invalid program.

Anonymous
Not applicable

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.

0 Likes
4,763 Views
13 Replies
Replies (13)
Message 2 of 14

michael_robertson
Collaborator
Collaborator

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
0 Likes
Message 3 of 14

Anonymous
Not applicable

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

0 Likes
Message 4 of 14

Anonymous
Not applicable

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

0 Likes
Message 5 of 14

Balaji_Ram
Alumni
Alumni

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

0 Likes
Message 6 of 14

Anonymous
Not applicable

Hi Tarik,

 

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

 

Thanks

 

Neil

0 Likes
Message 7 of 14

Anonymous
Not applicable
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!
0 Likes
Message 8 of 14

michael_robertson
Collaborator
Collaborator

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

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

Alexander.Rivilis
Mentor
Mentor

@Anonymous 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

Anonymous
Not applicable

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!

0 Likes
Message 11 of 14

Alexander.Rivilis
Mentor
Mentor

@Anonymous 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

0 Likes
Message 12 of 14

Anonymous
Not applicable
I wondered about whether I could get away with doing that or not. Thanks!
0 Likes
Message 13 of 14

Alexander.Rivilis
Mentor
Mentor

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

0 Likes
Message 14 of 14

Anonymous
Not applicable

Hi I am not getting any installer for RealDWG application.

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

0 Likes