Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

マークアップだけでHelloWorld(続編)

ウィンドウ定義を独立したファイルに移動します。

App.xaml

<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    StartupUri="MyWindow.xaml"
/>

MyWindow.xaml

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <TextBlock>Hello World</TextBlock>
</Window>

HelloWorld.csproj

<Project
    DefaultTargets="Build"
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <PropertyGroup>
        <Configuration>Debug</Configuration>
        <Platform>AnyCPU</Platform>
        <RootNamespace>HelloWorld</RootNamespace>
        <AssemblyName>HelloWorld</AssemblyName>
        <OutputType>WinExe</OutputType>
        <OutputPath>.\bin\Debug\</OutputPath>
    </PropertyGroup>

    <ItemGroup>
        <Reference Include="System" />
        <Reference Include="WindowsBase" />
        <Reference Include="PresentationCore" />
        <Reference Include="PresentationFramework" />
    </ItemGroup>
    
    <ItemGroup>
        <Page Include="MyWindow.xaml" />
        <ApplicationDefinition Include="App.xaml" />
    </ItemGroup>

    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
</Project>

ビルド


ビルドログ

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

2010/11/11 13:54:35 にビルドを開始しました。
ノード 1 上のプロジェクト "D:\@Sandbox\HelloWorld\HelloWorld.csproj" (既定のターゲット)。
PrepareForBuild:
  ディレクトリ ".\bin\Debug\" を作成しています。
  md ".\bin\Debug\"
  ディレクトリ "obj\Debug\" を作成しています。
  md "obj\Debug\"
CoreCompile:
  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll" /debug+ /debug:pdbonly /out:obj\Debug\HelloWorld.exe /resource:obj\Debug\HelloWorld.g.resources /target:winexe "D:\@Sandbox\HelloWorld\obj\Debug\App.g.cs"
CopyFilesToOutputDirectory:
  "obj\Debug\HelloWorld.exe" から ".\bin\Debug\HelloWorld.exe" へファイルをコピーしています。
  copy /y "obj\Debug\HelloWorld.exe" ".\bin\Debug\HelloWorld.exe"
  HelloWorld -> D:\@Sandbox\HelloWorld\bin\Debug\HelloWorld.exe
  "obj\Debug\HelloWorld.pdb" から ".\bin\Debug\HelloWorld.pdb" へファイルをコピーしています。
  copy /y "obj\Debug\HelloWorld.pdb" ".\bin\Debug\HelloWorld.pdb"
プロジェクト "D:\@Sandbox\HelloWorld\HelloWorld.csproj" (既定のターゲット) のビルドが完了しました。

ビルドに成功しました。
    0 個の警告
    0 エラー

経過時間 00:00:00.90

アプリ実行