Export (0) Print
Expand All

Customizing Project Templates

Internet Security and Acceleration Server 2000

You can find the templates for each project type in the SF\templates\Projects folder. Typical customizations include editing project properties, adding project references, adding recipes to a project type, and adding a configuration file.

Editing Project Properties

To edit properties of a project type, edit the AssemblyInfo.cs file for the project type (located in SF\templates\Projects\<ProjectType>\Properties), and modify a property value as appropriate. For example, if all projects should use a specific culture, you can insert the culture value into AssemblyInfo.cs for all the different project types, as shown in the following example.


                  // General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("$projectname$")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("$registeredorganization$")]
[assembly: AssemblyProduct("$projectname$")]
[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

                

Adding Project References

To add references to assemblies into the References folder of the project, edit the .csproj file for the project type (located in SF\templates\Projects\<ProjectType>) and insert <Reference> nodes as children of the <ItemGroup> node, and then set the Include attribute to be the name of the assembly that you want to add a reference to. The following code shows an example that adds references to the System, System.ServiceModel, System.Runtime.Serialization, and System.Xml assemblies to the References folder of the project.


                    <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Xml" />
  </ItemGroup>

                

Adding Recipes to a Project Type

To add references to recipes to a specific project type, edit the .vstemplate file for the project type (located in SF\templates\Projects\<ProjectType> folder) and insert the text <RecipeReference> nodes as children of the <References> node, and then set the Name attribute to be the name of the recipe you want to add a reference to. The following code shows an example that adds the recipes AddMessageToMessagesProject, AddRequestForStateWFToMessagesProject, AddErrorToMessagesProject, AddExceptionToMessagesProject, and ExportProject to the project.


                    <References>
    <RecipeReference Name="AddMessageToMessagesProject" Target="\" />
    <RecipeReference Name="AddRequestForStateWFToMessagesProject" Target="\" />
    <RecipeReference Name="AddErrorToMessagesProject" Target="\" />
    <RecipeReference Name="AddExceptionToMessagesProject" Target="\" />
    <RecipeReference Name="ExportProject" Target="\" />
  </References>

                

Adding a Web.config File

To add a Web.config file to a BLCategory project, copy the Web.config file shown in the next example into the SF\templates\Project\BLCategory folder. This is a default configuration file for a DCS service. You should modify the contents as appropriate for your organization. For example, you should change the value of the dnsAlias property of the <httpBaseAddress> element in the <cis.serviceModel> section to match the name of the servers used to host your services. For more information about configuration settings and Web.config files for DCS services, see Configuring the Web Host for a DCS Service.


                  <?xml version="1.0" encoding="utf-8"?>
<configuration>

  <!--
    =============================================================
    ManagementServices web.config
    =============================================================
  -->

  <!--  CONFIG SECTIONS
   =============================================================
  -->
  <configSections>
    <section name="WorkflowHost" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <!--  service model -->
    <sectionGroup name="cis.serviceModel" type="Microsoft.ConnectedIndustry.ServiceModel.Application.Configuration.ServiceModelSectionGroup, Microsoft.ConnectedIndustry.ServiceModel.Application, version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <section name="serviceFactory" type="Microsoft.ConnectedIndustry.ServiceModel.Configuration.ServiceFactorySection, Microsoft.ConnectedIndustry.ServiceModel, Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <section name="channelFactory" type="Microsoft.ConnectedIndustry.ServiceModel.Configuration.ChannelFactorySection, Microsoft.ConnectedIndustry.ServiceModel, version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </sectionGroup>
    <!--  context -->
    <section name="context" type="Microsoft.ConnectedIndustry.ServiceModel.Common.ContextSection, Microsoft.ConnectedIndustry.ServiceModel.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </configSections>

  <!--  CONNECTION STRINGS
   =============================================================
  -->
  <connectionStrings>
    <!--  common connection strings -->
    <add name="DCSManagementDb" connectionString="Server=CCFSQL;Initial Catalog=DCSManagementDB;Integrated Security=Yes;" providerName="System.Data.SqlClient"/>
    <add name="policyConfiguration" connectionString="Server=CCFSQL;Initial Catalog=ServiceConfiguration;Integrated Security=Yes;" providerName="System.Data.SqlClient"/>
    <!--<add name="businessLog" connectionString="Server=(local);Initial Catalog=businessLog;Integrated Security=Yes;" providerName="System.Data.SqlClient"/>-->
    </connectionStrings>

  <!--  APPSETTINGS
   =============================================================
  -->
  <appSettings>
    <!--  activator connection strings -->
    <add key="performanceCountersEnabled" value="false"/>
    <add key="eventLoggingEnabled" value="true"/>
    <add key="wmiEnabled" value="false"/>
    <add key="traceEnabled" value="false"/>
    <add key="debugEnabled" value="false"/>
  </appSettings>


  <!--  SYSTEM DIAGNOSTICS
   =============================================================
  -->
  <system.diagnostics>
    <sources>
      <source name="CIS" switchValue="Error, Critical">
        <listeners>
          <!--<add name="FileListener"/>-->
          <add name="EventLog"/>
        </listeners>
      </source>
      <source name="Microsoft.ConnectedIndustry.ServiceModel" switchValue="Error, Critical">
        <listeners>
          <!--<add name="FileListener"/>-->
          <add name="EventLog"/>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <!--<add name="FileListener" type="Microsoft.ConnectedIndustry.ServiceModel.Common.RollFileListener,  Microsoft.ConnectedIndustry.ServiceModel.Common, version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" logDirectory="C:\Program Files\Microsoft CIS\DCS\V1.0\log" baseFileName="AppManagementServices" maxFileNumber="5" maxFileSize="10000000" textFormatter="{MESSAGE}{BR}" exceptionFormatter="{EXCEPTION};{BR};{MESSAGE}{BR}{CONTEXT}{BR}" useInterProcessSyncronization="false" dontUseFormatPrefix="false" enableTraceUploader="false"/>-->
      <add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="DCS Runtime"/>
    </sharedListeners>
  </system.diagnostics>

  <!--  DCS SERVICEMODEL
   =============================================================
  -->
  <cis.serviceModel>
    <serviceFactory>
      <httpBaseAddress dnsAlias="CCF2009SERVER"/>
      <defaultServiceConfiguration serviceBehavior="DCSBehavior">
        <defaultEndpoint behaviorConfiguration="enableTracing">
          <defaultSimplexBinding binding="extendedHttpBinding" bindingConfiguration="simplex"/>
          <defaultDuplexBinding binding="extendedHttpBinding" bindingConfiguration="duplex"/>
        </defaultEndpoint>
      </defaultServiceConfiguration>
    </serviceFactory>
    <channelFactory>
      <discoveredEndpoint compositeBaseAddress="" behaviorConfiguration="enableTracing" useDefaultWebProxy="false"/>
      <mexDiscoveryEndpoint address="http://CCFIIS/DiscoveryService/DiscoveryService.svc" binding="basicHttpBinding" bindingConfiguration="discovery"/>
      <scopeRanking type="Microsoft.ConnectedIndustry.ServiceModel.Application.ScopeRanking,Microsoft.ConnectedIndustry.ServiceModel.Application,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      </scopeRanking>
      <scopeProvider type="Microsoft.ConnectedIndustry.ServiceModel.Application.ScopeProvider,Microsoft.ConnectedIndustry.ServiceModel.Application,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      </scopeProvider>
    </channelFactory>
  </cis.serviceModel>

  <!--  SYSTEM SERVICEMODEL
   =============================================================
  -->
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DCSBehavior">
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="enableTracing">
          <tracing/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <extendedHttpBinding>
        <binding name="simplex"/>
        <binding name="duplex" isComposite="true"/>
      </extendedHttpBinding>
      <basicHttpBinding>
        <binding name="discovery" useDefaultWebProxy="false"/>
      </basicHttpBinding>
    </bindings>
    <client>
      <metadata>
        <policyImporters>
          <extension type="Microsoft.ConnectedIndustry.ServiceModel.Application.Context.ContextBindingElement, Microsoft.ConnectedIndustry.ServiceModel.Application,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
        </policyImporters>
        <wsdlImporters>
        </wsdlImporters>
      </metadata>
    </client>
    <extensions>
      <bindingExtensions>
        <add name="extendedHttpBinding" type="Microsoft.ConnectedIndustry.ServiceModel.Application.Bindings.ExtendedHttpBindingCollectionElement, Microsoft.ConnectedIndustry.ServiceModel.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </bindingExtensions>
      <bindingElementExtensions>
        <add name="dcsContext" type="Microsoft.ConnectedIndustry.ServiceModel.Application.Context.ContextExtensionElement, Microsoft.ConnectedIndustry.ServiceModel.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </bindingElementExtensions>
      <behaviorExtensions>
        <add name="tracing" type="Microsoft.ConnectedIndustry.ServiceModel.Application.Instrumentation.TracingBehaviorExtension, Microsoft.ConnectedIndustry.ServiceModel.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </behaviorExtensions>
    </extensions>
  </system.serviceModel>

  <!--  SYSTEM WEB
   =============================================================
   this section contains list of assemblies exposing the interface
   of services
  -->
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="Microsoft.ConnectedIndustry.ProcessExecution.Configuration.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="Microsoft.ConnectedIndustry.ServiceModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="Microsoft.ConnectedIndustry.ServiceModel.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
    </compilation>
  </system.web>

  <WorkflowHost Name="WorkflowHost">
    <CommonParameters>
      <add name="ConnectionString" value="Database=WorkflowPersistenceStore;Server=CCFSQL;Integrated Security=Yes;"/>
    </CommonParameters>
    <Services>
      <!--<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" LoadIntervalSeconds="20" OwnershipTimeoutSeconds="120"/>-->
      <add type="
         Microsoft.ConnectedIndustry.ProcessExecution.WorkflowHost.ExtendedSqlWorkflowPersistenceService,
         Microsoft.ConnectedIndustry.ProcessExecution.WorkflowHost, version=1.0.0.0, Culture=neutral,
         PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" PersistOnIdle="true" LoadIntervalSeconds="20" OwnershipTimeoutSeconds="360" ConnectionString="Database=WorkflowPersistenceStore;Server=CCFSQL;Integrated Security=Yes;" ApplicationId="078E8A7E-5373-4C00-9C87-53D3E5C18873" HostProxyUrl="http://CCF2009SERVER/AppManagementService/WorkflowManagementService.svc"/>
    </Services>
  </WorkflowHost>
</configuration>

                

In the BLCategory.vstemplate file, add the following text as a child of the <TemplateContent> node, before the </Project> nodee.


                  <ProjectItem ReplaceParameters="true" TargetFileName="Web.config">Web.config</ProjectItem>

                

The following example shows this addition.


                  <TemplateContent>
    <Project File="BLCategory.csproj" ReplaceParameters="true">
        <Folder Name="Properties">
            <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
        </Folder>
    <ProjectItem ReplaceParameters="true" TargetFileName="Web.config">Web.config</ProjectItem>
    </Project>
</TemplateContent>

                

In the BLCategory.csproj file, add the following text as a child of the <ItemGroup> node at the bottom of the file. This sets the Build action for web.config to be None.


                  <None Include=”web.config” />

                

The following code shows this addition.


                    <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <None Include="web.config" />
  </ItemGroup>

                
Show:
© 2014 Microsoft