.NET

Reply
Member
pp-developer
Posts: 4
Registered: ‎04-16-2010
Message 1 of 6 (1,016 Views)
Accepted Solution

Message "Click here to reload the designer" on loading XAML-file in VS2012

1016 Views, 5 Replies
08-20-2013 06:12 AM

This is a new install of Win7 64 bits, VS2012 (Update 3), AutoCAD 2013

My steps:

  1. Create a new project: "WPF User Control Library"
  2. Add a this project a new "Window" (xaml)
  3. Load the new Window. It loads fine.
  4. Add a Reference to: "C:\Program Files\Autodesk\AutoCAD 2013\accoremgd.dll"
  5. Rebuild the solution. Now the Window (xaml) shows the next error: An Unhandled Exception has occurred -- Click here to reload the designer -- Details: -- System.IO.FileNotFoundException -- Could not load file or assembly 'accoremgd, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

 In my 32-bit VM it works fine.

What's wrong in my installation?

Kind regards

The problem you have experience could be because of you setting reference to AutoCAD .NET API assemblies installed with AutoCAD, not to the ones from ObjectARX SDK.

 

This is a known issue, especially in early stage when AutoCAD .NET API became available (Acad2005/6). At that time, people directly set references to acdbmgd/acmgd.dll in Acad installation folder and found that the windows form designer in VS crashed very often.

 

The reason is when VS loading Wim form in designed, it has to resolve all the referenced types/classes. The acad .NET assemblies are wrappers of unmanaged ObjectARX, thus have some dependencies that may only available when AutoCAD is running, thsu where the crash comes.

 

Later, Autodesk supplied a strip-down version of the .NET assemblies for development in ObjectARX SKD, which removed some of those dependencies. The version of assemblies coming with SDK is like C++ header file, which is only for development to resolve types and their methods/properties.... That is why it is strongly recommended you set references to the ones coming from SDK, not from the AutoCAD installation, and not distribute the accemblies with your code (set "Copy Local" to "False").

 

Since I saw you mentioned you set reference to "C:\...\AutoCAD 2012\...", which must be AutoCAD installation folder, so I thought this might be the cuase of your problem.

 

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (1,009 Views)

Re: Message "Click here to reload the designer" on loading XAML-file i

08-20-2013 06:16 AM in reply to: pp-developer
you can check this link if you have not already noticed this one

http://msdn.microsoft.com/en-us/library/bb907398(v=vs.90).aspx
Member
pp-developer
Posts: 4
Registered: ‎04-16-2010
Message 3 of 6 (995 Views)

Re: Message "Click here to reload the designer" on loading XAML-file i

08-20-2013 07:16 AM in reply to: mzakiralam

The problem only occurs in 64-bit OS when I add the reference to the "accoremgd.dll" of AutoCAD 2013.

This XAML-file has no link with this reference.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 4 of 6 (985 Views)

Re: Message "Click here to reload the designer" on loading XAML-file i

08-20-2013 08:03 AM in reply to: pp-developer

Can you check out from advance compiler option of your VS project that assembly is targeted for any CPU like below (red marked)?

 

Capture3.JPG

*Expert Elite*
norman.yuan
Posts: 1,016
Registered: ‎04-27-2009
Message 5 of 6 (979 Views)

Re: Message "Click here to reload the designer" on loading XAML-file i

08-20-2013 08:55 AM in reply to: pp-developer

The problem you have experience could be because of you setting reference to AutoCAD .NET API assemblies installed with AutoCAD, not to the ones from ObjectARX SDK.

 

This is a known issue, especially in early stage when AutoCAD .NET API became available (Acad2005/6). At that time, people directly set references to acdbmgd/acmgd.dll in Acad installation folder and found that the windows form designer in VS crashed very often.

 

The reason is when VS loading Wim form in designed, it has to resolve all the referenced types/classes. The acad .NET assemblies are wrappers of unmanaged ObjectARX, thus have some dependencies that may only available when AutoCAD is running, thsu where the crash comes.

 

Later, Autodesk supplied a strip-down version of the .NET assemblies for development in ObjectARX SKD, which removed some of those dependencies. The version of assemblies coming with SDK is like C++ header file, which is only for development to resolve types and their methods/properties.... That is why it is strongly recommended you set references to the ones coming from SDK, not from the AutoCAD installation, and not distribute the accemblies with your code (set "Copy Local" to "False").

 

Since I saw you mentioned you set reference to "C:\...\AutoCAD 2012\...", which must be AutoCAD installation folder, so I thought this might be the cuase of your problem.

 

Member
pp-developer
Posts: 4
Registered: ‎04-16-2010
Message 6 of 6 (946 Views)

Re: Message "Click here to reload the designer" on loading XAML-file i

08-21-2013 06:50 AM in reply to: norman.yuan

Thank you very much!

This was the solution for my problem...

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.