다음을 통해 공유


방법: Windows Presentation Foundation 독립 실행형 탐색 응용 프로그램을 위한 샘플 프로젝트 파일 만들기

업데이트: 2007년 11월

이 예제 프로젝트 파일은 XAML(Extensible Application Markup Language)로 정의된 코드 숨김 페이지 HomePage를 자동으로 열도록 구성된 응용 프로그램 정의(App)가 있는 WPF(Windows Presentation Foundation) 독립 실행형 탐색 응용 프로그램에 사용됩니다. HomePage는 NavigationWindow에서 열립니다. 주요 구성 정보는 다음과 같습니다.

  • OutputType. winexe로 설정합니다.

  • App.xaml. ApplicationDefinition 요소로 구성된 응용 프로그램 정의 파일입니다.

  • HomePage.xaml. Page 요소로 선언된 XAML 파일입니다.

  • HomePage.xaml.cs. Compile 요소로 선언된 코드 숨김 파일입니다.

참조하는 파일이 참조 중인 위치에 있으면 이 프로젝트 파일을 다시 사용하거나 특정 요건에 맞춰 수정할 수 있습니다. 또는 Microsoft Visual Studio 2005에서 Windows 응용 프로그램(WPF) 프로젝트 템플릿을 사용하고 기본 WindowPage로 바꾸어 자동으로 생성된 독립 실행형 탐색 응용 프로그램에 대한 프로젝트 파일을 가질 수 있습니다.

이 프로젝트 파일은 C# 프로젝트용이며 여기에는 Microsoft.CSharp.targets Import 요소가 포함됩니다. Microsoft Visual Studio 2005에서는 C# 프로젝트 파일에 .csproj 확장명을 부여합니다. Microsoft Visual Studio 2005에서 만든 Microsoft Visual Basic .NET에는 일반적으로 .vbproj 확장명이 지정되며 Microsoft.VisualBasic.Targets Import 요소가 포함됩니다.

예제

<Project DefaultTargets="Build" xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <RootNamespace>WPFStandaloneNavigationApplication</RootNamespace>
    <AssemblyName>WPFStandaloneNavigationApplication</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <OutputType>winexe</OutputType>
    <ApplicationVersion>1.0.0.*</ApplicationVersion>
    <BootstrapperEnabled>false</BootstrapperEnabled>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>.\bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <Optimize>true</Optimize>
    <OutputPath>.\bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml" />
    <Page Include="HomePage.xaml" />
    <Compile Include="HomePage.xaml.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
</Project>