orders.NET icon indicating copy to clipboard operation
orders.NET copied to clipboard

Tavis.UriTemplates Method not found when HalKit added as a binary dependency

Open lguminski opened this issue 9 years ago • 0 comments

When HalKit NuGet dependency is added via project.json

{
  "dependencies": {

    "HalKit": "0.8.0"
  },

Then the application in the runtime throws

System.MissingMethodException: Method not found: 'Void Tavis.UriTemplates.UriTemplate..ctor(System.String, Boolean)'.
   at HalKit.Services.LinkResolver.ResolveLink(Link link, IDictionary`2 parameters)
   at HalKit.HalClient.<SendRequestAsync>d__48`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HalKit.HalClient.<SendRequestAndGetBodyAsync>d__47`1.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at CustomerOrdersApi.ProductsController.<>c__DisplayClass10_0.<Create>b__4(Task`1 task) in /app/Controllers/OrdersController.cs:line 130
   at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) System.MissingMethodException: Method not found: 'Void Tavis.UriTemplates.UriTemplate..ctor(System.String, Boolean)'.
   at HalKit.Services.LinkResolver.ResolveLink(Link link, IDictionary`2 parameters)
   at HalKit.HalClient.<SendRequestAsync>d__48`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HalKit.HalClient.<SendRequestAndGetBodyAsync>d__47`1.MoveNext()<---

When the same dependency is added as git submodule

git submodule add https://github.com/viagogo/HalKit/
cd HalKit/
git checkout v0.8.0
cd ..
git add HalKit/
git commit -m "use HalKit submoduile at tag v0.8.0"
git push

rm -fr HalKit/test # this folder is not needed for running

then everything works fine.

So it looks like dotnet restore on linux does something strange.

PS. Adding the dependency on the latest version of Tavis.UriTemplates ("Tavis.UriTemplates": "1.1.0") also did not help

lguminski avatar Oct 17 '16 19:10 lguminski