Closed sachin27sharma closed 6 years ago
Assuming all your vms are on the same assembly, most time I saw the error was because the vm name set on the client didn't fully match the c# class name. Pls check that first.
Just checked, the name looks alright. Will try cleaning node_modules but i suspect that shouldn't be an issue.
Add this to the config so you can debug why the type wasn't found:
config.SetFactoryMethod((type, args) => {
return Activator.CreateInstance(type, args);
}
Was this resolved?
Yes. create a new model separately and it worked. later found a bug in the viewmodel which wasn't loading. so all good. Thanks
i had a view model derived from BaseVM which is working fine (without adding any additional RegisterAssembly), Now when i added another viewmodel derived from BaseVM, am getting below error - "ERROR: 'UserVm' is not a known view model! Its assembly must be registered through VMController.RegisterAssembly."
I tried with registering assembly using both by config and RegisterAssembly still same error. NOTE - was using 2.3.0-pre version, even after upgrading to 3.0.0-pre (for both nuget and client library).
app.UseDotNetify(config => { config.RegisterAssembly(GetType().Assembly); // Middleware to do authenticate token in incoming request headers. config.UseJwtBearerAuthentication(new TokenValidationParameters { IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(AuthServer.SecretKey)), ValidateIssuerSigningKey = true, ValidateAudience = false, ValidateIssuer = false, ValidateLifetime = true, ClockSkew = TimeSpan.FromSeconds(0) });
Please clarify.