【发布时间】:2020-09-08 16:55:02
【问题描述】:
我在调试/重新编译 C# 项目时收到此错误消息:
没有为项目“Example.csproj”设置 OutputPath 属性。 请检查以确保您指定了有效的组合 该项目的配置和平台。配置='调试' 平台='x86'。如果有其他项目,也可能出现此错误 试图遵循对这个项目的项目到项目的引用,这个 项目已卸载或未包含在解决方案中,并且 引用项目不使用相同或等效的构建 配置或平台。
我不知道项目配置有什么问题:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<ProjectType>local</ProjectType>
<ProjectVersion>7.10.377</ProjectVersion>
<OutputPath>bin\x86\</OutputPath>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E34FF2B3-527D-4006-B312-3D88C491ADBC}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<AssemblyName>Example</AssemblyName>
<OutputType>WinExe</OutputType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
有人有想法吗?提前致谢!
【问题讨论】:
-
也许我错过了这里的重点,但是针对特定 CPU 平台的 C# 项目如何?通常的目标是“任何 CPU”,IIRC。
-
我尝试更改为 AnyCPU 而不是 x86,但没有成功:(
标签: c# visual-studio project csproj