Is it possible to set the MSBuild Platform property (x64 OS)

Topics: User Forum
Jan 4, 2012 at 8:33 AM

When I try and build a documentation project using the sandcastle help file builder GUI, I get this error.


 SHFB: Error BE0065: BUILD FAILED: The imported project "C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.CompactFramework.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  [project name].csproj

Since I am using a x64 OS, is it possible to set the MSBuild platform property so that it uses the correct version of MSBuild?


The targets file actually exists here: C:\Windows\Microsoft.NET\Framework\v3.5





Jan 4, 2012 at 7:34 PM

As long as the configuration and platform values exist in the SHFB project, you can pick them from the combo boxes in the toolbar.  If not there, you can open the project in a text editor and add them by cloning an existing PropertyGroup element and altering the values to match what you need.

It looks like it's complaining about a Compact Framework project.  If you are using a Visual Studio solution file as the documentation source, you can try adding the individual projects excluding the failing one as documentation sources.  If your intent is to document the failing project as well, that may be an issue.  It's quite possible, SHFB may need some modifications in order to properly use the compact framework project file and its references since it's not the usual set of .NET Framework assemblies.  However, I know in the past people have used it with Compact Framework assemblies by adding the assemblies, XML comments files, and references to the project instead.  There's a FAQ entry on adding references for the Compact Framework so you might check that out too.



Jan 9, 2012 at 10:59 AM

Thanks for the comments Eric, I think the issue is to do with the version of MSBuild that is being used to build the project. I have managed to get it working using a Visual Studio project (my devenv is 32 bit, but I'm running on an x64 OS.)

If I use the SHFB project I get the previously mentioned error. The platform property for MSBuild is different than the platform property in a project. The MSBuild platform property can be specified in a TFS build definition.

I'm thinking that because the Microsoft.CompactFramework.CSharp.targets is only installed here C:\Windows\Microsoft.NET\Framework\v3.5, rather than C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.CompactFramework.CSharp.targets, I need to do a little digging to find out what the TFS build definition does, whether it is a paramter that I can pass to MSBuild, or if it is simply launching a different flavour of MS build. (32bit/64bit)

I've ruled out copying files from one folder to another as it's a surefire way of getting my development machine into a mess.

I'll post back my findings.