Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

assembly attribute prevents placing inherited VT on form

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
jmaeding



Joined: 11 Apr 2008
Posts: 66

PostPosted: Wed Jan 14, 2015 4:47 pm    Post subject: assembly attribute prevents placing inherited VT on form Reply with quote

I created a class that inherits VT, and went to place it on my form and it gave an error:
Failed to create component "MyVT".
...could not load assembly "accore.mgd".....

I have made many VT controls before and never had this issue.
I narrowed it down to the fact that my form is part of an assembly marked as:
[assembly: CommandClass(typeof(CTCivilXtra.XAppAcad))]
[assembly: ExtensionApplication(typeof(CTCivilXtra.XAppAcad))]
These attribute definitions come from Autodesk.AutoCad.Runtime, which involves the accore.mgd.dll and a couple others.

I use these as you have to when making classes that define commands for AutoCad. If I take them away, the MyVT adds to the form no problem.

Those acad assemblies do exist on my computer in my autocad installation folder. They do not get copied local, Copy Local is false for them, so maybe that is why they are not found.

I do not have the VT source code, not sure if its even sold, so do not know why the inherited VT does this.
A non-inherited VT placed straight from toolbox does add fine.
Not sure why this happens but I can replicate on a very simple project if needed.
[/img]
_________________
James M
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5000

PostPosted: Thu Jan 15, 2015 12:25 am    Post subject: Reply with quote

I think the problem is that the visual studio designer needs to load your assembly in order to put the control on your form - however it can't find some of the assemblies that your assembly depends on (because of those attribute definitions). You could try either ensuring the required assemblies are copied to the same directory as the assembly containing the derived virtual tree, or you could register the required assemblies in the Global Assembly Cache (GAC) using Gacutil.exe.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
jmaeding



Joined: 11 Apr 2008
Posts: 66

PostPosted: Thu Jan 15, 2015 1:37 am    Post subject: Reply with quote

neither of those ideas will work for AutoCad add-ons.
It sounds like you think this is a generic issue though, like any component would do this.
Its only ones that derive from VT though, as if there is reflection going on and freaking out.
The source code would reveal this I think.
_________________
James M
Back to top
View user's profile Send private message
jmaeding



Joined: 11 Apr 2008
Posts: 66

PostPosted: Thu Jan 15, 2015 1:41 am    Post subject: Reply with quote

source code is only $200. I wasted that already, just did not notice it before.
_________________
James M
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5000

PostPosted: Thu Jan 15, 2015 2:23 am    Post subject: Reply with quote

Does the problem only happen at design time - ie if you programmatically create an instance of VirtualTree and add it to your forms Controls collection does this cause an error when you use the add on?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
jmaeding



Joined: 11 Apr 2008
Posts: 66

PostPosted: Thu Jan 15, 2015 2:40 am    Post subject: Reply with quote

have not tried. I also need to try uncommenting the attributes once the control has been added design time.
_________________
James M
Back to top
View user's profile Send private message
jmaeding



Joined: 11 Apr 2008
Posts: 66

PostPosted: Mon Jan 19, 2015 5:18 pm    Post subject: Reply with quote

I was able to uncomment the attributes after adding the inherited VT to my form.
This may come in handy for others writing AutoCad Add-ons, for which the VT is just the best control ever.
Things like Layer lists and data exploration would not be the same without it! I would like to make one of the examples be an autocad layer list, to get that crowd interested.
_________________
James M
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5000

PostPosted: Mon Jan 19, 2015 9:49 pm    Post subject: Reply with quote

Great. If you want to provide us with a sample AutoCAD AddOn using Virtual Tree we would be happy to put the code up on our site.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group