Comments (13)
What container are you using? ( structuremap?)
http://andreasohlund.net
http://twitter.com/andreasohlund
Date: Sun, 5 Jun 2011 14:08:13 -0700
From: [email protected]
To: [email protected]
Subject: [NServiceBus] FileLoadException (#59)A FileLoadException (Could not load file or assembly. Access is denied.) is being thrown by the HostServiceLocator on line 25 (NServiceBus v2.5) when starting many endpoints simultaneously (Easy to repro with 20+ endpoints). This doesn't seem to be a problem with windows file system permissions or background indexers/virus scanners deadlocking the files.
Magnum.StateMachine.StateMachineException was unhandled Message=Exception occurred in Topshelf.Internal.ServiceController`1[[NServiceBus.Host.Internal.GenericHost, NServiceBus.Host, Version=2.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] during state Initial while handling OnStart Source=NServiceBus.Host 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.State`1.RaiseEvent(T instance, BasicEvent`1 eevent, Object value) at Magnum.StateMachine.StateMachine`1.RaiseEvent(Event raised) 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.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.ServiceCoordinator.Start() at Topshelf.Internal.Hosts.ConsoleHost.Run() at NServiceBus.Host.Program.Main(String[] args) InnerException: Message=Exception when starting endpoint, error has been logged. Reason: Could not load file or assembly 'file:///MyEndpoint.dll' or one of its dependencies. Access is denied. Source=NServiceBus.Host StackTrace: at NServiceBus.Host.Internal.GenericHost.Start() at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event event, Object parameter) InnerException:Reply to this email directly or view it on GitHub:
#59
from nservicebus.
StructureMap v2.6.2
from nservicebus.
I've encountered this exact error as well--and I'm using Autofac. The trouble is that it cannot be consistently reproduced. I'm actually wondering if it's a bug in the .NET framework relative to locks during file loading...
from nservicebus.
I have seen this problem with one assembly is x64 and rest is anyCpu.
nservicebus.host is x86 and then you get this error
from nservicebus.
I am also experiencing this issue quite regularly. I have 12 handlers that I'm trying to start simultaneously, and about 40% of the time I get the Access is denied error.
Any more thoughts on what could be causing this?
from nservicebus.
We had troubles reproducing. Can you reliably reproduce the issue?
Sent from my iPhone
On 31 jan 2012, at 03:28, Dan Bishop
[email protected]
wrote:
I am also experiencing this issue quite regularly. I have 12 handlers that I'm trying to start simultaneously, and about 40% of the time I get the Access is denied error.
Any more thoughts on what could be causing this?
Reply to this email directly or view it on GitHub:
#59 (comment)
from nservicebus.
Yes, I can reproduce it quite regularly. It doesn't happen every time I start up a number of projects, but the problem is definitely worse as the number of projects increases above ~10. If I try to load ~20 handlers simultaneously (via F5 in Visual Studio), I will almost always get the error. This of course makes it difficult to do full integration testing on a developer machine.
On average, the handlers that I'm starting have about 20 DLLs in their \bin\Debug directory, in case that is relevant.
from nservicebus.
I also have that issue quite often. I think you should talk to the MEF team (Glenn Block); they have been fiddling alot with assembly loading. I'm quite sure that can be fixed with a combination of using separate app domains for introspection + retries.
from nservicebus.
Our project has been plagued by this issue and we have had to literally put sleep statements within the batch files that start many endpoints. I can reproduce the scenario consistently. To do so, I created a solution with 40 projects that reference only log4net and NServiceBus assemblies and have nothing other than an app.Config file and a class that implements IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization. In order to reproduce the scenario, I run a script that clears the contents of the global assembly download cache (gacutil.exe /cdl) and then executes a powershell script that runs NServiceBus.Host.Exe from within the various build directories in my solution. Note that I am not doing anything to intentionally put anything in the GAC. Any help would be IMMENSELY appreciated.
from nservicebus.
Here is a project that replicates this issue - https://github.com/johnsimons/FileLoadException
from nservicebus.
I nearly gave up!
But then Process Monitor came to the rescue :)
from nservicebus.
I'm curious how you recognized the shadow copy service. I watched in
process monitor quite a bit myself and couldn't nail it down.
On Jul 9, 2012, at 10:07 PM, John Simons
[email protected]
wrote:
I nearly gave up!
But then Process Monitor came to the rescue :)
Reply to this email directly or view it on GitHub:
#59 (comment)
from nservicebus.
It was a lucky shot ;)
from nservicebus.
Related Issues (20)
- Don't register all interfaces on IHandleMessages<T> implementors as scoped in IOC container HOT 1
- NullReferenceException in TransportAddressResolver upon startup HOT 4
- Redis support in NServiceBus
- .Net Aspire support in NServiceBus HOT 1
- ServiceProvider is not scoped in outgoing behaviors hosted in the Generic Host HOT 10
- Stream-based data bus implementation HOT 1
- Premature ITransportAddressResolver access corrupts service HOT 1
- AssemblyScanner cannot find concrete serialization types from unobtrusive assembly HOT 14
- It is unnecessarily hard to send messages from recoverability
- Spans and activities on the consumer are not created if the producer does not have OpenTelemetry enabled HOT 12
- ContextPropagation throws an ArgumentNullException when the Activity.Current.Baggage contains a key with value null HOT 4
- Reduce dependencies for net 6 HOT 1
- AssemblyScanner duplicated assembly loading with possible System.IO.FileLoadException: Assembly with same name is already loaded HOT 7
- Allow users to control child trace span creation
- The automatic rate-limiting feature can unknowingly cripple endpoints if there's a bug in the user's system
- Remove polyfil dependencies HOT 3
- For OpenTelemetry metrics, allow Func<string, string> to be specified to trim the enclosed message types tag HOT 1
- Saga and outbox persistence that uses Entity Framework
- Overriding the host name does not work consistently
- AssemblyScanner finds private classes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nservicebus.