More PipelineStoreLocation enum values

Jul 7, 2008 at 11:18 AM
Edited Jul 7, 2008 at 11:20 AM
Value for PipelineStoreLocation.ApplicationBase is equal to AppDomain.CurrentDomain.BaseDirectory.
But for third-party applications it's a bad path, for example "C:\Program Files\AutoCAD 2009\"
Here is example for another path Environment.CurrentDirectory
http://msdn.microsoft.com/en-us/library/system.addin.hosting.addinstore.aspx
http://msdn.microsoft.com/en-us/magazine/cc163476.aspx

It's a good new enum value, but with care...
Do some manipulations:
1.load addins in debug configuration (Environment.CurrentDirectory = "output path"\debug)
2.delete all files and rebuild in release configuration
3.load addins in release configuration and have strange path (Environment.CurrentDirectory = C:\Documents and Settings\User\My Documents)
4.load addins in release configuration again and have good path (Environment.CurrentDirectory = "output path"\release)
wow! :)

If I miss 2 step:
3.load addins in release configuration and have strange path again (Environment.CurrentDirectory = "output path"\debug)
4.load addins in release configuration again and have good path (Environment.CurrentDirectory = "output path"\release)

In this situation I use System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) it's always point to correct place. It's a good new enum value :)
Other good enums are:
System.Windows.Forms.Application.CommonAppDataPath (C:\Documents and Settings\All Users\Application Data\Autodesk, Inc.\AutoCAD\R17.2.56.0)
System.Windows.Forms.Application.LocalUserAppDataPath (C:\Documents and Settings\User\Local Settings\Application Data\Autodesk, Inc.\AutoCAD\R17.2.56.0)
System.Windows.Forms.Application.UserAppDataPath (C:\Documents and Settings\User\Application Data\Autodesk, Inc.\AutoCAD\R17.2.56.0)
Jul 18, 2008 at 8:40 AM
Hi quiz,

I don't understand why Environment.CurrentDirectory would point to different paths when run twice. Are you launching it both times from the Visual Studio IDE? If so, it could be a bug in Visual Studio. Can you provide more details and/or a repro?

Thanks for the suggestion about the enum values. We have provided PipelineStoreLocation.ApplicationBase as a convenience; it's kind of hard to predict where add-ins would be deployed. That's why we provide an easy way to search any path for add-ins: namely the overloads of AddInStore.Update() and Rebuild() that take in String paths as parameters.

-mueez