Skip to content

Instantly share code, notes, and snippets.

@skarllot
Last active February 3, 2024 23:14
Show Gist options
  • Star 39 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save skarllot/4953ddb6e23d8a6f0816029c4155997a to your computer and use it in GitHub Desktop.
Save skarllot/4953ddb6e23d8a6f0816029c4155997a to your computer and use it in GitHub Desktop.
Build .NET Compact Framework 3.5

Install

Force MSBuild support

  • Copy files and directories from 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\*' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5';
  • Copy files from 'C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\*' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework' directory;
  • Create 'RedistList' directory inside created 'CompactFramework' directory;
  • Create 'FrameworkList.xml' inside 'RedistList' directory and type the following:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\RedistList\FrameworkList.xml

<?xml version="1.0" encoding="utf-8"?>
<FileList  Redist="Net35-CF" Name=".NET Compact Framework 3.5">
</FileList>

Visual Studio 2017/2019 - .NET Standard/Class Library

If do not care to add a dependency to the project to support 'net35-cf' build, configure the project as follows:

project.csproj

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net35-cf</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NETStandard.WindowsCE" Version="1.4.0" />
  </ItemGroup>

Otherwise, if do not want to use any support package. You must to configure the project as follows:

project.csproj

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net35-cf</TargetFrameworks>
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net35-cf'">
    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <TargetFrameworkProfile>CompactFramework</TargetFrameworkProfile>
    <DefineConstants>$(DefineConstants);NET35_CF;WindowsCE</DefineConstants>
    <DisableImplicitFrameworkReferences>True</DisableImplicitFrameworkReferences>
    <NoStdLib>True</NoStdLib>
    <NoConfig>true</NoConfig>
    <FileAlignment>512</FileAlignment>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
    <Optimize>False</Optimize>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'net35-cf'">
    <Reference Include="mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Data, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Runtime.Serialization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Xml, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
  </ItemGroup>

Visual Studio 2015 - Core XPROJ

  • Use 'net35-cf' or '.NETFramework,Version=v3.5,Profile=CompactFramework' TFM.

project.json

{
    "frameworks": {
        "net35-cf": {
            "frameworkAssemblies": {
                "mscorlib": "",
                "System": "",
                "System.Core": ""
            }
        }
    }
}

Visual Studio 2015 - Classic CSPROJ

PropertyGroup

    <NoStdLib>True</NoStdLib>
    <NoConfig>true</NoConfig>
    <FileAlignment>512</FileAlignment>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>

ItemGroup

    <Reference Include="mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
    <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />

Project

  <Import Project="$(SolutionDir)Microsoft.CompactFramework.CSharp.targets" />

Use deprecated MSBuild 3.5

  • Path: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
  • On 'C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.CSharp.targets' file replace '$(MSBuildBinPath)' by 'C:\Windows\Microsoft.NET\Framework\v3.5'.
  • On .CSPROJ file, replace '$(MSBuildBinPath)' by 'C:\Windows\Microsoft.NET\Framework\v3.5'.
@joelharkes
Copy link

Awesome seriously many thanks! 🥇

good to know is that RedistList\FrameworkList.xml
means is that you add this folder and file to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework

Im working on getting it to work in vs2017 now, im not sure what the 'Core' subject means what i'd need to change here.

@ashalkhakov
Copy link

ashalkhakov commented Sep 27, 2017

In a .NET Core csproj file:

  1. replace the TargetFramework property with <TargetFrameworks>netstandard2.0;net35-cf</TargetFrameworks> (where netstandard2.0 stands for whatever was specified in the property)
  2. then add the following conditional elements:
	<PropertyGroup Condition="'$(TargetFramework)' == 'net35-cf'">
                <!-- inference fails for this TFM, so specify it by hand -->
		<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
		<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
		<TargetFrameworkProfile>CompactFramework</TargetFrameworkProfile>
                <!-- define compilation constants by hand too -->
		<DefineConstants>NET35_CF;WindowsCE</DefineConstants>
                <!-- disable implicit references, these are specified by hand, below -->
		<DisableImplicitFrameworkReferences>True</DisableImplicitFrameworkReferences>
	</PropertyGroup>
	<PropertyGroup Condition=" '$(TargetFramework)' == 'net35-cf' ">
		<NoStdLib>True</NoStdLib>
		<NoConfig>true</NoConfig>
		<FileAlignment>512</FileAlignment>
		<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
		<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
	</PropertyGroup>
	<ItemGroup Condition=" '$(TargetFramework)' == 'net35-cf' ">
		<Reference Include="mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
		<Reference Include="System, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
		<Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
	</ItemGroup>

