This is how I spat out the versions of .NET 1.1 compiled against the WSSv2 API and .NET 2.0 compiled against the WSSv3 build. He will work in VS 2005 and 2008.
You will need to use MSBEE http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee
Work with .NET 1.1 with Visual Studio 2008
Some tips
Open the * .csproj file and find out where the link to the SharePoint dll is referenced, and change something similar that will change the link assembly depending on your purpose (FX1_1 means that you are targeting .NET1.1 and therefore WSSv2)
<Reference Include="Microsoft.SharePoint"> <HintPath Condition="'$(TargetFX1_1)'!='true'">pathto\WSS3\Microsoft.SharePoint.dll</HintPath> <HintPath Condition="'$(TargetFX1_1)'=='true'">pathto\WSS2\Microsoft.SharePoint.dll</HintPath> </Reference>
Use conditional compilation for differences if necessary
#if FX1_1 // WSSv2 specific code #else // WSSv3 specific code #endif
If you get a compiler error, but the code looks correct, it may happen that the error is only for .NET1.1 / WSSv2 and compiles to .NET2 / WSSv3. Check the output tab to see for what purpose the error occurred.
You will also need to master some of the MSBUILD ninja moves in order to preserve the 1 step creation process and keep yourself in order http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/ using MSBUILD. can force VS to compile both versions at the same time without resorting to the command line.
This will start compiling .NET1.1 after .NET shuts down and displays some messages in the output window to help you figure out where the errors occurred.
<Target Name="BeforeBuild"> <Message Text="--- Building for .NET 1.1 ---" Importance="high" Condition="'$(TargetFX1_1)'=='true'" /> <Message Text="--- Building for .NET 2.0 ---" Importance="high" Condition="'$(TargetFX1_1)'!='true'" /> </Target> <Target Name="AfterBuild" Condition="'$(TargetFX1_1)'!='true'"> <MSBuild Projects="$(MSBuildProjectFile)" Properties="TargetFX1_1=true;" /> </Target>
Ryan
source share