NService Bus Exception while Handling onStart when Assembly depends on Automapper - automapper

We have an assembly using a refernce to the Automapper.dll. Starting the NServiceBus as Subscriber fails on Start with the following message:
Exception when starting endpoint, error has been logged. Reason: Could not load file or assembly 'file:///D:\Main\Src\Core\Core.MessageHandler\bin\Debug\AutoMapper.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
StackTrace:
Server stack trace:
at Magnum.StateMachine.ExceptionActionDictionary`1.HandleException(T stateMachine, Event event, Object parameter, Exception exception)
at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event event, Object parameter)
at Magnum.StateMachine.EventActionBase`1.Execute(T instance, Event event, Object parameter)
at Magnum.StateMachine.State`1.RaiseEvent(T instance, BasicEvent`1 eevent, Object value)
at Magnum.StateMachine.StateMachine`1.RaiseEvent(Event raised)
at Topshelf.Internal.ServiceController`1.Start()
at Topshelf.Internal.IsolatedServiceControllerWrapper`1.Start()
at Topshelf.Internal.ServiceControllerProxy.Start()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Topshelf.Internal.ServiceControllerProxy.Start()
at Topshelf.Internal.FacadeToIsolatedServiceController`1.Start()
at Topshelf.Internal.ServiceCoordinator.Start()
at Topshelf.Internal.Hosts.ConsoleHost.Run()
at Topshelf.Internal.Actions.RunAsConsoleAction.Do(IRunConfiguration configuration)
at Topshelf.Runner.Host(IRunConfiguration configuration, String[] args)
at NServiceBus.Host.Program.Main(String[] args)
The file "Automapper.dll" exists! There is no problem in the Config. I checked this removing the dependency to the AutoMapper.dll and it works.
Here is the config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MsmqTransportConfig"
type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="Logging" type="NServiceBus.Config.Logging, NServiceBus.Core" />
</configSections>
<MsmqTransportConfig
InputQueue="MyQueue#localhost"
NumberOfWorkerThreads="1"
MaxRetries="10"
ErrorQueue="ErrorQueue#localhost" />
<Logging Threshold="WARN" />
</configuration>
Any idea? Are there known problems with AutoMapper dependencies in NServiceBus?

In your endpoint configuration class (IConfigureThisEndpoint) it's common to implement IWantCustomInitialization as well. As part of that custom initialization you can specify the following:
public void Init()
{
Configure.With(AllAssemblies.Except("Automapper.dll"))
.AutofacBuilder()
.Log4Net(); // etc.
}
The "AllAssemblies.Except()" code instructs the NServiceBus configuration to completely ignore the Automapper assembly.
One other potential issue that may cause the issue is if you're using NServiceBus.Host.exe compiled against the CLR v2.0 (.NET v3.5) while Automapper is compiled against the CLR v4.0 (.NET 4.0). There are several builds of NServiceBus depending upon your CLR version. You may need to try running the CLR v4.0 version of change Automapper to be the .NET 3.5 version (which I believe isn't actively developed).

We had to use a binding redirect to get Autofac + NServiceBus to work. I believe the NServiceBus.ObjectBuilder.Autofac2.dll we referenced used an older version of Autofac than we were using.
app.config:
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" />
<bindingRedirect oldVersion="2.3.2.632" newVersion="2.4.3.700" />
</dependentAssembly>
</assemblyBinding>

Related

Use latest version of Npgsql with ServiceStack.OrmLite.PostgreSQL

