본문 바로가기

프로그래밍/C,C++

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>






'프로그래밍 > C,C++' 카테고리의 다른 글

[C#] 완전 이진트리 1차원배열  (0) 2018.11.22
[Mono] Embedding Mono  (0) 2018.10.03
Boost 라이브러리 빌드  (0) 2018.08.28
[Win API] Console project  (0) 2017.12.06
[C++] 시스템 클럭 밀리세컨드 얻기  (0) 2017.12.06
Kinect sdk 이미지 얻기  (0) 2017.10.26
C# OLEDB 엑셀 읽기  (0) 2016.02.21
[C#] 파일 읽고,쓰기 기초  (0) 2013.09.12
[C#] 이미지 처리 기본 사항들  (0) 2013.09.12
[C#] 이벤트  (0) 2013.09.12