I am currently working on plans to update an intranet SPA that use the AspNetWindowsAuthProvider for authentication from Javascript to TypeScript. One feature that I would love to use in this update is the NativeTypes. Unfortunately, I have run into a couple of snags.
The first issue is with Add ServiceStack Reference. Once I have entered the Address and Name and clicked the OK button, the following error is returned:
Failed to generated client types, server responded with ‘The remote server returned an error: (401) Unauthorized.’.
When calling the NativeType Routes (i.e. /types & /types/typescript) from the browser, everything returns as expected.
Any advice on how to get this to function properly? My Visual Studio is running with the same account as everything else.
The second issue is that I am receiving a logged error when I initialize the NativeTypes plugin. Here is the text from the exception:
An error occurred in the application: Applicaton
Exception: ERROR: ServiceBase::Service Exception
Message: Could not register Request ‘ServiceStack.NativeTypes.TypeLinks’ with service ‘ServiceStack.NativeTypes.NativeTypesService’ as it has already been assigned to another service.
Each Request DTO can only be handled by 1 service.
Source: ServiceStack
Target site: Void AddToRequestExecMap(System.Type, System.Type, ServiceStack.Host.ServiceExecFn)
Stack trace: at ServiceStack.Host.ServiceController.AddToRequestExecMap(Type requestType, Type serviceType, ServiceExecFn handlerFn)
at ServiceStack.Host.ServiceController.RegisterService(ITypeFactory serviceFactoryFn, Type serviceType)
at ServiceStack.Host.ServiceController.RegisterService(Type serviceType)
It appears that it’s attempting to register some Type routes multiple times.
IIS Authentication Settings