I am using ServiceStack.OrmLite 4.0.9 (with PostgreSQL, which uses Npgsql). It appears that ServiceStack requires a specific version of Npgsql (2.0.11). However, there is a significant bug in Npgsql 2.0.11 (see pull request here and StackOverflow question here). I believe the bug was fixed in Npsql 2.0.12+.
How can I use a later version of Npgsql with ServiceStack.OrmLite.PostgreSQL?
I have tried to simply replace the Npgsql 2.0.11 dll file with the latest version (2.0.14.3, at time of writing), but this causes ServiceStack.OrmLite to throw the following exception:
System.IO.FileLoadException was unhandled by user code
HResult=-2146234304
Message=Could not load file or assembly 'Npgsql, Version=2.0.11.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=ServiceStack.OrmLite.PostgreSQL
FileName=Npgsql, Version=2.0.11.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7
FusionLog=Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
StackTrace:
at ServiceStack.OrmLite.PostgreSQL.PostgreSQLDialectProvider.CreateConnection(String connectionString, Dictionary`2 options)
at ServiceStack.OrmLite.OrmLiteConfig.ToDbConnection(String dbConnectionStringOrFilePath, IOrmLiteDialectProvider dialectProvider)
at ServiceStack.OrmLite.OrmLiteConnection.get_DbConnection()
at ServiceStack.OrmLite.OrmLiteConnection.Open()
at ServiceStack.OrmLite.OrmLiteConnectionFactory.OpenDbConnection()
at ServiceStack.Service.get_Db()
at XYZ.Post(Abc req) in XYZ.cs:line 45
at lambda_method(Closure , Object , Object )
at ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)
ServiceStack.OrmLite.PostgreSQL has probably been compiled against a specific version of Npgsql. Is it possible to use a different version of Npgsql? Or does anyone know when ServiceStack.OrmLite.PostgreSQL will update the version of Npsql it compiles against?
In your config file, add a binding redirect to the version of Npgsql you want to use.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.14.2" newVersion="2.0.14.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>

MVC5 fails on 1 and 1 Internet shared hosting

My MVC4 sites work without problems on 1 and 1 Internet shared hosting, but when I tried MVC5's default site using the VS2013 beta, it failed and I haven;t been able to figure out why. Can anyone help? Here are the error messages:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the >security policy. To grant this application the required permission please contact your >system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type >'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, >Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. >Information regarding the origin and location of the exception can be identified using the >exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type >'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, >Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Delegate.DelegateConstruct(Object target, IntPtr slot) +0
Owin.Loader.DefaultLoader..ctor() +47
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +66
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, > Object& syncLock, Func`1 valueFactory) +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, >HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] >handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, >HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET >Version:4.0.30319.18044
In general, most applications should run fine under Medium Trust. If your application requires Full Trust, you can override the trust level at the application level by adding the following to your web.config file:
<configuration>
<system.web>
<trust level="Full" />
</system.web>
</configuration>
The ASP.NET team has killed support for medium trust. MVC 5 now requires full trust. See my answer at https://stackoverflow.com/a/17218344/59641 for more information.
Ask your hoster to run your site in full trust, or choose a different hoster.
Do they support ASP.NET 4.5.1 yet? The default MVC 5 template uses ASP.NET 4.5.1 which is still in beta as well. Can you target your project to the current ASP.NET 4.5 or 4?

Windows Azure Cache Service using old configuration

The weirdest thing. I am switching over to SDK v1.7 and a new ACS and I get this weird error after I successfully login. It appears to be related to the SessionState provider for the Azure Cache Service.
I am NOT using the Preview but I am using SDK 1.7 and I am using a Windows Azure account that has the Preview Features enabled.
It's like something deep within the recesses of the ACS/Cache Service SDK is messed up.
Here is my cache config:
<dataCacheClients>
<dataCacheClient name="default">
<tracing sinkType="DiagnosticSink" traceLevel="Verbose" />
<hosts>
<host name="[[newCacheNamespace]].cache.windows.net" cachePort="22233" />
</hosts>
<securityProperties mode="Message">
<messageSecurity authorizationInfo="[[secret]]">
</messageSecurity>
</securityProperties>
</dataCacheClient>
<dataCacheClient name="SslEndpoint">
<tracing sinkType="DiagnosticSink" traceLevel="Verbose" />
<hosts>
<host name="[[newCacheNamespace]].cache.windows.net" cachePort="22243" />
</hosts>
<securityProperties mode="Message" sslEnabled="true">
<messageSecurity authorizationInfo="[[secret]]">
</messageSecurity>
</securityProperties>
</dataCacheClient>
</dataCacheClients>
Here is my session state provider config:
<sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
<add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default" />
</providers>
</sessionState>
Below is the error that I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------
The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote name could not be resolved: '[[oldCacheNamespace]]-cache.accesscontrol.windows.net']
System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data) +1243
System.Net.WebClient.UploadValues(String address, String method, NameValueCollection data) +179
Microsoft.ApplicationServer.Caching.AcsHelpers.GetToken(String serviceNamespace, String acsHostName, String issuerName, String issuerKey, String appliesTo) +523
[DataCacheException: ErrorCode<ERRCA0030>:SubStatus<ES0001>:ACS request for token failed. One of the reasons could be an invalid authorization token.]
Microsoft.ApplicationServer.Caching.AcsHelpers.GetToken(String serviceNamespace, String acsHostName, String issuerName, String issuerKey, String appliesTo) +1875
Microsoft.ApplicationServer.Caching.ClientAcsSecurity.get_Token() +242
Microsoft.ApplicationServer.Caching.CacheResolverChannel..ctor(CacheResolverCommunicatorType communicatorType, IDuplexSessionChannel innerChannel, DataCacheSecurity dataCacheSecurity) +559
[CommunicationException: ErrorCode<ERRCA0030>:SubStatus<ES0001>:ACS request for token failed. One of the reasons could be an invalid authorization token.]
Microsoft.ApplicationServer.Caching.CacheResolverChannel..ctor(CacheResolverCommunicatorType communicatorType, IDuplexSessionChannel innerChannel, DataCacheSecurity dataCacheSecurity) +833
Microsoft.ApplicationServer.Caching.CacheResolverChannelFactory`1.System.ServiceModel.Channels.IChannelFactory<TChannel>.CreateChannel(EndpointAddress to) +274
Microsoft.ApplicationServer.Caching.EndPointIdentityChannelFactory`1.System.ServiceModel.Channels.IChannelFactory<TChannel>.CreateChannel(EndpointAddress to) +186
Microsoft.ApplicationServer.Caching.WcfClientChannel.CreateChannel(EndpointID endpoint) +557
Microsoft.ApplicationServer.Caching.ChannelContainer.CreateChannel() +153
[DataCacheException: ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) +693
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCacheProperties(RequestBody request, SimpleSendReceiveModule sendRcvModule) +1194
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +701
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +356
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +447
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +315
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateNewStoreData(HttpContext context, Int32 timeout) +59
System.Web.SessionState.SessionStateModule.InitStateStoreItem(Boolean addToContext) +182
System.Web.SessionState.SessionStateModule.CompleteAcquireState() +374
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +2007
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +477
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +312
This is an old question, but someone might run into this problem in the future.
The fix is:
Remove the < hosts> element.
Instead, add this element:
< autoDiscover isEnabled="true" identifier="[[newCacheNamespace].cache.windows.net" />
That's it

Azure: CacheInstaller and ConfigStoreException

