This project has moved and is read-only. For the latest updates, please go here.

Cannot edit namespace summaries due to import in msbuild/project file.

Topics: User Forum
May 24, 2012 at 8:34 PM
Edited May 24, 2012 at 8:35 PM

I have an SHFB project which builds just fine and which worked without issue in the prior standalone version.

In the project/msbuild file, I have imported the MSBuildCommunityTasks, which I use to do some file zipping in the AfterBuildHelp target.  The task library is imported using:

<Project DefaultTargets="Build" xmlns="" ToolsVersion="4.0">
  <Import Project=".\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

However, when I go to edit the namespace summaries I receive an error:

Unable to build project to obtain API information.  Error: The imported project "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\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.

I tried changing the import to:

<Project DefaultTargets="Build" xmlns="" ToolsVersion="4.0">
  <Import Project="$(MSBuildProjectDirectory)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

But that did not correct the issue.  If I comment out the import, I can edit the namespace summaries just fine.

May 30, 2012 at 8:33 PM

It's possible the variable isn't defined for some reason.  You could probably add it to the project with a condition statement that lets it get defined to a default location that will work if it is undefined.  See the UserDefinedProperties help section in the Build Category Properties help topic for more information.