'Not running in a hosted service or the Development Fabric' exception on deployed Worker role

We are getting this exception after a worker role has been operating fine in production for several weeks.  Once this exception starts getting reported, it will keep getting it every time the worker role tries to access anything with the Diagnostics:
Not running in a hosted service or the Development Fabric
Note that the role is full trust, and as I mentioned this in in production on the Azure servers, NOT in debug.  The worker role itself does some dynamic compilation, for which it needs to start a new AppDomain.  It appears that the exception is
coming from the spawned AppDomain when it occurs.  The exception itself is triggered on a simple Trace.TraceInformation call.
What could cause this?
What can we do to recover from this?

We are getting this exception after a worker role has been operating fine in production for several weeks.  Once this exception starts getting reported, it will keep getting it every time the worker role tries to access anything with the Diagnostics:
Not running in a hosted service or the Development Fabric
Note that the role is full trust, and as I mentioned this in in production on the Azure servers, NOT in debug.  The worker role itself does some dynamic compilation, for which it needs to start a new AppDomain.  It appears that the exception is
coming from the spawned AppDomain when it occurs.  The exception itself is triggered on a simple Trace.TraceInformation call.
What could cause this?
What can we do to recover from this?
Hi,
I have tested this situation in Windows Azure platform and i can not reproduce your exception message, my test code in follwoing MSDN samples and i deploy it in Production status.
The MSDN article (include Appdomain code snippets)
http://msdn.microsoft.com/en-us/library/system.appdomain.aspx .
Base on my understand, the "Not running in a hosted service or the Development Fabric" error message occur when Azure Emulator or Azure development fabirc, because you create a new appdomain in WorkRole, and it may cause permission errors, a similar
posts by my research:
https://social.msdn.microsoft.com/Forums/en-US/windowsazuretroubleshooting/thread/50987285-58ac-484e-b604-725fe01a3325
If you still have some problems, please inform me. Thank you.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact
[email protected]
Microsoft One Code Framework

Similar Messages

  • Azure In Role Caching Doesn't start on server with "Not running in a hosted service or the Development Fabric."

    I started to use Azure in-role caching and everything works great in Azure compute emulator on my local machine, but not on server. I've already dealed with some problems, like lack of msshrtmi.dll on server, but now can't understand why get this error:
    Not running in a hosted service or the Development Fabric.
    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.InvalidOperationException: Not running in a hosted service or the Development Fabric.
    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:
    [InvalidOperationException: Not running in a hosted service or the Development Fabric.]
    Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +535
    Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +34
    [ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
    System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +1588
    System.Diagnostics.TypedElement.BaseGetRuntimeObject() +103
    System.Diagnostics.ListenerElement.GetRuntimeObject() +825
    System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +261
    System.Diagnostics.TraceInternal.get_Listeners() +256
    System.Diagnostics.Trace.get_Listeners() +79
    Microsoft.ApplicationServer.Caching.DataCacheServerLogManager..cctor() +97
    [TypeInitializationException: The type initializer for 'Microsoft.ApplicationServer.Caching.DataCacheServerLogManager' threw an exception.]
    Microsoft.ApplicationServer.Caching.DataCacheServerLogManager.ChangeLogLevel(TraceLevel traceLevel) +0
    Microsoft.ApplicationServer.Caching.ServiceConfigurationManager..cctor() +24
    [TypeInitializationException: The type initializer for 'Microsoft.ApplicationServer.Caching.ServiceConfigurationManager' threw an exception.]
    Microsoft.ApplicationServer.Caching.ServiceConfigurationManager.GetHostDefaults() +0
    Microsoft.ApplicationServer.Caching.OMCacheNodeProperties..ctor(IHostConfiguration props, Int32 maxNC, Boolean perfCounterRequired) +69
    Microsoft.ApplicationServer.Caching.LocalCacheStore..ctor(EvictionParametrs evictionParams) +50
    Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor(DataCacheFactoryConfiguration configuration) +555
    Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFactoryFromConfiguration(DataCacheFactoryConfiguration config) +35
    Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +7
    All I found about this error is that it occurs if you start local Azure compute emulator with in-role caching and without administrative rights. But in emulator everything works fine and problem occurs only after I publish to staging environment. (if switch
    to production, error remains).
    I use cache for resolving routes like /username and /countryname etc. So available usernames and country names will be cached and updated on changes in database. I have static class with static DataCache object which is created on first request to cache. But
    even home page doesn't start so error occurs before I try to create cache object.

    Hi Jambor, I don't have reference errors. I had them before but already fixed with copy local = true for few references. 
    I receive error only on azure host service. In local everything works great, app starts, cache works and I can see data in cache.  Yes, in local mode cloud project is set as startup and VS runs as administrator.
    I've added TraceListener creating code you suggested:
    protected void Application_Start(object sender, EventArgs e)
    System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener());
    and error code changed a little. But as I see problem is the same but caused when creating TraceListener from Application_Start instead of when initalizing cache:
    Not running in a hosted service or the Development Fabric.
    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.InvalidOperationException: Not running in a hosted service or the Development Fabric.
    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: 
    [InvalidOperationException: Not running in a hosted service or the Development Fabric.]
    Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +518
    Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +34
    [ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
    System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +1588
    System.Diagnostics.TypedElement.BaseGetRuntimeObject() +103
    System.Diagnostics.ListenerElement.GetRuntimeObject() +825
    System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +261
    System.Diagnostics.TraceInternal.get_Listeners() +256
    System.Diagnostics.Trace.get_Listeners() +79
    sub2o.MvcApplication.Application_Start() +497
    [HttpException (0x80004005): Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +558
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +179
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +322
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +384
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +397
    [HttpException (0x80004005): Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +630
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +763

  • Windows Azure Cloud Service with MVC4WebRole template giving "Not running in a hosted service or the Development Fabric." Error.

    Azure SDK used - 1.7 & 2.0
    When we create new project for Windows Azure Cloud Service with MVC4WebRole template & try to run it locally its giving error as "Not running in a hosted service or the Development Fabric."
    We are aware that making Azure project as start up project will resolve this error but we want to run the application locally before testing it with cloud.
    It’s not working with Cassini so we have tried with IIS but still it’s giving the same error.
    In another project when we added ASP.Net MVC4 Application & then for that project we have generated the Azure cloud service project using "Add Windows Azure Cloud Service Project". By this way debugging it locally works fine.
    Is there something additional settings present in Windows Azure Cloud Service with MVC4WebRole template which is causing this issue?

    hello,
    According your description, I try to reproduce it in my PC.
    >1. I create a could project and add a MVC4 web role into project.
    >2. I set the azure project as a start project and run, it works fine.
    >3. I change the MVC4 web role as a startup project and run, it works fine too. Of course before this, I exited the Azure Simulator.
    But this project was a empty project. It didn't included azure DLL file, such as Diagnostics file. So I think you could comment out the "system.diagnostics" node and try again. Also, you could refer to this same thread:http://stackoverflow.com/questions/13879443/not-running-in-a-hosted-service-or-the-development-fabric-production-not-debug
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is it possible to run steam as a service in the background?

    Now that Steam In-Home streaming works from a Linux host, I was wondering if was possible to get Steam t run as a background service?  The idea being that I simply need to boot the host computer and can then play games on my laptop elsewhere without needing to log into the host box - or start Steam on it manually.
    Apart from possible performance issues, users on the host computer need not even be aware that Steam is running.
    Can this be done?

    MainStage is an application, not a plugin. So, no, it can't be used in Cubase.

  • My iPhone 5S has not connected to 4G LTE service in the last few days? Is there an outage/issue with 4G in my area (Pittsburgh) or is this a device specific issue?

    My iPhone 5S has not connected to 4G LTE service in the last few days? Is there an outage/issue with 4G in my area (Pittsburgh) or is this a device specific issue?

        JHblues Let's get your data working again. There are not any reported issues in the area. Try this step:  http://vz.to/1kUSSk2
    Sheritah_vzw
    Follow us on Twitter
    @VZWSupport

  • I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any availabl

    I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any available updates or reinstall IPhoto.
    I tried installing Iphoto it said it was downloaded successfully. I still get the error messafe, and can not open any photos of program,  any suggestions?

    What version of iPhoto do you have on the Macbook and on the iMac? What systems are you running on the Macbook and on the iMac?
    Does the message only refer to "a problem" or does it specify what it is?
    Happy Holidays

  • My new macbook pro is giving me hardtime. even apple team is not being to solve it. they replace the motherboard first it didn't work. second time they formatted the computer and that also didn't work. every time my mac showing different problems.

    my new macbook pro is giving me hardtime. even apple team is not being to solve it. they replace the motherboard first it didn't work. second time they formatted the computer and that also didn't work. every time my mac showing different problems.
    At first my computer had issues. Once it go to sleep it will not back again. I dropped my laptop at apple store to fix it. After 10  days they returned my laptop saying they were no able to fix the problem so they replaced motherboard aiming if that might help. Acttually that didn't help.I had same issue again. I visited apple store again. This time they said they could fix, if I will allow them to format the harddrive. I said ok. They formatted it. It was working fine for few daysAfter few days compter is taking.even more than 15 min to shutdown. Now computer has another problem. It is being hang frequently like every 20'to.30 min.
    I don't know what to do? I still have one month left on first year warranty. I have requested couple times to apple associates either to fix or replace or refund. They are showing me rude behavior. They are not understanding my situation. I am a student. I need to do lot of home work. Since last three month my mac book and apple associates giving me hard time. Any suggestions are welcome.

    Contact Apple Customer Care - not Apple Care - Customer Support. Have your receipts handy and/or case numbers. Be patient, be calm, and tell your story just as you have here. I get the sense you are not in the US and don't have access to an Apple Store but are going to an independent shop. This makes using Customer Support all the more important. If phoning isn't viable, use registered mail.
    Since time is running short, be prepared to purchase AppleCare to exennd your warranty 2 more years. Yes, you shouldn't have to do this, but it gives you added protection and more opportunities over the next 2 years to claim a replacement computer if you don't get one immediately. After dealing with a similar unhappy situation with a Mac in the late 1990s I finally got a replacement computer and reimbursed for the AppleCare policy.

  • When I choose external editor in iPhoto on my iMac it does not recognize Aperture. When I do the same on my laptop it works? Any ideas?

    When I choose external editor in iPhoto on my iMac it does not recognize Aperture. When I do the same on my laptop it works? Any ideas?

    No idea, but Aperture is not an external editor. Like iPhoto, Aperture is a Photo Manager. It's a database. There is no way to round trip a shot from iPhoto to Aperture and back again like you can with Photshop or an image editor.
    Given that Aperture does pretty much everything that iPhoto does - and a whole lot more -  it begs the question: why not just use it to manage your photos?

  • When trying to open Pages 4.0.1 I get a message stating "Pages cannot be opened because of a problem, check with the developer to make sure Pages works with this version of Mac OS X. You may need to reinstall the application." Using OS X 10.6.8

    When trying to open Pages 4.0.1 I get a message stating "Pages cannot be opened because of a problem, check with the developer to make sure Pages works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X."
    I've run the software update several times. Pages is located in my iWork '09 folder in Applications. Using OS X 10.6.8

    Delete and reinstall it.
    (104030)

  • I have tried VERY unsuccessfully to install iphoto 9.2.3 update...it says it has successfully updated - then on opening says: iPhoto cannot be opened because of a problem. Check with the developer to make sure iPhoto works with this version of Mac OS X.

    I have tried VERY unsuccessfully to install the new iphoto 9.2.3 update.
    I have installed it several times both from the appstore and from Apple Support downloads...it says it has 'successfully updated' - then on opening iphoto, a dialogue box pops up and says:
    iPhoto cannot be opened because of a problem.
    Check with the developer to make sure iPhoto works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X.
    Click Report to see more detailed information and send a report to Apple.
    Insane...I have all my updates including Lion 10.7.3 why does APPLE KEEP SENDING BETAS AS A REAL PRODUCT?
    Does anyone know how to copy over a backup from a twinned drive Backup? What files etc.
    Thanks tons...

    Thanks Terence,
    I did get it working finally...and your last advice was what I needed.
    I am embarassed that I was an early adopter...SHOULD HAVE KNOWN BETTER and read the problems before creating some for myself.
    This was an excercise in frustration, because of the obtuse division between the appstore and Apple Support downloads... it was a bit of a circuitous route...strange that with all the security reciepts and tracking that Apple goes to to prevent piracy... which Steve by his own admission used to build Apple...
    Why aren't the server scripts smart enough to say…”HEY DUMMY you can't use this download because you purchased the last iPhoto upgrade from the appstore...and… DON'T WASTE YOUR TIME and precious data BUDGET downloading this gargantuan file which will eat 20% of your expensive 5Gb monthly data allotment!!!…and NOT WORK…only pretend to…and then foul your system….kill your productivity and turn your hair whiter…even worse than LION did.
    I am just so antagonized by the inept scripts in recent installations that don't do a diagnostic before allowing installation that is going to corrupt things...I had less effort and frustration when I ran my ATARI with a MAC emulator...rarely lost any productivity to nonsense.
    I AM TIRED OF BETAs dressed as products...designed and rushed out for Apple toys that once were tools of the creative trade...COREL...may still have a chance at a comeback if Apple keeps pumping out toys instead of the venerable tools we once adored as income enhancers.

  • Can't run wiki and web services at the same time?

    I'm a newbie with Lion Server, but I've been running several web sites successfully for about 6 months.  I'm up to Server 10.7.4.
    I've been trying ever since the first installation of Server to get the wiki service running.  I had absolutely no luck until I turned OFF the web service (always got the "URL does not exist" error when I tried to create a group wiki from inside the Server app).  With the web service off, it all starts up fine and I created my first wiki (woohoo).  Turning web service back on kills access to the wiki.  I don't find reference to this in any of the dicussions, and especially not in Apple's documentation.
    Are the Wiki and Web services mutually exclusive?  Or is there a way around this?
    I'm using Dyndns to provide me with sub-domains to use, and I've dedicated one of them to the wiki service.  Traffic comes in on port 8080, where my web sites are on port 80.
    Thanks for any pointers...
    edbok

    LR supports tethering using a Canon DLL and EOS Utility probably also supports tethering or at least uses something from a similar Canon DLL.  You probably cannot have two different versions of that DLL loaded at the same time, so it makes sense there are problems.

  • Published changes show in Safari but do not get transmitted to hosting service (via FTP)

    Publishing. Changes to pages no longer change color of page icon but get published as Entire Site. They show correctly in Visit. But they do not reach hosting service for actual public change.

    II am using iWeb FTP, which has worked until recently. The other thing I notice is that icons for changed pages no longer change color when a corection is made. But if I publish entire site and then visit, the changes show.
    However when I open site independedntly, not changes appear. GoDaddy (my new host) suggests that Visit is taking me (in Safari) to some kind of preview version ather than the published web version.

  • I have re-installed Farm Simulator twice with the program not running. I have spoke with the company they say it is corrupted.

    No joy with the app store providing a good copy of this game..

    If the current version is corrupted, it's the developer's or publisher's duty to re-submit a corrected version.

  • L1.1 hangs (task mgr - not responding) as soon as I hit the Develop tab

    Wow, what a disappointing purchase. Never used Lightroom before. Just purchased it so its a clean install. It came right up. I imported about 50 raw images from a folder. Went thorough them to delete the ones I didn't like and selected the ones I really wanted. Next I highlighted an image and hit "D". It hung like a hummingbird! Finially ended task and rebooted, started again. clicked the Develop tab this time... immediate hung again (not-responding). What is going on? I have plenty of memory, a 146GB free disk space.
    I looked through the other threads and must having this "type" of problem are upgrading from 1.0.

    Dan,
    I can tell you that in the 5 days since I prevented the autostart of the apdpoxy.exe file, I have only had one single crash of the program during the 10+ hours that I have used it.
    When I allow the apdproxy.exe file to autostart upon login, the frequent crashes immediately start up again. I'm on an XP machine, and every single time that it has crashed on me, it always asks if I want to sent the notice/report to Microsoft. Of course I always Click "Yes" just to flood their inbox...
    When I disable the autostarting of the apdproxy.exe file, everything seems to run just fine, and the program is truly fun to use!
    Since I am on a Windows XP machine, and therefore do not have the Activity Monitor utility, I do not have the statistics that you request. I suppose I could do it with the Performance Monitor running - but I am only going to spend the time and frustration involved with allowing the apdproxy.exe program to autostart if you specifically ask me to do so.
    Thanks!
    Gregg Mack

  • Filesharing service on the OS X Server 4.0 works only locally

    Hi, the last years i used filesharing only in my local network. but now i would like to use it via internet. I did the port setup in my fritzbox but i can´t get the server via internet. Server 4 status for internet is green, wiki works but no filesharing.
    Thanks.
    Mac mini
    OS 10.10.3
    Server 4.1

    Which ports did you forward through the firewall?  On the FileShare tab, what is listed next to Permissions?  All user, All Networks?  Something different?
    That being asked, as you sure you want to expose your file services ports to the world?  If you are opening the SMB ports, you will likely get hit with a scanner within a few hours.  Have you considered using VPN first, then connect to file services through the VPN tunnel?
    Reid
    Apple Consultants Network
    Author "Yosemite Server – Foundation Services" :: Exclusively available in Apple's iBooks Store
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store
    Author "Mavericks Server – Control and Collaboration" :: Exclusively available in Apple's iBooks Store

Maybe you are looking for

  • Autofocus not working correctly

    Hello, I bought my Nokia Lumia 1020 a week ago. I'm very impressed with it and a proud owner but the autofocus seem to have some kind of a bug. When i press the shutter button halfway it looses the focus and the picture get's blurry (it works 3times

  • Middleware Question - Initial Load vs. Synchronize

    Is the initial load (transaction R3AS) of an adapter object required for replication to be carried out from R/3 to CRM? Can I synchronize (R3AS4) instead if I don't need the existing data? Also, is it even required to do some sort of action (either i

  • Modify the text of a button.

    Hello friends, Is it possible to change the short description of a button (application toolbar) in a standard transaction? I am trying this using SE63 but without success. Does any one know how to use the transaction? Thanks …

  • Personalization: Newly Created Item to be Validated

    Hi, How can I include a validation to a new item in OAF personalization? My requirement is to enable this new item only when TYPE = 'Yes' and disable when TYPE <> 'Yes'. This TYPE field varies for different records. Thanks! N Edited by: user8427607 o

  • Can't reinstall my elements 11 after a reinstall of hard drive

    I have the latest version of OSX.  Spent 2 hours with adobe and they referred me to the forum.