William's Blog Just another VSPUG – Virtual SharePoint User Group weblog

21Nov/080

STSDEV Debugging

I don't like hacking the gac in order to debug things for MOSS, so I created a new Target for STSDEV.

This target simply copies the output assembly to the bin directory of my web application, removes the assembly from the GAC, and then refreshes the App Pool. At this point you can simply attach to the w3wp.exe process in your off to the races (or the OWSTIMER.exe if you're doing timer jobs).

So the addition in Microsoft.SharePoint.targets is:

<Target Name="DebugInetBin">
    <
Message Text="Building to Bin Directory..." Importance="high" />
    <
Message Text="Uninstalling assembly in GAC and recycling app pool" Importance="high" />
    <
Exec Command="$(GACUTIL) -u $(AssemblyName)" />
    <
Exec Command='$(ISSAPP_SCRIPT) recycle APPPOOL "SharePoint - 80"' />
    <
Message Text="" Importance="high" />
</
Target>

In addition, the project file (.csproj) needs to modified as well:

  1. Add the following PropertyGroup
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugInetBin|AnyCPU' ">
        <
    DebugSymbols>true</DebugSymbols>
        <
    OutputPath>C:inetpubwwwrootin</OutputPath>
    </
    PropertyGroup>
  2. Add the following CallTarget to the AfterBuild:
    <CallTarget Targets="DebugInetBin" Condition=" '$(Configuration)|$(Platform)' == 'DebugInetBin|AnyCPU' " />

Filed under: Uncategorized Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment



No trackbacks yet.