views:

243

answers:

1

I've got a Visual Studio Excel Workbook project. When I publish the workbook and examine the source of the workbook (I open WinZip and check custom.xml), I see the tag _AssemblyLocation, which corresponds to the publish path.

Is there a way to read _AssemblyLocation from my .NET code?

I'd like to be able to read the publish path and determine which environment (development/quality assurance/production) I'm in based on server name.

+1  A: 

I guess you could open the xlsx using the ZipPackage class then read the XML using Xquery or xlinq etc.

http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx

76mel
Kinda what I thought I'd have to do. Thanks.
Peder Rice