Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHFB: Error BE0065: BUILD FAILED: #73

Closed
DanielaGran opened this issue Apr 21, 2015 · 11 comments
Closed

SHFB: Error BE0065: BUILD FAILED: #73

DanielaGran opened this issue Apr 21, 2015 · 11 comments

Comments

@DanielaGran
Copy link

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"

I just installed SHFB today and I am stuck on this error. Did I miss installing a tool or setting dependencies? I am working with a VS 2013 project and SHFB correctly recognized this.

@EWSoftware
Copy link
Owner

The error message doesn't look complete. There should be more after the targets filename stating what the problem is. More likely than not it couldn't be found. Does the named file exist on the system on which you are doing the build? It may not be evaluating the import correctly.

@DanielaGran
Copy link
Author

This is the complete log from the build job:
SHFB: Error BE0065: BUILD FAILED: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Users\dandruszkiewicz\Documents\Visual Studio 2013\Projects\Metalogix.ContentAnalysis\Metalogix.ContentAnalysis\Metalogix.ContentAnalysis.FileSubmitService\Metalogix.ContentAnalysis.FileSubmitService.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(IElementLocation elementLocation, String resourceName, Object arg0)
at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, String importExpressionEscaped, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator4.Evaluate()
at Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, ProjectCollection projectCollection)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion)
at SandcastleBuilder.Utils.MSBuild.MSBuildProject..ctor(String projectFile)
at SandcastleBuilder.Utils.BuildEngine.BuildProcess.ValidateDocumentationSources()
at SandcastleBuilder.Utils.BuildEngine.BuildProcess.Build()

@EWSoftware
Copy link
Owner

As mentioned above, check the given file path and make sure the targets file actually exists there. Does it? If not, you may need to copy or install something that's missing.

@Guson
Copy link

Guson commented May 7, 2015

You probably have an old project-file, and upgraded to a newer Visual Studio. Maybe the project file is interpreted differently by Visual Studio, MSBuild and SHFB?

Check your project file for the following line:

  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

For Visual Studio 2013 the $(VSToolsPath) normally is

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0

In your project file you may find

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>

Normally the $(MSBuildExtensionsPath32) points to

C:\Program Files (x86)\MSBuild

MSBuild Reserved and Well-Known Properties
https://msdn.microsoft.com/en-us/library/ms164309.aspx

@kamenlitchev
Copy link

This is the way a Windows 8.1 Class Library project is created in VS2015. To reproduce, just use New Project -> Class Library (Windows 8.1)

Not a problem with upgrade or something.

@anwaramoon
Copy link

I agree with Guson's comment. This is only happening for upgraded projects. One easy way to fix this is, copy web applications folder from v12.0 to v11.0.

from
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications
to
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications

@coldacid
Copy link

coldacid commented Mar 2, 2016

@EWSoftware the problem here is that $(VSToolsPath) and/or $(VisualStudioVersion) are being set by SHFB when passing the source projects through MSBuild. If it didn't, the path to Microsoft.WebApplication.targets would exist for me and probably these other users including OP.

@EWSoftware
Copy link
Owner

@coldacid: SHFB doesn't set either of those explicitly.

@coldacid
Copy link

coldacid commented Mar 3, 2016

Any idea where they'd be set then? It's annoying having to hand-edit project files just to get my documentation built and then restore them afterwards, every time.

If it's possible to explicitly set the values within the SHFB project to pass into MSBuild as part of the project configuration, that would be a good workaround for this whole issue, too.

@EWSoftware
Copy link
Owner

Since SHFB isn't setting them they're most likely inherited (I don't know from where) or they're undefined. If undefined and conditional, they're probably assuming the default value which is perhaps incorrect. You can try adding them to the SHFB project (they can be added using the User Defined Properties category) but don't be surprised if they don't get inherited by the loaded project.

@coldacid
Copy link

coldacid commented Mar 3, 2016

Looks like dotnet/msbuild#52 explains why this happens. Unfortunately using User Defined Properties doesn't help, but that MSBuild issue gave me the hint for the proper workaround for people facing this problem.

The project file block

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>

should be changed so that the condition for <VisualStudioVersion> will succeed when $(MSBuildAssemblyVersion) is empty, like so:
'$(VisualStudioVersion)' == '' or '$(MSBuildAssemblyVersion)' == ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants