DEV Community

Junissen
Junissen

Posted on

Visual Studio and MSBuild

Visual Studio - development for executing programs and files in code and library assembly mode.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
</Project>
Enter fullscreen mode Exit fullscreen mode

Using the example of the implemented file with the extension .vcxproj, we see the structure that MSBuild will assemble in a certain order.

<ItemGroup>
    <ClCompile Include="AssemblyInfo.cpp" />
    <ClCompile Include="stdafx.cpp">
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
    </ClCompile>
    <ClCompile Include="UnitTest.cpp" />
  </ItemGroup>
Enter fullscreen mode Exit fullscreen mode
  1. Various levels of abstraction, like <ItemGroup>, determine the order in which the compiler is built and configured when running code
  2. Xml structure, .vcxproj.filters, .vcxproj.usernot only reserves space on the hard drive, but also, similar to Docker, allocates a container for the executable file, backing up changes
  3. The scheme involves specifying a specific assembly with a file path on the Microsoft website xmlns="http://schemas.microsoft.com/developer/msbuild/2003

Different mobile operating systems (Android/iOS) have different executable program engines. Likewise, when launching VS, we take into account the environment and typing of our structures.

<ItemGroup>
    <ClInclude Include="stdafx.h">
      <Filter>Header files</Filter>
    </ClInclude>
    <ClInclude Include="resource.h">
      <Filter>Header files</Filter>
    </ClInclude>
    <ClInclude Include="..\..\RootFinder\RootFinder\RootFinder.h">
      <Filter>Header files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="app.rc">
      <Filter>Resource files</Filter>
    </ResourceCompile>
  </ItemGroup>
  <ItemGroup>
    <Image Include="app.ico">
      <Filter>Resource files</Filter>
    </Image>
  </ItemGroup>
Enter fullscreen mode Exit fullscreen mode

We explicitly list the classes of files involved in the assembly and the name with extension. This starts filtering project objects, classified by executable folders.

Top comments (0)