Wednesday, May 30, 2012

IIS–migrating site settings from one server to another

Here is a simple way to migrate your sites and app-pools from one server to another (I was setting up a new dev machine for myself)

Export app-pools and sites from source machine:

%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml

%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml

Import app-pools and sites onto destination machine:

%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml

%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml

Note:

When you import the app-pool, you will need to edit the apppools.xml file to remove all those app-pools that have already been defined on your destination computer (eg: DefaultAppPool)

When you import the sites, you may get errors, just delete the sites that cause the errors and reimport the sites.xml file.

Note 2:

If you need to export only a single site use the following command:

appcmd list SITE /site.name:SITENAME /config /xml > c:\SITENAME.xml

Wednesday, May 16, 2012

Biztalk–pipeline.exe error: System cannot find the file specified

If the error is being thrown from mscorlib, then check the path to the pipeline (btp) file. Also check the path to the input file. (I normally provide the full path to the files).

If the error is being thrown from your custom dll, then make sure that any libraries that you are referencing are installed in the GAC.

Error message:

Message:        The system cannot find the file specified.
HRESULT:        80070002

Monday, May 07, 2012

BTSScnSSOApplicationConfig–Storing application configuration in BizTalk SSO

There are 2 tools that you use to manage your application data: SsoManage.exe and BTSScnSSOApplicationConfig.exe.

SsoManage.exe can be found at “C:\Program Files\Common Files\Enterprise Single Sign-On”

But for testProperty, you need to actually build it. Do this by browsing to “BT Server\MSI\Program Files\SDK\Scenarios\Common\SSOApplicationConfig\bin” folder (the folder is extracted when you unzip the Developer edition of BizTalk).

Once in the SSOApplicationConfig folder, run “Setup.Bat”, which will build “BTSScnSSOApplicationConfig.exe” for you.

Commands:

SsoManage:

SsoManage uses an xml file to define an application and a list of config properties. Here is an example:

<?xml version="1.0" encoding="utf-8"?>
<sso>
    <application name="MyTestApp">
        <description>My first app</description>
        <appUserAccount>BizTalk Application Users</appUserAccount>
        <appAdminAccount>BizTalk Server Administrators</appAdminAccount>
        <field ordinal="0" label="dummyDoNotUseOrDelete" masked="no" />
        <field ordinal="1" label="testProperty" masked="no" />
        <flags configStoreApp="yes" allowLocalAccounts="yes" enableApp="yes" />
    </application>
</sso>

You import the XML using the SsoManage –CreateApp “xmlfile” command.

BTSScnSSOApplicationConfig:

And you set property values using:

btsscnssoapplicationconfig -set MyTestApp "ConfigProperties" "testProperty" "testConnectionString"

And you get property values using:

btsscnssoapplicationconfig -get MyTestApp "ConfigProperties" "testProperty"

Using DebugView with BizTalk for debugging

DebugView is used to view trace messages output by an application on Windows. (get it from:http://technet.microsoft.com/en-us/sysinternals/bb896647).

Once you have downloaded and have DebugView running, you need to instrument your BizTalk process to perform tracing. The easiest way to do this, is to insert an Expression shape onto your orchestration and add the following code into the expression:

System.Diagnostics.Trace.WriteLine("Hello World");

In DebugView, make sure that you have capturing enabled for Global Win32 (“Capture” ==> “Capture Global Win32”). When you start the capture, you should see trace information.

Setting up GacUtil as part of your post build step

Here is a simple set of commands to get GacUtil to run as part of the post-build step (via the project properties dialog)

set var="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\gacutil.exe" /i "$(TargetPath)" /f
echo running gacutil
echo %var%