Intellisense for MSBuild Community Tasks doesn'

2019-03-26 04:44发布

问题:

I'm using VS 2010 RC1. I download MSBuild Community Tasks (MCT) and install it. (To give full information, I have also installed MSBuild Extension Pack)

Then, in order to have Intellisense work for MCT 's tasks, I copied the file C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.xsd to C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\1033\MSBuild\MSBuild.Community.Tasks.xsd

I start VS and create a project (build) file as below:

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

As starting to type a Target, I have no Intellisense there.

I try to open the property pane, click the schema browsing button, add the file C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.xsd but Intellisense still not work! Removing this shcema, the Intellisense returns to work and of course, just works for other tasks but MCT tasks.

Does anyone have met the same problem like me? Please help!

回答1:

You need to add the following line to C:\program files\Microsoft Visual Studio 10.0\Xml\Schemas\1033\Microsoft.Build.xsd

<xs:include schemaLocation="MSBuild\MSBuild.Community.Tasks.xsd"/>

It should be put at the end of the file, before the </xs:schema>



回答2:

I am using VS2008 and I manually copied the MSBuild Community Tasks schema file (.xsd) into the proper Visual Studio directory. However that wasn't enough for my community tasks to register with Intellisense.

I had to open the .csproj file within Visual Studio and then go to the 'XML' menu and select 'Schemas...'. The MSBuild Community Schema file was not on the list anywhere, so I clicked 'Add' and then added the file. Once I did that and closed the dialog, viola! I had intellisense for the community tasks.

I was inspired by this posting on MDSN



回答3:

I had the same issue when I first started using VS 2010 RC1. I re-installed and it worked for a bit and stopped.

I have since downloaded and installed the trial version of VS 2010 Pro Download Here

I have not had any issues since.