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

Documenting a net8.0 project when using msbuild.exe #1052

Closed
Zastai opened this issue Apr 12, 2024 · 4 comments
Closed

Documenting a net8.0 project when using msbuild.exe #1052

Zastai opened this issue Apr 12, 2024 · 4 comments

Comments

@Zastai
Copy link

Zastai commented Apr 12, 2024

I am running into the following issue:

  • I have a Sandcastle project documenting a C# project targeting net6.0 and net8.0, with several NuGet packages in use
  • the Sandcastle tools are brought in from NuGet
  • when using dotnet build, this works fine
  • when using msbuild.exe however, the GenerateReflectionInfo step fails with
    SHFB : error BE0043: Unexpected error detected in last build step. See build log for details.
    • the log has MRefBuilder : error : Unresolved assembly reference: <assembly name for dependency from NuGet package> required by <assembly being documented

It looks like SHFB is applying a .NET Framework style dependency resolution (which would require all dependencies to be in the same folder) to a .NET library (which has a My.Assembly.deps.json alongside My.Assembly.dll file describing where dependencies are located).

I would love to leave the old .NET Framework implementation of MSBuild behind, but unfortunately, Visual Studio still uses that one, so it needs to work too.

Setting CopyLocalLockFileAssemblies to true in the project being documented resolves this error, but is not a solution - it's highly undesirable to duplicate dependency DLLs all over the place.

@EWSoftware
Copy link
Owner

Can you attach an example demonstrating the issue?

@Zastai
Copy link
Author

Zastai commented Jul 22, 2024

Will try. An initial barebones case seems to work (although obviously complaining it can't resolve outside references). Will try to get it as close to my real case as possible to see if it's any particular setting that triggers it.

@Zastai
Copy link
Author

Zastai commented Jul 22, 2024

I can't seem to reproduce it easily from scratch so will have to spend a lot more time trying to reduce the solution where I do have the issue to something I can share, and I don't currently have that time. Feel free to mark as On Hold for the time being (same for #1051).

@Zastai
Copy link
Author

Zastai commented Aug 23, 2024

Thanks to #1057 I now have a reproduction test case.

  1. Extract the zip file
  2. Build the solution by whatever means
  3. Use msbuild.exe to build the doc project

issue-1051-1052.zip

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

2 participants