none
Add mpf 11 project to a Portable Class Library as reference RRS feed

  • Question

  • Hello,

    I need to be able to add my custom mpf project for VS2012 to the references of a Portable Class Library.

    If add the reference using the browse window, no problem it is working: it adds the dll.

    But if I choose to add the reference from the solution projects, the mpf project is rejected and throws "unable to add the reference".

    The TargetFrameworkVersion and Profile are matched, so I think the problem comes from ProjectTypeGuids or a property page not able to display the Portable Class Library extension. But I don't know how to moke/fake a Portable Class Library project in mpf 11.

    Thanks in advance for your help.

    Tuesday, March 26, 2013 1:48 PM

All replies

  • Hi Alphapage,

    I can't learn your issue well. I guess you want to import the the MPF project sources into a portable class library project, right? Did any error occur? Please show us more information about what you met.

    Please post some detail steps to reproduce this issue which can help us to solve it.

    We can learn more information about MPF project from:
    http://mpfproj11.codeplex.com/

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 28, 2013 5:58 AM
    Moderator
  • Hi Ego,

    From the CustomProject.csproj in Samples folder, the fastest way to reproduce my problem is to add a Profile, import the Portable Class Library target and remove the references in MyCustomProject.myproj in Templates\Projects folder. After your customproject1 being created during Debug, add a new Portable Class Library project portableclasslibrary1, then try to add a reference to customproject1: it will throw "unable to add the reference".

    Here is my sample MyCustomProject.myproj file:

    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>6CAFC0C6-A428-4d30-A9F9-700E829FEA51</ProjectGuid>
        <OutputType>Library</OutputType>
        <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
        <TargetFrameworkProfile>Profile1</TargetFrameworkProfile>
        <RootNamespace>MyApplication</RootNamespace>
        <AssemblyName>MyApplication</AssemblyName>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\Debug\</OutputPath>
        <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\Release\</OutputPath>
        <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
      </PropertyGroup>
      <ItemGroup>
        <!--<Reference Include="mscorlib" />
        <Reference Include="System" />
        <Reference Include="System.Core" />
        <Reference Include="System.Data" />
        <Reference Include="System.Data.DataSetExtensions" />
        <Reference Include="System.Xml" />
        <Reference Include="System.Xml.Linq" />-->
      </ItemGroup>
      <ItemGroup>
        <Compile Include="AssemblyInfo.cs">
          <SubType>Code</SubType>
        </Compile>
        <!--<Compile Include="Program.cs">
          <SubType>Code</SubType>
        </Compile>-->
      </ItemGroup>
      <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
    
    </Project>


    • Edited by Alphapage Thursday, March 28, 2013 9:37 AM
    Thursday, March 28, 2013 9:36 AM
  • Portable Class Library project is the only one where a custom project can't be referenced. Even a WindowsStore project can reference a custom project type.

    Thursday, March 28, 2013 2:54 PM
  • Hi,

    I can't find some error from your project file. If we copy all the dll you needed to the folder, can solve this issue?

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 3, 2013 8:06 AM
    Moderator
  • My project file is tweaked to check my problem, so it compiles.

    The problem occurs when I want to add my custom project as reference in a Portable Class Library. It fails and I don't know how to tweak my project to made it working.

    As I previously told, if I add the library from browse window, the dll is referenced and works like a charm. I want to do the same but with a referenced project.

    Wednesday, April 3, 2013 5:14 PM