2016-12-14 104 views
0

我是C#的新手,我试图打开一个解决方案文件并得到一个错误,因为没有找到”MSBuild.Community.Tasks.Targets“,有谁可以请告诉。我该怎么解决这个错误我检查了各种解决方案无法获得这一个固定MSBuild.Community.Tasks.Targets“找不到

下面是错误

C:\Users\xxxxx\Desktop\HardwareDriver_R3\HardwareDriver_R3\HardwareDriver_R3\HardwareDrivers\HardwareDrivers.csproj : error : The imported project "C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\Users\xxxxx\Desktop\HardwareDriver_R3\HardwareDriver_R3\HardwareDriver_R3\HardwareDrivers\BTCommon.targets 

下面是.csproj的内容:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProjectGuid>{89347491-E1C1-4604-AD3F-6EDB150A121F}</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>HardwareDrivers</RootNamespace> 
    <AssemblyName>HardwareDrivers</AssemblyName> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    <PlatformTarget>x86</PlatformTarget> 
    <DocumentationFile>bin\Debug\HardwareDrivers.XML</DocumentationFile> 
    <NoWarn>1591</NoWarn> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="ConfigurationReader, Version=0.1.0.0, Culture=neutral, processorArchitecture=x86"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\ConfigurationReader.dll</HintPath> 
    </Reference> 
    <Reference Include="NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=MSIL"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\NationalInstruments.Common.dll</HintPath> 
    </Reference> 
    <Reference Include="NationalInstruments.DAQmx, Version=9.9.40.39, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=x86"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\NationalInstruments.DAQmx.dll</HintPath> 
    </Reference> 
    <Reference Include="OptoMMP2"> 
     <HintPath>lib\OptoMMP2.dll</HintPath> 
    </Reference> 
    <Reference Include="System" /> 
    <Reference Include="System.configuration" /> 
    <Reference Include="System.Core" /> 
    <Reference Include="System.Windows.Forms" /> 
    <Reference Include="System.Xml.Linq" /> 
    <Reference Include="System.Data.DataSetExtensions" /> 
    <Reference Include="Microsoft.CSharp" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Xml" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="Counters\CountersFactory.cs" /> 
    <Compile Include="Counters\CountersInterface.cs" /> 
    <Compile Include="Counters\NICounters\NICounters.cs" /> 
    <Compile Include="DigitalIO\DigitalIOBase.cs" /> 
    <Compile Include="DigitalIO\DigitalIOFactory.cs" /> 
    <Compile Include="DigitalIO\IDigitalIO.cs" /> 
    <Compile Include="DigitalIO\IDigitalIOBase.cs" /> 
    <Compile Include="DigitalIO\NIDigitalBase.cs" /> 
    <Compile Include="DigitalIO\NIDigitalIO.cs" /> 
    <Compile Include="DigitalIO\Opto22DigitalBase.cs" /> 
    <Compile Include="DigitalIO\Opto22DigitalIO.cs" /> 
    <Compile Include="Ethernet\EventArgs.cs" /> 
    <Compile Include="Ethernet\IEthernetClient.cs" /> 
    <Compile Include="Ethernet\IEthernetComm.cs" /> 
    <Compile Include="Ethernet\IEthernetServer.cs" /> 
    <Compile Include="Ethernet\VASTEthernetClient.cs" /> 
    <Compile Include="Ethernet\VASTEthernetServer.cs" /> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    <Compile Include="Serial\AP4600SerialInterface.cs" /> 
    <Compile Include="Serial\DotNetSerial.cs"> 
     <SubType>Component</SubType> 
    </Compile> 
    <Compile Include="Serial\ISerial.cs" /> 
    <Compile Include="Serial\SerialFactory.cs" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Content Include="AnalogIO\placeholder.txt" /> 
    </ItemGroup> 
    <ItemGroup /> 
    <Import Project="BTCommon.targets" Condition="Exists('BTCommon.targets')" /> 
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="!Exists('BTCommon.targets')" /> 
    <PropertyGroup> 
    <PostBuildEvent> 
    </PostBuildEvent> 
    </PropertyGroup> 
    <PropertyGroup> 
    <PreBuildEvent>copy "$(SolutionDir)HardwareDrivers\lib\ConfigurationReader.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.Native.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.xml" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.DAQmx.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.MStudioCLM.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.NiLmClientDLL.dll" "$(SolutionDir)HardwareDrivers\bin\Debug"</PreBuildEvent> 
    </PropertyGroup> 
    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
     Other similar extension points exist, see Microsoft.Common.targets. 
    <Target Name="BeforeBuild"> 
    </Target> 
    <Target Name="AfterBuild"> 
    </Target> 
    --> 
</Project> 
+0

你是否已经安装了这个:https://github.com/loresoft/msbuildtasks –

+0

是的,我没有下载这个。但不知道打开sln文件时会出现很多错误。也不确定在 – NewLearner

+0

后需要做什么,你应该与你的团队或项目作者谈谈 –

回答

0
  1. 步骤1:卸载这是给错误
  2. 步骤2中的项目:重建溶液用于恢复包
  3. 步骤3:清洁溶液
  4. 步骤4:再次重建和问题将会解决。