Question

I am currently using nServiceBus version 4.0.0-unstable3223 (Prerelease)

NSB is configured as follows:

private static readonly IBus Bus =
Configure
.With(typeof(IBaseMessage).ReferencedAssemblies())
.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.Contains(".Messages."))
.DefaultBuilder()
.XmlSerializer()
.UseTransport<Msmq>()
.UnicastBus()
.SendOnly();

When I try to access a WebAPI method, I am getting an error. When I debug to find out what is going on, this is the exception I get:

{"Requested registry access is not allowed."}

Stack Trace:
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at NServiceBus.Licensing.LicenseDescriptor.get_HKCULicense() in c:\TeamCity\buildAgent\work\28bfdd0d351fb1d3\src\NServiceBus.Core\Licensing\LicenseDescriptor.cs:line 30

Note: I am working in an environment with 10+ developers on the same code base. I am the only one experiencing this issue at this time. I have tried deleting my local code, pulling fresh from the repository, and rebuilding with NO code changes.

Any help/guidance would be appreciated.

Was it helpful?

Solution

NServiceBus is trying to read the license from HKEY_CURRENT_USER\Software\NServiceBus\4.0 and it looks like the user account you are running NServiceBus under does not have rights to ready that registry location.
Can you confirm that the user account has read access to that registry key?

It was my understanding that usually NT accounts have rights to read/write under HKEY_CURRENT_USER!

OTHER TIPS

If you're using Windows Authentication in your application, make sure the IIS authentication settings are correct. Windows Authentication must be the only enabled authentication method. This resolved the issue for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top