Visual studio Msbuild:错误:未为此项目设置OutputPath属性

Visual studio Msbuild:错误:未为此项目设置OutputPath属性,visual-studio,msbuild,Visual Studio,Msbuild,我目前正在尝试解耦一个项目,我得到以下错误 未为项目“MyProj.vcxpro j”设置OutputPath属性。 请检查以确保指定了有效的组合 本项目的配置和平台。配置=“” 平台='x64'。您可能看到此消息,因为您是 正在尝试在没有解决方案文件的情况下生成项目,并且已指定 此应用程序不存在的非默认配置或平台 项目[D:\Test\MyProj.vcxproj] 我把这个添加到我的项目中,但没有帮助 <PropertyGroup Label="Globals"

我目前正在尝试解耦一个项目,我得到以下错误

未为项目“MyProj.vcxpro j”设置OutputPath属性。 请检查以确保指定了有效的组合 本项目的配置和平台。配置=“” 平台='x64'。您可能看到此消息,因为您是 正在尝试在没有解决方案文件的情况下生成项目,并且已指定 此应用程序不存在的非默认配置或平台 项目[D:\Test\MyProj.vcxproj]

我把这个添加到我的项目中,但没有帮助

  <PropertyGroup Label="Globals">
    <Platform Condition="'$(Platform)' == ''">x64</Platform>
    <TargetName>MyProj</TargetName>
    <ResolveExportedSymbols>true</ResolveExportedSymbols>
    <ProjectGuid>{xxxxx-xxxx-xxxx-xxx}</ProjectGuid>
    <UsePrecompiledHeader>true</UsePrecompiledHeader>
    <OutputPath>D:\MyOutput\out\</OutputPath>
  </PropertyGroup> 

x64
MyProj
真的
{xxxxx-xxxx-xxxx-xxx}
真的
D:\MyOutput\out\
有什么建议吗?

请使用:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

         <ItemGroup Label="ProjectConfigurations">
            <ProjectConfiguration Include="Debug|x64">
              <Configuration>Debug</Configuration>
              <Platform Condition="'$(Platform)' == ''">x64</Platform>
            </ProjectConfiguration>
        </ItemGroup>
        
         <PropertyGroup Label="Globals">
            <TargetName>MyProj</TargetName>
            <ResolveExportedSymbols>true</ResolveExportedSymbols>
            <ProjectGuid>{xxxxx-xxxx-xxxx-xxx}</ProjectGuid>            
            <OutputPath>D:\MyOutput\out\</OutputPath>
          </PropertyGroup>
 
        <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
       <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
         <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
      </ImportGroup>


        <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
        <ClCompile>
          <PrecompiledHeader>Use</PrecompiledHeader>
          <WarningLevel>Level3</WarningLevel>
          <SDLCheck>true</SDLCheck>
          <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 
          </PreprocessorDefinitions>
          <ConformanceMode>true</ConformanceMode>
          .....
        </ClCompile>
      </ItemDefinitionGroup>

.....
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

调试
x64
MyProj
真的
{xxxxx-xxxx-xxxx-xxx}
D:\MyOutput\out\
使用
三级系统
真的
_调试_控制台;%(预定义)
真的
.....
.....

然后,删除任何输出文件夹,如
调试
,然后再次重建。

有关于此问题的更新吗?还有一个问题,您是否使用vs的开发者命令提示符来构建项目?我有一个类似的问题,但我的问题是因为我无法让vs将VS2019的活动解决方案平台设置为x64。然后,我手动编辑了项目文件,但猜测应该有什么。看来,必须有远远超过一个可能天真地认为是最低限度的要求。我复制了之前使用VS2017创建的另一个项目的有效内容,并为我解决了问题。有人知道哪些文件可以找到吗?