-
Notifications
You must be signed in to change notification settings - Fork 365
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
Directory.Build.props
interferes with target framework determination
#923
Comments
I tried adding
to the project, because that's the property it seems to want, but that made no difference. I also tried dropping
(which is fair enough, given it likely defaults to 4.0). Note: I'm referencing the |
I don't think there's anything that say you can't put both If you're getting the error about not being able to determine the target framework version, the |
In the .shfbproj, if I leave out either As for the version: 2020.3.6 is the one that works; I'm trying to use the latest release, but that's the one throwing the error. In fact, it looks like every version past 2020.3.6 has this issue, and I don't see anything obvious in the release notes for any of those releases that would indicate something I should change. |
Perhaps I'm misunderstanding you, but with the exception of a If you can supply an example that demonstrates the issue you're having, I can investigate it further. |
I have tried a few combinations. <PropertyGroup>
<FrameworkVersion/>
<TargetFrameworks/>
<TargetFramework/>
<TargetFrameworkMoniker/>
<TargetFrameworkVersion/>
</PropertyGroup> results in <buildStep step="ValidatingDocumentationSources">
Validating and copying documentation source information
Source: ...\xxx.csproj
Found project '...\xxx.csproj'
Parsing project files
Multi-targeted projects where found. The common target framework 'net472' will be used. Override using the TargetFramework property on the documentation sources.
Last step completed in 00:00:00,1259
</buildStep>
<buildStep step="Failed">
SHFB: Error BE0065: BUILD FAILED: Unable to determine target framework version for project
at SandcastleBuilder.Utils.MSBuild.MSBuildProject.get_TargetFrameworkVersion()
at SandcastleBuilder.Utils.BuildEngine.BuildProcess.ValidateDocumentationSources()
at SandcastleBuilder.Utils.BuildEngine.BuildProcess.Build()
</buildStep> Hence my question about what prompts this error when there is explicit logging preceding it that suggests it find a target just fine. Variations:
I'll see if I can set up a minimal reproducible test case. Side Note: I currently have
to cover my bases wrt reflection data. Is it alright to have multiple reflection packages (to cover cases where the selected target is I do see in the log that one of them is put in the component path twice:
That's probably not harmful - but it did seem odd. |
SHFB picks the reflection data set it needs so having multiple packages with different sets won't cause any issues. |
Guess I'll file a new issue when I am given the time to set up a reproducible test case by my manager. |
I closed it due to inactivity. It can be reopened if you can provide a test case. |
I think I may see where it's going wrong. We use One of things these set is the default targets for projects: <PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework />
</PropertyGroup> It is that which seems to trigger the BE0065. However, for .shbproj files this gets overridden later with: <PropertyGroup>
<!-- SHFB does not support multi-targeting yet, so force use of a single target framework. -->
<TargetFrameworks>net472</TargetFrameworks>
<TargetFramework>net472</TargetFramework>
<TargetFrameworkMoniker>.NETFramework,Version=v4.7.2</TargetFrameworkMoniker>
<!-- Using this seems to resolve issues encountered in some, but not all, projects (specific cause unknown). -->
<FrameworkVersion>Cross-platform (.NET Core/.NET Standard)</FrameworkVersion>
</PropertyGroup> The presence of However, creating such empty files ahead of time did not resolve the issue here. Similarly, not including the .props file setting TargetFramework to blank when a .shbproj is being loaded makes no difference. So it looks like the target framework checking is happening outside of a .shbproj context and is picking up the Directory.Build.props. I don't immediately see how I can avoid this happening. I am attaching a case that reproduces the issue. If I comment out the <Import Project="CodingGuidelines.props" /> in build/shared-build-config.props, the doc project builds fine (well, it warns about the |
Directory.Build.props
interferes with target framework determination
Looks like SHFB is running something in <TargetFramework Condition=" '$(MSBuildProjectExtension)' != '.csproj' " /> then the doc build works again. But given that this setup is specifically for the code projects, and they build just fine using it, that's not a fix. So It looks like SHFB is evaluating the documentation source project and getting hung up on the empty default value for |
@EWSoftware Test case has been provided; can you reopen this, or should I file a fresh ticket? |
The cause was not handling the |
I have a multitargeting project (net472 and netstandard2.1); while with SHFB 2020.3.6 this works nicely, having set
in the project.
(With the small caveat that I have had to set
FrameworkVersion
toCross-platform (.NET Core/.NET Standard)
instead for some projects, for no obvious reason.)That same project errors out when updating the SHFB package reference to 2022.2.6:
The log has:
So it detects that it's multitarget and correctly picks the first target listed (small note: typo:
where
->were
).But then it still errors out, with no reason listed.
Adding
targetFramework="net472"
to the documentation source makes the "Multi-targeted ..." message go away, but the build error remains.It would be nice to get some clarity on where exactly the error comes from, given that preceding messages show exactly what the target framework is.
The text was updated successfully, but these errors were encountered: