>> 원문: http://blogs.msdn.com/jomo_fisher/articles/410896.aspx
<!--
Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Written by Jomo Fisher
-->
<Project
DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><!--
These two property groups inform VS that there is a Platform called .NET 1.1.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|.NET 1.1' ">
<DebugSymbols Condition="'$(DebugSymbols)'==''">true</DebugSymbols>
<DebugType Condition="'$(DebugType)'==''">full</DebugType>
<Optimize Condition="'$(Optimize)'==''">false</Optimize>
<OutputPath Condition="'$(OutputPath)'==''">bin\.NET 1.1\Debug\</OutputPath>
<DefineConstants Condition="'$(DefineConstants)'==''">DEBUG;TRACE</DefineConstants>
<DefineConstants>$(DefineConstants);TARGETTING_FX_1_1</DefineConstants>
<ErrorReport></ErrorReport>
<WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
<CscToolPath>$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322</CscToolPath>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|.NET 1.1' ">
<DebugType Condition="'$(DebugType)'==''">pdbonly</DebugType>
<Optimize Condition="'$(Optimize)'==''">true</Optimize>
<OutputPath Condition="'$(OutputPath)'==''">bin\.NET 1.1\Release\</OutputPath>
<DefineConstants Condition="'$(DefineConstants)'==''">TRACE</DefineConstants>
<DefineConstants>$(DefineConstants);TARGETTING_FX_1_1</DefineConstants>
<ErrorReport></ErrorReport>
<WarningLevel Condition="'$(WarningLevel)'==''">4</WarningLevel>
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
<CscToolPath>$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322</CscToolPath>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup><!--
Import the standard C# targets
-->
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /><!--
Now that the standard targets have been brought in. Override some properties
and items it created.
-->
<PropertyGroup>
<AvailablePlatforms>$(AvailablePlatforms),.NET 1.1</AvailablePlatforms><AssemblySearchPaths Condition=" '$(Platform)' == '.NET 1.1' ">
{CandidateAssemblyFiles};
$(ReferencePath);
{HintPathFromItem};
{TargetFrameworkDirectory};
{AssemblyFolders};
$(OutputPath);
{GAC}
</AssemblySearchPaths><TargetFrameworkDirectory Condition=" '$(Platform)' == '.NET 1.1'">
$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322
</TargetFrameworkDirectory></PropertyGroup>
<ItemGroup Condition=" '$(Platform)' == '.NET 1.1'">
<TargetFrameworkDirectoryItem Include="$(SystemRoot)\Microsoft.NET\Framework\v1.1.4322">
<InProject>false</InProject>
</TargetFrameworkDirectoryItem>
</ItemGroup><!--
Override this target from Microsoft.Common.Targets so that we can supply our own
value for $(TargetFrameworkDirectory). This controls where assembly resolution
logic finds FX assemblies.
-->
<Target
Name="GetFrameworkPaths"
DependsOnTargets="$(GetFrameworkPathsDependsOn)"><!-- Get the path to the target .NET framework directory. -->
<GetFrameworkPath
Condition=" '$(Platform)' != '.NET 1.1' ">
<Output TaskParameter="Path" PropertyName="TargetFrameworkDirectory"/>
<Output TaskParameter="Path" ItemName="TargetFrameworkDirectoryItem"/>
</GetFrameworkPath><!-- Get the path to the target .NET framework SDK directory. -->
<GetFrameworkSDKPath
Condition=" '$(Platform)' != '.NET 1.1' ">
<Output TaskParameter="Path" PropertyName="TargetFrameworkSDKDirectory"/>
<Output TaskParameter="Path" ItemName="TargetFrameworkSDKDirectoryItem"/>
</GetFrameworkSDKPath></Target>
<!--
For 1.1 builds, intercept the call to CorResGen target (which generates 2.0 resources) and
slip in a call to our own CoreResGen_1_1.
Handily, the devices version of the ResGen task is able to call the 1.1 version of
ResGen directly.
-->
<UsingTask TaskName="CFResGen" AssemblyFile="$(MSBuildBinPath)\Microsoft.CompactFramework.Build.Tasks.dll" />
<PropertyGroup Condition="'$(Platform)' == '.NET 1.1'">
<ResGenDependsOn>ResolveAssemblyReferences;BeforeResGen;CoreResGen_1_1;AfterResGen</ResGenDependsOn>
</PropertyGroup>
<Target
Name="CoreResGen_1_1"
DependsOnTargets="$(CoreResGenDependsOn)">
<CFResGen
Condition = " '@(ResxWithNoCulture)' != ''"
Sources = "@(ResxWithNoCulture)"
UseSourcePath = "$(UseSourcePath)"
StateFile = "$(IntermediateOutputPath)$(MSBuildProjectFile).CrossCompileResGen.Cache"
OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
>
<!-- Appending to 'FilesWritten' list lets us be part of Clean and Incremental Clean. -->
<Output TaskParameter = "FilesWritten" ItemName="FileWrites"/>
<Output TaskParameter = "OutputResources" ItemName="ManifestResourceWithNoCulture"/>
</CFResGen><CFResGen
Condition = " '@(ResxWithCulture)' != ''"
Sources = "@(ResxWithCulture)"
UseSourcePath = "$(UseSourcePath)"
StateFile = "$(IntermediateOutputPath)$(MSBuildProjectFile).CrossCompileResGen.Cache"
OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')"
>
<!-- Appending to 'FilesWritten' list lets us be part of Clean and Incremental Clean. -->
<Output TaskParameter = "FilesWritten" ItemName="FileWrites"/>
<Output TaskParameter = "OutputResources" ItemName="ManifestResourceWithCulture"/>
</CFResGen>
</Target></Project>
1. 위 코드를 메모장에 붙여 넣는다.
2. 파일 이름을 Netfx11.CSharp.targets로 한다.
3. 이 파일을 C:\Program Files\MSBuild 폴더에 복사해 넣는다.
4. C# 프로젝트 파일(.csproj)을 메모장으로 연다.
5. <import>라고 된 부분을 아래와 같이 변경한다.
<Import Project="$(MSBuildExtensionsPath)\Netfx11.CSharp.targets" />
6. 프로젝트를 VS2005로 연다.
7. 보안 경고창이 뜨면 무시하고 "Load Project Normally(프로젝트를 정상적으로 열기)"를 선택한다.
8. 구성 관리자에 활성화된 빌드가 ".NET 1.1"로 선택되어 있는지 확인한다.
9. 코드에서 System.Collections.Generic 등 .NET 1.1에서 지원하지 않은 부분을 제거한다.
'Tech: > .NET·C#' 카테고리의 다른 글
System.Globalization.KoreanLunisolarCalendar (0) | 2009.06.11 |
---|---|
Visual Studio 2005와 PDA Today 화면 (0) | 2009.06.05 |
주의: 값 형식과 참조 형식 (0) | 2008.10.25 |
SNMP 트랩 메시지 전송 클래스 (1) | 2008.08.21 |
윈도 서비스 확장 클래스: ServiceInstallerEx (0) | 2008.08.14 |