This works for me on VS 2017. The resulting assembly can indeed be deployed to a WinMo6.5 Professional device, yay! I also had to add the following directory to the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v3.5,Profile=CompactFramework following this helpful post

@feO2x
Copy link

feO2x commented Mar 4, 2018

I tried the steps above, but unfortunately I get an error with the AssemblyFileVersionAttribute that is generated for the .NET 3.5 CF assembly:

image

@skarllot, @ashalkhakov, did you face something similar? Have I missed a step? I've done the following:

  • Installed .NET CF 3.5 and Power Toys
  • Replaced '$(MSBuildBinPath)' with 'C:\Windows\Microsoft.NET\Framework\v3.5'
  • Everything described in Use latest MSBuild
  • Added registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v3.5,Profile=CompactFramework
  • Created new project, set target frameworks and added conditional property groups for net35-cf

Everything compiles fine when I remove the net35-cf framework moniker. I'm currently using VS 15.5.7 with msbuild 15.5.180.51428.

@feO2x
Copy link

feO2x commented Mar 5, 2018

In the end, I just had to add the following XML to the second conditional property group for net35-cf:

<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>

Multitargeting worked fine after that and I could succesfully call the resulting DLL in a WinCE Forms application.

@ashalkhakov
Copy link

ashalkhakov commented Mar 15, 2018

@feO2x glad you fixed it! I missed the notification, sorry.

Just came here because I'm trying to build a Docker image for automating CF builds. If we could also use Linux for that (with .NET Core), that would be even better!

EDIT: I'll try it with Rider (on Linux and Windows). If anything of value comes up, will report it here.

@feO2x
Copy link

feO2x commented Mar 16, 2018

@ashalkhakov Sounds great. I also stumbled upon MSBuildSdkExtras which adds a lot more TFMs that can be used as target frameworks. I've added an issue for supporting NET-CF 3.5 as well, based on this gist.

@ashalkhakov
Copy link

I came up with the following solution.

This at least saves you the trouble of manually installing deps off MS website. We push this build env image to our Docker Registry, and the use it for running CF-specific builds as usual. Maybe we can also tackle the second approach (compiling with modern MSBuild), that's just a few steps away.

@joelharkes
Copy link

joelharkes commented Oct 2, 2018

Copying:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\*
to 
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5

actually broke it, i had to clear the whole folder and copy paste a copy from someone else back in there to make my normal net35 builds work again.

problem <TargetFrameworks>net35</TargetFrameworks> no longer builds if you this above.

Is there any way around this problem?

@joelharkes
Copy link

joelharkes commented Oct 2, 2018

Got it to work without copying step see above.

but i had to hard set reference to dll's because they are now not found, like such:

    <Reference Include="System.Windows.Forms">
    <HintPath>C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll</HintPath>
    </Reference>

i tried setting AssemblySearchPaths but that wouldnt work somehow:

 <AssemblySearchPaths>$(AssemblySearchPaths);{GAC};C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\</AssemblySearchPaths> 

i can build now:

<TargetFrameworks>net35;net35-cf;net452</TargetFrameworks>

@joelharkes
Copy link

Finally got it to work with:

<AssemblySearchPaths>$(AssemblySearchPaths);C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE;</AssemblySearchPaths>

instead of the hint paths.

@joelharkes
Copy link

Here simple bat file (run as admin)

@echo off
::@setlocal enableextensions enabledelayedexpansion
pushd "%~dp0"

if not exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\" (
  mkdir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\"
)
::this actualy breaks net35 builds so we disable this!
::xcopy "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\*" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\"
if not exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\" (
  mkdir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\"
)

if not exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\" (
  mkdir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\"
)
xcopy "C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\*" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\" /S /Y

if not exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\RedistList\" (
  mkdir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\RedistList\"
)

if not exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\RedistList\FrameworkList.xml" (
  ( 
    echo ^<?xml version="1.0" encoding="utf-8"?^>
    echo ^<FileList Redist="Net35-CF" Name=".NET Compact Framework 3.5"^>
    echo ^</FileList^>
  )  > "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework\RedistList\FrameworkList.xml"
)
popd

@easysoft2k15
Copy link

Hello,
using the instructions reported I was able to compile a simple project with a win form and make it run in a Windows Compact 7 Device.
Is there a way to have designer support for Windows Form using Visual Studio 2017?
When I try to open the form with the designer I get an Exception:

Value cannot be null. Parameter name: instance

I'm using this .csproj:

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup> <TargetFrameworks>net35-cf</TargetFrameworks> <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute> <ApplicationIcon /> <OutputType>WinExe</OutputType> <StartupObject /> </PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net35-cf'"> <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkProfile>CompactFramework</TargetFrameworkProfile> <DefineConstants>$(DefineConstants);NET35_CF;WindowsCE</DefineConstants> <DisableImplicitFrameworkReferences>True</DisableImplicitFrameworkReferences> <NoStdLib>True</NoStdLib> <NoConfig>true</NoConfig> <FileAlignment>512</FileAlignment> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID> <Optimize>False</Optimize> </PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35-cf'"> <Reference Include="mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Data, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Runtime.Serialization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Xml, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" /> <Reference Include="System.Windows.Forms"> <HintPath>C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll</HintPath> </Reference> <Reference Include="System.Drawing"> <HintPath>C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Drawing.dll</HintPath> </Reference> </ItemGroup>

<ItemGroup> <Compile Update="Form1.cs"> <SubType>Form</SubType> </Compile> <Compile Update="Form1.Designer.cs"> <DependentUpon>Form1.cs</DependentUpon> </Compile> </ItemGroup> </Project>

@skarllot
Copy link
Author

skarllot commented Jun 20, 2019

@easysoft2k15 I've never achieved designer support on VS.

This can change in future with VS2019, because it supports Windows Forms on Core project.

Ref: https://docs.microsoft.com/en-us/dotnet/core/porting/winforms

@easysoft2k15
Copy link

@skarllot Thank You for Your feedback.
I'll give it i try and if come up with something I'll report it here.

@pentestdude
Copy link

Is this supposed to work on VS2019 as well?

@skarllot
Copy link
Author

@pentestdude Yes, it is

@dittodhole
Copy link

Finally got it to work with:

<AssemblySearchPaths>$(AssemblySearchPaths);C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE;</AssemblySearchPaths>

instead of the hint paths.

this one is genious!

applied it, like:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net35-cf</TargetFrameworks>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
  </PropertyGroup>
  <PropertyGroup Condition="'$(TargetFramework)' == 'net35-cf'">
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <TargetFrameworkProfile>CompactFramework</TargetFrameworkProfile>
    <DefineConstants>$(DefineConstants);NET35_CF;WindowsCE</DefineConstants>
    <NoStdLib>True</NoStdLib>
    <NoConfig>true</NoConfig>
    <FileAlignment>512</FileAlignment>
    <PlatformID>E2BECB1F-8C8C-41BA-B736-9BE7D946A398</PlatformID>
    <Optimize>False</Optimize>
    <AssemblySearchPaths>$(AssemblySearchPaths);C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE;</AssemblySearchPaths>
  </PropertyGroup>
  <ItemGroup Condition="'$(TargetFramework)' == 'net35-cf'">
    <Reference Include="mscorlib" />
    <Reference Include="System.Core" />
  </ItemGroup>
...

works like charm, thanks a lot! <3

@HaronDDC
Copy link

HaronDDC commented Jun 4, 2021

Hi! It is amazing article. Thanks a lot for your work. Couldn't you know any way to debug Compact framework applications using VS 2019? Thanks a lot!

@skarllot
Copy link
Author

skarllot commented Jun 4, 2021

@HaronDDC unfortunately not

@scottpidzarko
Copy link

scottpidzarko commented Aug 23, 2022

Thanks for the amazing article. I have successfully built a dll from a project I used to have to work on in Visual Studio 2008.

I am having some difficulty getting my compiled dll to get apparently get built with the same toolchain as in Visual studio 2008. My embedded device requires that the dlls used be signed and valid in a "Sandbox" - and System.Threading.Interlocked isn't allowed. Building the project with Visual Studio 2008 produces different output when viewed with DnSpy:

The problem is with multicast delegates, ie: this.RecoverNotificationEvent += new DelegateNoParametersEvent(this.RecoverNotificationEventHandler);

2008 happily outputs this, which is a-OK:

// Token: 0x0600005E RID: 94 RVA: 0x000025B8 File Offset: 0x000007B8
[MethodImpl(MethodImplOptions.Synchronized)]
internal void add_RecoverNotificationEvent(DelegateNoParametersEvent value)
{
    this.RecoverNotificationEvent = (DelegateNoParametersEvent)Delegate.Combine(this.RecoverNotificationEvent, value);
}

Whereas vs2019 does this to the compiled output, which utilizes Interlocked which is not sandbox compatible:

// Token: 0x0600016F RID: 367 RVA: 0x0000325C File Offset: 0x0000145C
[CompilerGenerated]
internal void add_RecoverNotificationEvent(DelegateNoParametersEvent value)
{
    DelegateNoParametersEvent delegateNoParametersEvent = this.RecoverNotificationEvent;
    DelegateNoParametersEvent delegateNoParametersEvent2;
    do
    {
        delegateNoParametersEvent2 = delegateNoParametersEvent;
        DelegateNoParametersEvent delegateNoParametersEvent3 = (DelegateNoParametersEvent)Delegate.Combine(delegateNoParametersEvent2, value);
        delegateNoParametersEvent = Interlocked.CompareExchange<DelegateNoParametersEvent>(ref this.RecoverNotificationEvent, delegateNoParametersEvent3, delegateNoParametersEvent2);
    }
    while (delegateNoParametersEvent != delegateNoParametersEvent2);
}

My .csproj:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFrameworks>net35-cf</TargetFrameworks>		
		<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
		<GenerateDocumentationFile>true</GenerateDocumentationFile>
		<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>		
		<!-- allow ourselves to use AssemblyInfo in .net sdk projects -->
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<!-- this is needed for the wildcard in the build nubmer -->
		<Deterministic>false</Deterministic>
	</PropertyGroup>	
	<PropertyGroup Condition="'$(TargetFramework)' == 'net35-cf'">
		<!-- stop XML files from being generated -->		
		<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
		<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
		<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
		<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
		<TargetFrameworkProfile>CompactFramework</TargetFrameworkProfile>
		<DefineConstants>$(DefineConstants);NET35_CF;WindowsCE</DefineConstants>
		<NoStdLib>True</NoStdLib>
		<NoConfig>true</NoConfig>
		<FileAlignment>512</FileAlignment>
		<PlatformID>E2BECB1F-8C8C-41BA-B736-9BE7D946A398</PlatformID>
		<Optimize>False</Optimize>
		<AssemblySearchPaths>$(AssemblySearchPaths);C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE;</AssemblySearchPaths>
	</PropertyGroup>

	<ItemGroup Condition="'$(TargetFramework)' == 'net35-cf'">
		<Reference Include="mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />		
		<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
			<SpecificVersion>False</SpecificVersion>
			<HintPath>C:\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
		</Reference>
		<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
			<SpecificVersion>False</SpecificVersion>
			<HintPath>C:\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
		</Reference>
		<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
			<SpecificVersion>False</SpecificVersion>
			<HintPath>C:\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
		</Reference>
		<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
			<SpecificVersion>False</SpecificVersion>
			<HintPath>C:\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
		</Reference>
		<Reference Include="System, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
		<Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
		<Reference Include="System.Data, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac" />
	</ItemGroup>
	<!-- uncommenting this makes it angry about outputpaths. Adding an outputpath tag makes it angry about a target in obj which I can't work around-->
	<!-- <Import Project="C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.CSharp.targets" /> -->
</Project>

Any pointers/comments? I've been trying different methods throughout the last couple of days and I can't seem to get over this hurdle any way I go about it. I know what I'm hoping to do can be done, as someone I know in the same industry has no problem using Jetbrains Rider to specify the version of MSBuild and point at the CompactFrameWork.CSharp.targets file and get what he needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment