Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2012 未为此项目-F设置Outputpath属性#_Visual Studio 2012_F#_Visual Studio 2013 - Fatal编程技术网

Visual studio 2012 未为此项目-F设置Outputpath属性#

Visual studio 2012 未为此项目-F设置Outputpath属性#,visual-studio-2012,f#,visual-studio-2013,Visual Studio 2012,F#,Visual Studio 2013,当我在Visual Studio 2012下创建一个新的F#应用程序并构建它时,会出现相同的错误: 错误1未为项目“TestingF.fsproj”设置OutputPath属性。请检查以确保为此项目指定了有效的配置和平台组合。配置=“调试”平台=“”。如果其他一些项目正试图遵循对此项目的项目到项目引用,此项目已卸载或未包含在解决方案中,并且引用项目未使用相同或等效的配置或平台生成,则也可能出现此错误。C:\Windows\Microsoft.NET\Framework\v4.0.30319\Mi

当我在Visual Studio 2012下创建一个新的F#应用程序并构建它时,会出现相同的错误:

错误1未为项目“TestingF.fsproj”设置OutputPath属性。请检查以确保为此项目指定了有效的配置和平台组合。配置=“调试”平台=“”。如果其他一些项目正试图遵循对此项目的项目到项目引用,此项目已卸载或未包含在解决方案中,并且引用项目未使用相同或等效的配置或平台生成,则也可能出现此错误。C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 592 5 TestingF

尝试使用Configuration Manager修改配置|平台,同时卸载项目并编辑.fsproj文件

<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>
<?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>

真的
满的
假的
假的
bin\Debug\
调试;痕迹
3.
任意CPU
bin\Debug\TestingF.XML
真的

使用任何其他.Net语言都不会出现相同的错误。

请查看错误:

[…]确保为此项目指定了有效的配置和平台组合。配置=“调试”平台=“”。此错误也可能出现[…]

Visual Studio正在尝试构建平台='',配置=''调试'。但是,您发布的项目文件指定了以下配置:

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

. . .
也就是说,它告诉VisualStudio如何构建'Debug'/'AnyCPU',而不是'Debug'/''

如果您在其中插入'AnyCPU',它应该会给出您要查找的结果


在这里可以找到一个更详细的答案:

为了防止其他人遇到这个问题,这里有如何解决它

这个问题与Gustavo在前面的回答中解决的问题类似,但对于F#projects来说,似乎还有另一个问题需要解决。
我在VS2013更新2中遇到了这个问题。在编辑平台设置、在Configuration Manager中添加x64平台后出现问题

问题与.fsproj文件中某些XML标记的顺序有关。请参见下面正确的.fsproj文件

<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>
<?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>

调试
任意CPU
...
真的
真的
满的
...
pdbonly
真的
真的
...
11
有时,在Configuration Manager中编辑配置后,配置平台的一个或多个属性组标记(Debug | x64或Release | x64)在文件中向下移动

因此,只需编辑fsproj文件并向上移动这些标记。例如,将它们移动到定义MinimumVisualStudioVersion的组之前,如示例所示。
保存、重新加载项目并编译。

这是VS2012 RTM还是RC或Beta?如果(给定)它在RTM中工作,那么这可能不值得进一步研究。

为我修复了VS2015更新3中的相同问题。必须是MSBuild或F#工具中的错误或其他错误。