5

When I create a new F# Application under Visual Studio 2012 and build it, the same error occur:

Error 1 The OutputPath property is not set for project 'TestingF.fsproj'. Pleasecheck to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform=''. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 592 5 TestingF

Tried to modify the Configuration|Platform using Configuration Manager and also unload the project and edit the .fsproj file.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\Debug\TestingF.XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

The same error never occurred using any other .Net Language.

2
  • Is this VS2012 RTM or RC or Beta?
    – ildjarn
    Aug 24, 2012 at 17:52
  • If (given) it works in RTM, then this probably isn't worth looking into further. ;-]
    – ildjarn
    Aug 24, 2012 at 18:18

2 Answers 2

5

Just in case someone else experiences this problem, here's how to fix it.

The issue is similar to the one solved by Gustavo in the previous answer, but for F# projects it seems that there is another additional issue you have to workaround.
I've had this problem in VS2013 Update 2. The problem appeared after editing the Platform settings, adding a x64 platform in Configuration Manager.

The problem is related to the order of some of the XML tags in the .fsproj file. See below a correct .fsproj file.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" ...>
  <Import Project=.../>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    ...
    <RestorePackages>true</RestorePackages>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    ...
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <Tailcalls>true</Tailcalls>
    ...
  </PropertyGroup>
  <PropertyGroup>
    <MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
  </PropertyGroup>

What happens is that sometimes, after editing the configurations in Configuration Manager, one or more of the PropertyGroup tags that configure the platform (Debug|x64 or Release|x64) have been moved downwards in the file.

So, just edit the fsproj file and move these tags upwards. For example, move them to just before the group that defines the MinimumVisualStudioVersion, as in the example. Save, reload the project and compile.

1
  • 1
    Fixes the same problem in VS2015 Update 3 for me. Must be a bug in MSBuild or the F# tooling or something. Aug 2, 2016 at 3:54
1

Take a look at the error:

[...] make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform=''. This error may also appear [...]

Visual Studio is trying to build Platform='', Configuration='Debug'. The project file you posted, however, specifies the following configuration:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    . . .
</PropertyGroup>

That is, it tells Visual Studio how to build 'Debug'/'AnyCPU', but not 'Debug'/' '.

If you insert 'AnyCPU' in there, it should give you the results you're looking for.

A more elaborate answer can be found here: https://stackoverflow.com/a/13372073/556595

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.