Click here to Skip to main content
15,881,173 members
Articles / Desktop Programming / Win32

MEFify an Applications

Rate me:
Please Sign up or sign in to vote.
4.62/5 (10 votes)
7 Dec 2008CPOL4 min read 46.4K   1.2K   56  
A very simple example of how to make an existing application extendible using MEF
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{EB443EE1-8F59-43EF-BFE1-5D425C4CDD69}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RudiGrobler.Writter</RootNamespace>
    <AssemblyName>RudiGrobler.Writter</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <WarningLevel>4</WarningLevel>
    <ApplicationIcon>writer.ico</ApplicationIcon>
    <TargetFrameworkSubset>Client</TargetFrameworkSubset>
    <PublishUrl>http://localhost/RudiGrobler.Writter/</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Web</InstallFrom>
    <UpdateEnabled>true</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>false</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ApplicationRevision>0</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <IsWebBootstrapper>true</IsWebBootstrapper>
    <UseApplicationTrust>false</UseApplicationTrust>
    <BootstrapperEnabled>true</BootstrapperEnabled>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\</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="PresentationFramework.Classic" />
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.Composition, Version=2008.11.24.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\MEF_Preview_3\bin\System.ComponentModel.Composition.dll</HintPath>
    </Reference>
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
    <Resource Include="Assets\WindowsLive.Writer.ApplicationFramework.Images.HIG.Toolbar.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.AlignCenter.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.AlignLeft.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.AlignRight.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Bold.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Bullets.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Colorize.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Help.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Justify.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Underline.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Undo.png" />
    <Resource Include="Assets\WindowsLive.Writer.PostEditor.BlogThis.ItemTypes.Images.LinkItem.png" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Page Include="Window1.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="Window1.xaml.cs">
      <DependentUpon>Window1.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <None Include="app.config" />
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <AppDesigner Include="Properties\" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="writer.ico" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\RudiGrobler.Writter.Common\RudiGrobler.Writter.Common.csproj">
      <Project>{DE26227D-7335-4692-B4D2-73E3C8FE98A0}</Project>
      <Name>RudiGrobler.Writter.Common</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Numbers.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Italic.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Blockquote.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Cut.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Font.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.InsertLink.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.InsertPicture.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.InsertTable.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Redo.png" />
    <Resource Include="Assets\WindowsLive.Writer.Localization.CommandBitmaps.Strikethrough.png" />
  </ItemGroup>
  <ItemGroup>
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework Client Profile</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
      <Visible>False</Visible>
      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
      <Visible>False</Visible>
      <ProductName>Windows Installer 3.1</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions