C# • Create a Library Project

Listing 3. The primary differences between an application project and a library project are that a library project sets the value of the TargetType property to Library, while a library project typically does not include an application definition item.

<Project DefaultTargets="Build">
   <PropertyGroup>
      <Property Language="C#" />
      <Property DefaultClrNameSpace=
         "IntroLonghorn" />
      <Property TargetName="MyLibrary" />
      <Property TargetType="Library" />
   </PropertyGroup>

   <Import Project="
      "$(LAPI)\WindowsApplication.target" />

   <ItemGroup>
      <Item Type="Pages" Include="ErrorPage.xaml" />
      <Item Type="Code" 
         Include="ErrorPage.xaml.cs"/>
      <Item Type="Code" Include="Utilities.cs"/>

      <Item Type="DependentProjects" 
         Include="MyDependentAssembly.proj" /> 

      <Item Type="Components" Include=
         "SomeThirdParty.dll" />

      <Item Type="Resources" 
         Include="Picture1.jpg"
      FileStorage="embedded" 
         Localizable="False"/>
      <Item Type="Resources" 
         Include="Picture2.jpg"
         FileStorage="embedded" 
            Localizable="True"/>
   </ItemGroup>
</Project>