MS 프로젝트 파일
MSBuild.exe
VS2017
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
.NET
C:\Windows\Microsoft.NET\Framework\각버전
<Project
ToolsViersion="15.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
프로퍼티 정의
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ProjectGuid>{00000000-0000-0000-0000-000000000000}</ProjectGuid>
<OutputType>Exe,Library</OutputType>
<RootNamespace>루트 이름</RootNamespace>
<AssemblyName>dll 이름</AssemblyName>
<Version>1.0.0</Version>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>v3.5</TargetFrameworkProfile>
<BaseDirectory>.</BaseDirectory>
</PropertyGroup>
특정 조건별 프로퍼티 정의 : 위에 정의된 Configuration 속성에 따라 하위 프로퍼티 정의
<PropertyGroup Condition=" '$(Configuration)' == 'Debug|AnyCPU' " >
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
아이템 정의
<ItemGroup>
참조추가
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
커스텀 dll 참조 추가 : 공개키는 >sn -Tp MyDll.dll 로 확인
<Reference Include="MyDll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>dlls\MyDll.dll</HintPath>
</Reference>
</ItemGroup>
프로젝트에 단순 파일 추가
<ItemGroup>
<None Include="dlls\MyDll.dll" />
</ItemGroup>
컴파일 할목 추가
<ItemGroup>
<Compile Include="src\Example.cs" />
</ItemGroup>
리소스 추가
<ItemGroup>
<EmbeddedResource Include="res\Example.png" />
</ItemGroup>
타겟(task) 및 이벤트 추가
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
빌드 전,후 이벤트
<PropertyGroup>
<PreBuildEvent></PreBuildEvent>
<PostBuildEvent></PostBuildEvent>
</PropertyGroup>
</Porject>