I'm trying to use co-located cache. And I'm getting the following exception during cloud emulator start proccess:
Application: CacheInstaller.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.ApplicationServer.Caching.ConfigStoreException
Stack:
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.RetryExponentialTask(System.Func`1<Boolean>, System.Predicate`1<System.Exception>, System.TimeSpan, System.TimeSpan, System.TimeSpan, Int32)
at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStore(Microsoft.ApplicationServer.Caching.ICustomProvider)
at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStoreIfRequired()
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
My config:
<dataCacheClients>
<tracing sinkType="DiagnosticSink" traceLevel="Error" />
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="Web" />
</dataCacheClient>
</dataCacheClients>
Could someone help me? :)
Edited:
I'm using VS 2010 SP1, Windows 7. I removed SDK 1.6 and reinstalled 1.7.
Cloud config (web role):
<ServiceConfiguration serviceName="Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2012-05.1.7">
<Role name="Web">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="..." />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="..." />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="..." />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="..." />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=..." />
<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=...;AccountKey=..." />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.Loglevel" value="" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
</ServiceConfiguration>
Edited 2:
I tried to create empty test project:
Created Windows Azure Cloud Service project
Selected ASP.NET Web role
Enabled cache at caching tab of web role properties (co-located)
Installed Windows Azure Caching Preview
Started cloud project by using NuGet
The same exception
Edited 3:
I installed VS 2012 RC and tried to create test project. The same problem occured.
Edited 4:
Exception details:
Microsoft.ApplicationServer.Caching.ConfigStoreException:
Windows Azure Storage Service is not ready/available. StorageAccountName = DevStorage, BlobNamePrefix = deployment17(44)__Web --->
Microsoft.WindowsAzure.StorageClient.StorageClientException: ERROR --->
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.StorageClient.CommonUtils.<LazyEnumerateSegmented>d__0`1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.ApplicationServer.Caching.WindowsAzureBlobProvider.IsInitialized()
--- End of inner exception stack trace ---
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.RetryExponentialTask(Func`1 doTask, Predicate`1 shouldRethrow, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff, Int32 retryCount)
at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStore(ICustomProvider customProvider)
at Microsoft.ApplicationServer.Caching.AzureCommon.Package.InitializeExternalStoreIfRequired()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
It looks to me like there was an issue when it is attempting to initialize the backing store for the cache. You're getting a 400 Bad Request from your Blob storage provider. Without caching configured, from another test project are you able to access your BLOB storage in your dev storage? Is the devstorage emulator running?
Check the storage emulator is running by looking at the notification area / systray and right-clicking on the little Azure icon there for the emulators. If one of the content menus is "Start Storage Emulator" the storage service isn't running, click it. If it thinks it is running then click on the Show Storage Emulator and ensure that the Blob and other services are checked and have a status of running. If all that is the case then attempt to read/write to your development blob storage using another test app or a 3rd party tool like Cerebrata's Cloud Storage Studio.
The caching system is attempting to create a folder in BLOB storage called cacheclusterconfigs where each of the members of the cluster can come see the configuration. For whatever reason, yours can't access the BLOB storage to do this.
To answer your other question, yes, the CacheInstaller does log. When you start up your instance, even before it comes all the way up you should be able to look at the compute emulator and select an instance. Then right click the instance and choose "open local store". This will open an explorer window to where the emulator puts the files specific for each instance. It will be something like C:\Users{user}\AppData\Local\dftmp\Resources\8d403f60-3b09-481a-8b9c-86ab9e06954b. The GUID is the instance. From that window dig into the following directory: \directory\Microsoft.WindowsAzure.Plugins.Caching.FileStore. Here you will see log files from the caching service. If yours is stuck installing then you should see a file in this directory like
DedicatedCacheLogs_CacheInstaller_xxxx.log (the xxxx are numbers). This might help you. Note that once the cache installer is done then it seems there is a service that is sweeping this directory and putting older files into the LogsBackup X directory which is also in this folder.
Note that the cacheinstaller.exe.config and related executable are actually copied into the package, and then into the instance for the emulator, from the C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-06\bin\plugins\Caching directory. Perhaps you might be able to add another tracelistener to the exe.config from that SDK directory and get it to spit out additional information if you can't find what you need from the instance directory I indicated above.
Hopefully these hints will help you. I couldn't recreate the issue on my end unless I gave it a bad storage account address for an account in Azure and even then it wasn't a 100% match to your error.

nservicebus using generic host with azure queues causes msmq error

I have an on premise service bus that is configured to handle messages from an azure queue. The problem i am having is that the host is reporting an msmq error saying that it could not create the error queue. Aside from the fact that it should not be using msmq, it also handles the messages with no problems despite the error so it does not seem to be critical.
My Host is running as a class library configured to start with the nservicebus.host.exe process.
Here is my host code and config:
internal class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
{
#region IWantCustomInitialization Members
public void Init()
{
Configure.With()
.DefaultBuilder()
.AzureMessageQueue()
.JsonSerializer()
.UnicastBus()
.IsTransactional(true)
.InMemorySubscriptionStorage();
}
#endregion
}
Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
<section name="AzureQueueConfig" type="NServiceBus.Config.AzureQueueConfig, NServiceBus.Azure"/>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
</configSections>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<AzureQueueConfig QueueName="sender" ConnectionString="UseDevelopmentStorage=true" PeekInterval="5000" MaximumWaitTimeWhenIdle="60000" />
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedruntime version="v4.0" />
<requiredruntime version="v4.0.20506" />
</startup>
</configuration>
And Here is the actual Error Message:
2012-04-24 07:57:10,973 [1] ERROR NServiceBus.Utils.MsmqUtilities [(null)] <(nul
l)> - Could not create queue error#UseDevelopmentStorage=true or check its exist
ence. Processing will still continue.
System.Messaging.MessageQueueException (0x80004005): Message Queue service is no
t available.
at System.Messaging.MessageQueue.Create(String path, Boolean transactional)
at NServiceBus.Utils.MsmqUtilities.CreateQueue(String queueName, String accou
nt)
at NServiceBus.Utils.MsmqUtilities.CreateQueueIfNecessary(Address address, St
ring account)
EDIT: Adding .MessageForwardingInCaseOfFault() to the initialization corrected the issue.
Looks like AsA_Server assumes msmq, guess you'll have to configure the process manually
Adding .MessageForwardingInCaseOfFault() to the init method resolved the issue. Still feels like there is an underlying bug, but it is working.
I suspect that below described the next hurdle (not handling errors correctly) but i will have to try to force a failed message to verify.
As described in:
NServiceBus error queues in Azure

Resources