I'm trying to get the autoloader working.
http://download.autodesk.com/media/adn/ADN_DevCast_Episode_6/ADN_DevCast_Episode_6.html
Looks like it's a 'fairly' new addition and dead simple but..
All I need to do is add a single resource folder in the bundle and to the xml file to be able to access the files in the dll.
Does anyone know how to modify the xml file and refer to this folder in the dll?
<?xml version="1.0" encoding="utf-8" ?> <ApplicationPackage SchemaVersion="1.0" > <Components> <ComponentEntry AppName="DOTNETTEST2" ModuleName="./Contents/AutoloaderDotNetSample2.dll" LoadOnCommandInvocation="True" > <Commands GroupName="DevDays2010"> <Command Global="DOTNETTEST2" Local="DOTNETTEST2" /> </Commands> </ComponentEntry> </Components> </ApplicationPackage>
I can't remember where I got the resource files from and I can't find many posts on this.
Here is the DevCast for creating the installer.
http://download.autodesk.com/media/adn/DevCasts/ADN_DevCast_Episode_7.html
Also is there a way to change the path depending on whether or not you are debugging?
In VB6 I used a function
Public Function IsIDE() As Boolean 'Returns boolean value of True if not compiled IsIDE = (App.LogMode = 0) End Function
This new Autoloader is great but can be quite picky when not done right and there is no downloadable Schema yet available.
I have found that the online help was useful in knowing what Elements were required and what attribute properties were available. You can find the help here:
Schema breakdown
.bundle folder example
HTH,
Its not clear to me what you're trying to do. If you're trying to access a resource DLL from your plug-in DLL, then you should use relative paths in your plug-in code to refer to the location of the resource DLL. If for some reason you need to know at runtime the exact path to your plug-in DLL, then the .NET Assembly class provides a function to return this.
Could you give more detail of what you're trying to do?
For your second question, the autoloader doesn't differentiate between 'debug' and 'release'. Maybe you could set up a post-build action to copy a different PackageContents.xml file into the bundle with your built DLL depending on the build configuration being used?
My project refers to a dwg file and several images which I would like to include in the bundle copied to the ApplicationPlugins folder.
I just can't work out how to locate them. I get an error if I use:
PictureBox1.Image = System.Drawing.Bitmap.FromFile("../Images/test.png")
Possibly just something with the syntax i'm using.
If Images is a subfolder to your plug-in DLL location is, isn't the path just "Images\test.png"?
Or you can always create an absolute path if you don't trust relative paths, like this:
Dim strPath As String = Assembly.GetExecutingAssembly.Location & "\Images\test.png"
That's what I would expected but I've tried a few locations and keep getting file a not found exception.
Assembly.GetExecutingAssembly.Location is new to me and solved it.
I needed to strip the filename out of it. Maybe that's was part of the problem without specifying the full path.
Doesn't matter. Fixed. Thanks!
Imports System.Reflection
Imports System.IO
Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location) & "\Resources\test.png"