I am trying to use this package on my Blazor WASM (client-side) project. The goal is to reflect my database service set out to the client so service methods can be called without calling web APIs.
I'm running into this exception:
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Cannot emit a CustomAttribute with argument of type System.RuntimeType.
System.ArgumentException: Cannot emit a CustomAttribute with argument of type System.RuntimeType.
at System.Reflection.Emit.CustomAttributeBuilder.Initialize(ConstructorInfo con, Object[] constructorArgs, PropertyInfo[] namedProperties, Object[] propertyValues, FieldInfo[] namedFields, Object[] fieldValues)
at System.Reflection.Emit.CustomAttributeBuilder..ctor(ConstructorInfo con, Object[] constructorArgs)
at ImpromptuInterface.Build.BuildProxy.BuildTypeHelper(ModuleBuilder builder, Type contextType, Type[] interfaces)
at ImpromptuInterface.Build.BuildProxy.BuildType(Type contextType, Type mainInterface, Type[] otherInterfaces)
at ImpromptuInterface.Impromptu.DynamicActLike(Object originalDynamic, Type[] otherInterfaces)
at ImpromptuInterface.ActLikeCaster.TryConvert(ConvertBinder binder, Object& result)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[Object,IMyInterface](CallSite site, Object arg0)
at WasmReload.Client.Services.DIService.ResolveCustomersService() in C:\Users\Micah\source\repos\WasmReload\WasmReload\Client\Services\DIService.cs:line 67
at WasmReload.Client.Pages.Index.OnAfterRender(Boolean firstRender) in c:\Users\Micah\source\repos\WasmReload\WasmReload\Client\Pages\Index.razor:line 17
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync()
at Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyRenderCompletedAsync()
And here is my code: (from the front page of the repo)
//Dynamic Expando object
dynamic expando = new ExpandoObject();
expando.Prop1 ="Test";
expando.Prop2 = 42L;
expando.Prop3 = Guid.NewGuid();
expando.Meth1 = Return<bool>.Arguments<int>(it => it > 5);
IMyInterface myInterface = Impromptu.ActLike(expando);
I am trying to use this package on my Blazor WASM (client-side) project. The goal is to reflect my database service set out to the client so service methods can be called without calling web APIs.
I'm running into this exception:
And here is my code: (from the front page of the repo)