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

Support for Nuget Central Package Management #1057

Open
WolfgangHG opened this issue May 10, 2024 · 0 comments
Open

Support for Nuget Central Package Management #1057

WolfgangHG opened this issue May 10, 2024 · 0 comments

Comments

@WolfgangHG
Copy link

WolfgangHG commented May 10, 2024

It seems Sandcastle cannot resolve dependencies if "Nuget Central Package Management" is used (https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management)

See attached sample: in the solution root, a file "Directory.Packages.props" enables this feature and defines a list of nuget packages that are available inside this solution and the versions of these packages:

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>
  <ItemGroup>
    <PackageVersion Include="Aspose.Cells" Version="24.3.0" />
  </ItemGroup>
</Project>

In each csproj file, the necessary packages are defined without versions:

    <PackageReference Include="Aspose.Cells" />

When building the Sandcastle project in attached sample SandcastleNuget.zip, this results in an error:

MRefBuilder : error : Unresolved assembly reference: Aspose.Cells (Aspose.Cells, Version=24.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56) required by SandcastleNugetLib [C:\Temp\SandcastleNuget\SandcastleDoc\Help\Working\GenerateRefInfo-7f8e79e1-7858-4d26-ae57-03abe7d4c3a7.proj]
    Last step completed in 00:00:01,2907
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0043: Unexpected error detected in last build step.  See build log for details.
   at SandcastleBuilder.Utils.BuildEngine.TaskRunner.Run(String processFilename, String targetFile, String arguments) in C:\GH\SHFB\SHFB\Source\SandcastleBuilderUtils\BuildEngine\TaskRunner.cs:line 237
   at SandcastleBuilder.Utils.BuildEngine.BuildProcess.Build() in C:\GH\SHFB\SHFB\Source\SandcastleBuilderUtils\BuildEngine\BuildProcess.cs:line 997

I could workaround it by adding the "Wildcard Assembly References" plugin and let it point to the exact dll version in my Nuget cache:

<PlugInConfig id="Wildcard Assembly References" enabled="True">
  <configuration>
    <references>
      <reference path="C:\Users\USERNAME\.nuget\packages\aspose.cells\24.3.0\lib\net6.0\" wildcard="*.dll" recurse="true" />
    </references>
  </configuration>
</PlugInConfig>

Is there a better workaround?

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

1 participant