-
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
Build with dotnet.exe #517
Comments
That is correct. You will need at least MSBuild 14.0 to build SHFB projects. The SHFB build engine itself has dependencies on MSBuild assemblies so you can't get rid of it completely. |
FYI, if I use
As mentioned above, calling
Since the error message is specifically about the fact that it cannot load However, this basically means you can't script a build to include SandCastle output only using the
Not a show stopper since there is a work around, however, since building using Thanks! |
After some research, looks like To get this to work with SandCastle, you would need to either multi-target the MSBuild task -- or -- convert everything to .NET Standard, which "should" work in both environments. Here is an article that talks about multi-targeting MSBuild: This article answered my question about why it works in Visual Studio and not from the command line, the answer is Visual Studio still uses This issue was captured as an issue on the microsoft/msbuild GitHub project site, but was subsequently closed: dotnet/msbuild#2111 Also, several projects with a similar dilemma are basically going down the multi-targeting path: For more information, this google query was the most insightful: Well, I hope this is was at least somewhat insightful and helps you with thinking about possible options. Certainly I think testing the .NET Standard approach would be the more simple / lowest effort of the two options since this only entails converting the Thanks! |
I don't think it's as simple as just updating SandcastleBuilder.Utils to support .NET Standard. While that drives the build process, it calls all the other tools as well executing them with MSBuild, all of which are built against the full framework too. They'd have to be updated to run on .NET Standard too. That's a whole lot more work and may not be possible considering that some of the stuff they use may not be available on .NET Standard. You'd have to run the portability analyzer on the entire tool set to figure out what's missing. Many of the components offer interactive configuration, hence the references to the WPF and Windows Forms assemblies. Getting rid of those would require some other method of invoking the configuration dialogs. All the build components, plug-ins, and presentation styles use MEF as well which I'm not sure is available or fully supported yet outside of the full framework. |
Yeah - I went down trying .NETStandard path. This failed at MSBuild, which is available on both platforms, but only for explicit .NET Framework or .NET Core implementations. As a result, I posted a pull request so you can see what it took to get Sandcastle.Utils.dll, the assembly containing MSBuild task code, built using .NET core. Next task would be to put code in a I've ran out of time to test today... |
I think the SHFB projects are okay. The targets file included by them is probably where you'd make the changes to multi-target the assembly. That would probably get the project to load and start to build but aren't you going to have issues with all the other tools invoked by the build engine? |
Yes - that's where I am testing now - making some progress with this: <Project DefaultTargets="Build" TreatAsLocalProperty="TaskAssembly" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Sandcastle Help File Builder Tasks. https://GitHub.com/EWSoftware/SHFB -->
<PropertyGroup>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)'!='Core'">$(SHFBROOT)\SandcastleBuilder.Utils.dll</TaskAssembly>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)'=='Core'">$(SHFBROOT)\DotNetCore\SandcastleBuilder.Utils.dll</TaskAssembly>
</PropertyGroup>
<UsingTask TaskName="SandcastleBuilder.Utils.MSBuild.BuildHelp" AssemblyFile="$(TaskAssembly)" />
<UsingTask TaskName="SandcastleBuilder.Utils.MSBuild.CleanHelp" AssemblyFile="$(TaskAssembly)" /> |
FYI - I had to add a small dotnet core only build task to load needed assemblies to get everything to work (see XML below for how it's applied). Now I am down to an error that looks like it comes from SHFB:
This is as far as I've gotten. Thanks, <Project DefaultTargets="Build" TreatAsLocalProperty="TaskAssembly" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Sandcastle Help File Builder Tasks. https://GitHub.com/EWSoftware/SHFB -->
<PropertyGroup>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)'!='Core'">$(SHFBROOT)\SandcastleBuilder.Utils.dll</TaskAssembly>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)'=='Core'">$(SHFBROOT)\DotNetCore\SandcastleBuilder.Utils.dll</TaskAssembly>
</PropertyGroup>
<UsingTask TaskName="MSBuildAssemblyLoader.LoadAssemblies" AssemblyFile="$(SHFBROOT)\DotNetCore\MSBuildAssemblyLoader.dll" Condition=" '$(MSBuildRuntimeType)'=='Core'" />
<UsingTask TaskName="SandcastleBuilder.Utils.MSBuild.BuildHelp" AssemblyFile="$(TaskAssembly)" />
<UsingTask TaskName="SandcastleBuilder.Utils.MSBuild.CleanHelp" AssemblyFile="$(TaskAssembly)" />
...
<!-- The Core Build Help target -->
<Target Name="CoreBuildHelp">
<MSBuildAssemblyLoader.LoadAssemblies Condition=" '$(MSBuildRuntimeType)'=='Core'" />
<SandcastleBuilder.Utils.MSBuild.BuildHelp... |
It seems building with
dotnet.exe
command line is currently unsupported.This fails by example like this (line breaks manually added):
While building the same project with
msbuild
15 succeeds.This forces to still use (and locate...)
msbuild.exe
for generating the doc while all the other parts of the project usedotnet.exe
.The text was updated successfully, but these errors were encountered: