Using the EnvDTE.Project class you can access the BizTalk Server 2006 project properties to get/set its value. A bts-project uses two collections to store the properties; I’ll explain where you can find each property.
Configuration Properties
To access the configuration properties, you need to get the item ConfigProperties from the active configuration. This item gets a value that represents the dictionary that contains the properties. (See code below)
Property configProperties = project.ConfigurationManager.ActiveConfiguration.Properties.Item("ConfigProperties");
IDictionary dicConfigProps = configProperties.Value as IDictionary;
string outputPath = dicConfigProps[DictionaryTags.OutputPath].ToString();
In the code, the type of project variable is EnvDTE.Project and represents the BizTalk Server 2006 project. This object has a dictionary with each property related to configuration, to access each property you must use the DictionaryTags.
In the example, I get the location of the output files for the current project using the DictionaryTags.OutputPath key. This is the list that you can access in this dictionary.
|
|
|
Configuration Properties |
Enumeration |
|
Section: Build |
|
Restart Host Instances: specifies whether to restart all BizTalk in-process host instances on local machine. |
DictionaryTags.RestartHostInstances |
|
Register: specifies whether to register the assembly in the Global Assembly Cache. |
DictionaryTags.Register |
|
Redeploy: specifies whether to delete existing configuration and recreate it every time the assembly is deployed. |
DictionaryTags.Redeploy |
|
Application Name: specifies the BizTalk Application in which to deploy the assembly. |
DictionaryTags.ApplicationName |
|
Configuration Database: configuration Database to deploy. |
DictionaryTags.ConfigurationDatabase |
|
Server: specifies the server when the BizTalk Configuration Database resides. |
DictionaryTags.Server |
|
Section: Deployment |
|
BPEL Compliance: specifies whether to generate Business Process Execution Language (BPEL) compliance output. |
DictionaryTags.BpelCompliance |
|
Generate Debugging Information: specifies whether generate debug symbols. |
DictionaryTags.GenerateDebuggingInformation |
|
Embed Tracking Information: specifies whether to embed tracking information in the assembly. |
DictionaryTags.EmbedTrackingInformation |
|
Treat Warnings As Errors: specifies whether to treat warning as errors during the build. |
DictionaryTags.TreatWarningsAsErrors |
|
Warning Level: specifies the warning level. |
DictionaryTags.WarningLevel |
|
Output Path: specifies the location of the output files for this project configuration. |
DictionaryTags.OutputPath |
|
|
Common Properties
To access the configuration properties, you need to get the item CommonProperties from the project. This item gets a value that represents the dictionary that contains the properties. (See code below)
Property commmonProperties = project.Properties.Item("CommonProperties");
IDictionary dicCommonProps = commmonProperties.Value as IDictionary;
string projKeyFileName = dicCommonProps[DictionaryTags.AssemblyKeyFile].ToString();
In the example, I get the name of the file that contains either the public key using the DictionaryTags.AssemblyKeyFile enumeration. This is the list that you can access in this dictionary.
|
|
|
Common Properties |
Enumeration |
|
Section: Assembly |
|
Assembly Key Name: indicates the key container that contains the key pair passed as a parameter to the constructor of this attribute. |
DictionaryTags.AssemblyKeyName |
|
Assembly Key File: specifies the name of the file that contains either the public key or both the public and private keys passed as parameter to the constructor of this attribute. |
DictionaryTags.AssemblyKeyFile |
|
Assembly Delay Sign: value indicating that delay signing is being used. |
DictionaryTags.AssemblyDelaySign |
|
Assembly Title: specifies the title of the assembly. |
DictionaryTags.AssemblyTitle |
|
Assembly Description: specifies a short description that summarizes the nature and purpose of the assembly. |
DictionaryTags.AssemblyDescription |
|
Assembly Default Alias: specifies the default alias to be used by referencing assemblies. |
DictionaryTags.AssemblyDefaultAlias |
|
Assembly Configuration: specifies the configuration of the assembly, such as Development or Deployment. |
DictionaryTags.AssemblyConfiguration |
|
Assembly Trademark: specifies the trademark information. |
DictionaryTags.AssemblyTrademark |
|
Assembly Product: specifies the product information. |
DictionaryTags.AssemblyProduct |
|
Assembly Informational Version: specifies the version information. |
DictionaryTags.AssemblyInformationalVersion |
|
Assembly File Version: specifies the Win32 file version. |
DictionaryTags.AssemblyFileVersion |
|
Assembly Copyright: specifies the copyright information. |
DictionaryTags.AssemblyCopyright |
|
Assembly Company: specifies the name of the company. |
DictionaryTags.AssemblyCompany |
|
Assembly Version: number that represent the version of the assembly. |
DictionaryTags.AssemblyVersion |
|
Assembly Culture: indicate the culture that the assembly supports. |
DictionaryTags.AssemblyCulture |
|
Section: References Path |
|
References Path: Lists the directories to search when the project is loaded for assemblies referenced by the project. This setting is specific to the project, computer, and user for which it is set. A relative path specification will be converted to, and stored as a fully-qualified path. Relative paths are assumed to be relative to the project directory. |
DictionaryTags.ReferencesPath |
|
Section: General |
|
Project Folder: the full path to the project directory. |
DictionaryTags.ProjectFolder |
|
Project File: the name of the file containing build, configuration, and the information about the project. |
DictionaryTags.ProjectFile |
|
Default Namespace: specifies the default namespace for added items, such as classes, that are added via the Add New Item Dialog Box. |
DictionaryTags.DefaultNamespace |
|
Assembly Name: the name of the output file that will hold assembly metadata. |
DictionaryTags.AssemblyName |
|
|
|
|
DictionaryTags Enumeration
The DictrionaryTags enumeration class is use to access each property, this class can be found in Microsoft.BizTalk.Studio.Extensibility.dll assembly. See the structure below.
public enum DictionaryTags{
OutputPath,
WarningLevel,
TreatWarningsAsErrors,
EmbedTrackingInformation,
GenerateDebuggingInformation,
BpelCompliance,
Server,
ConfigurationDatabase,
ApplicationName,
Redeploy, Register,
RestartHostInstances,
AssemblyName,
DefaultNamespace,
ProjectFile,
ProjectFolder,
ReferencesPath,
AssemblyCulture,
AssemblyVersion,
AssemblyCompany,
AssemblyCopyright,
AssemblyFileVersion,
AssemblyInformationalVersion,
AssemblyProduct,
AssemblyTrademark,
AssemblyConfiguration,
AssemblyDefaultAlias,
AssemblyDescription,
AssemblyTitle,
AssemblyDelaySign,
AssemblyKeyFile,
AssemblyKeyName, None
}