NFive / SDK.Server

NFive Server SDK for plugins
GNU Lesser General Public License v3.0
2 stars 8 forks source link

ServiceNotRegisteredException #5

Closed dotmbf closed 4 years ago

dotmbf commented 4 years ago

Hey, I tried the nfpm scaffold command after the new build

And on nfpm start after installing it gives me this

Unhandled exception: Griffin.Container.ServiceNotRegisteredException: Failed to resolve 'Itzshahay.Shops.Shared.Configuration'. Have you registered it in the container? Remember that you should depend on abstractions and not concretes.
  at Griffin.Container.ContainerBase.Resolve (System.Type service) [0x00025] in <64fc92ff54c14557b5a2f6dc7b6e22a3>:0
  at NFive.Server.Program+<>c__DisplayClass2_0.<Startup>b__13 (System.Reflection.ParameterInfo p) [0x0000c] in <91c3dc45d0ce447db3747a745824ff40>:0
  at System.Linq.Enumerable+SelectListPartitionIterator`2[TSource,TResult].MoveNext () [0x00048] in <cf8f429092f345a6bd742c3476e00e06>:0
  at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x000f4] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at NFive.Server.Program.Startup () [0x00c28] in <91c3dc45d0ce447db3747a745824ff40>:0
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1 (System.Object state) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
JoeBiellik commented 4 years ago

Thanks for reporting this.

There was a mistake in the scaffold skeleton code which caused this. You can either run a fresh scaffold or simply change the Controller constructor arguments so that the first argument is the logger, the second argument is the configuration and other arguments come after them in any order.