COMPILING (OR BUILDING)

For the compilation of our program you need to have all the "requirements" you can find here.

And you need to create, at the same folder (Ba1) of the files of the program, the file Ba1.csproj having the tags:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <PropertyGroup>
  <AssemblyName>Ba1</AssemblyName>
  <DefaultClrNameSpace>DMU</DefaultClrNameSpace>
  <TargetType>winexe</TargetType>
  <OutputPath>C:\Ba1</OutputPath>
  </PropertyGroup>
	 
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
  <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets"/>

  <ItemGroup>
   <ApplicationDefinition Include="MyApp.xaml"/>
   <Page Include="Window1.xaml"/>

   <Compile Include="Window1.xaml.cs">
    <DependentUpon>Window1.xaml</DependentUpon>
    <SubType>Code</SubType>
   </Compile> 

   <Compile Include="MyApp.xaml.cs">
    <DependentUpon>MyApp.xaml</DependentUpon>
    <SubType>Code</SubType>
   </Compile>
  
  
   <Reference Include="System"/>
   <Reference Include="System.Xml"/>
   <Reference Include="System.Data"/>
   <Reference Include="WindowsBase"/>
   <Reference Include="PresentationCore"/>
   <Reference Include="PresentationFramework"/>
   <Reference Include="UIAutomationProvider"/>
   <Reference Include="UIAutomationTypes"/>
  </ItemGroup>
 
</Project>

The meaning of these tags are very easy to understand.

AssemblyName will have the name of the compiled executable .EXE file.

OutputPath will have the local of the compiled executable file.

We need to choose a type of TargetType: the winexe will be for an executable, library will be for a .DLL file - we will see the creation of libraries soon.

The group of Reference Include presents the names (without .DLL) of the libraries of the namespaces we are using (PresentationCore.dll, by example).

Having this .CSPROJ created for our program/application, you need to open the Visual C# Express and select File | Open Project and to load this file.


Clicking the name of the file at the "Solution Explorer" you have it for corrections, modifications etc.

TIP: You can use the files of this project like a template for any other application you need to create. You can't access the .CSPROJ inside the Visual C# Express.

To compile/build your program/application/project click the green arrow.

If you don't have any error, the program will be compiled and will run:

All the new (many!!!) files (Ba1.exe and some others) will be created at that folder:

But we would like to put our applications (games in the future) available at the internet. How to do this?

Next lesson, please...


PREVIOUS LESSON NEXT LESSON
T.CONTENTS HOMEPAGE