I have a class library that I'm publishing as a nuget package.
However, when I try to consume this package in a demo app, I get this error when I try to use it.
System.MissingMethodException: Method not found: 'Hypermedia.Configuration.FieldBuilder`1<!0> Hypermedia.Configuration.DelegatingContractBuilder`2.RenameFieldUsingJsonPropertyName(System.String)'.
at DISCOSweb_Sdk.Mapping.JsonApi.DiscosObjects.DiscosObjectContractBuilder.WithDiscosObject(IBuilder builder)
at DISCOSweb_Sdk.Mapping.JsonApi.DiscosObjectResolver.CreateResolver()
at DISCOSweb_Sdk.Clients.DiscosClient.GetMultiple[T](String queryString)
at DISCOSweb_demo_app.Pages.SimpleFetching.GetMultiple.UpdateModel(Type t) in /home/james/repos/DISOSweb-sdk/src/demo-app/Pages/SimpleFetching/GetMultiple.cs:line 35
So, the RenameFieldUsingJsonPropertyName()
method is actually located in a submodule of the SDK repo and is included with a project reference.
So, what I suspect is going on is that the nuget build isn't grabbing the code from the referenced projects.
<ItemGroup>
<ProjectReference Include="..\..\..\vendor\Hypermedia\Src\Hypermedia.JsonApi.Client\Hypermedia.JsonApi.Client.csproj" />
<ProjectReference Include="..\..\..\vendor\Hypermedia\Src\Hypermedia\Hypermedia.csproj" />
</ItemGroup>
If this is the case, I'd imagine I could publish that submodule on nuget too and then reference that in the SDK to fix the problem. However, my submodule is a fork of someone else's package with some patches (including adding this method) so I don't really want to do that, especially since I have PRs in with upstream.
Is there any way to force the nuget build to grab all of the project references and include them? It's also entirely possible that I'm barking up the wrong tree here.
NB: I have seen this answer, but the flag mentioned doesn't seem to exist in dotnet pack