Comments (18)
Thank you for reporting this issue - we are investigating the right fix for this issue.
from azure-sdk-for-net.
Hi
I have a similar problem. Running VS2010 and using a WCF service in a WebRole.
When I use the Web Project as Startup and then call:
CloudConfigurationManager.GetSetting("SomeSetting");
I get:
System.Configuration.ConfigurationErrorsException was unhandled by user code
Message=Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
Source=System
BareMessage=Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
Line=0
StackTrace:
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)
at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
at System.Diagnostics.ListenerElement.GetRuntimeObject()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceInternal.get_Listeners()
at System.Diagnostics.TraceInternal.WriteLine(String message)
at System.Diagnostics.Trace.WriteLine(String message)
at Microsoft.WindowsAzure.AzureApplicationSettings..ctor()
at Microsoft.WindowsAzure.CloudConfigurationManager.get_AppSettings()
at Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting(String name)
at Ifs.Cloud.Production.ServerRole.Downlink.GetResource(String resource, Int32 pageSize, Int32 page, Call call) in E:\work\ZapZap\VisualStudio\TestProjects\ServerRole2\Ifs.Cloud.Production.ServerRole\Downlink.svc.cs:line 29
at SyncInvokeGetResource(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
InnerException: System.InvalidOperationException
Message=Not running in a hosted service or the Development Fabric.
Source=Microsoft.WindowsAzure.Diagnostics
StackTrace:
at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance()
at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor()
InnerException:
from azure-sdk-for-net.
In the current project I solved this like this:
-
Comment out the Azure diagnostics listener from web.config (system.diagnostics / trace / listeners where you see Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener)
-
In the WebRole.cs configure the trace listener by hand:
Trace.Listeners.Add(new DiagnosticMonitorTraceListener());
Also you can use RoleEnvironment.IsAvailable to check if you are running inside azure or not and act accordingly (use web.config vs. cloud configuration). Note that I'm not using CloudConfigurationManager class but the old RoleEnvironment.GetConfigurationSettingValue() to read the settings.
Edit: I'm actually initializing azure trace listener in WebRole.cs and not in global.asax.cs.
from azure-sdk-for-net.
I have done the steps recommended by @tparvi above, and this seems to get me a little farther along...sometimes. I occasionally still get a message when I hit F5 that says it could not attach the debugger to one of my web roles. To make this go away, tipically, I have to close VS2012, and exit out of the emulator. Then re-open VS2012 and my solution, then F5 again.
After the changes above and when the emulator actually attaches the debugger, I do get the web app to come up in the browser, but when it hits a line of code that calls CloudConfigurationManager.GetSetting(key), it throws a configuration exception with an inner exception stating that I am not running in a cloud.
Also, if I try to hit a line that calls CloudStorageAccount.FromConfigurationSetting(string), this call always returns null, although the connection string is pointing to a valid account key.
It's also worth pointing out that I have 3 team members that use the same source code pulled down from our SVN repository, and they are able to successfully build, run the emulator, and run the apps with the same config settings.
One of those coworkers (like me) is running VS 2012, while the other two are still on VS2010.
Please help! This issue is killing my productivity.
from azure-sdk-for-net.
Is there any headway on this? My project (for no reason) just started to throw this error regardless of configuration. I am know completely blocked from using cloudstorage from localhost.
from azure-sdk-for-net.
Same problem. Any solution?
from azure-sdk-for-net.
So, um, hey Microsoft, you gonna fix this or what? It's still an issue in v2.1 and this has been a known issue for over a year now. Very annoying.
VS2012 RTM on a WebRole, have to comment out or delete DiagnosticMonitorTraceListener from webconfig in order to run the app outside of the emulator, even though this is the whole point of CloudConfigurationManager.
from azure-sdk-for-net.
I'm following up with folks on this.
from azure-sdk-for-net.
Hi guys,
I've proposed a fix in a PR, we'd appreciate your feedback
from azure-sdk-for-net.
what release will this fix ship in?
from azure-sdk-for-net.
@ogazitt we're working to prepare an increment nuget update with the hotfix; will reopen this and assign to you to verify once we get that out, hopefully in the next week or so.
from azure-sdk-for-net.
Thanks Jeff. Having a hot fix would be very helpful given that building it by hand would require me to change the strong naming references throughout the project.
FWIW, with the 2.1 SDK, I've never been able to work around this issue by adding the DiagnosticMonitorTraceListener instance to the Trace.Listeners collection. Right now I have to remember to uncomment the appropriate config directive before I deploy, which is obviously suboptimal. Looking forward to a real fix :)
—
Sent from Mailbox for iPhone
On Tue, Oct 22, 2013 at 10:32 PM, Jeff Wilcox [email protected]
wrote:
Reopened #91.
Reply to this email directly or view it on GitHub:
#91
from azure-sdk-for-net.
@ogail If you would like to at least eliminate the manual step of changing your config before deploying, you can use a separate solution configuration for deploying.
from azure-sdk-for-net.
@MFisherMSFT I know how to create separate .cscfg for production and local but I don't know how to create separate web.config files without some post-build hackery. In the past I know there was a mechanism in asp.net to have debug and release transforms for the web.config file, but in VS2012 / Azure SDK 2.1 that doesn't seem to be part of the default azure webrole project. I was about to write a startup task when I found this thread :-) Having a real fix will save me from doing that.
from azure-sdk-for-net.
@ogazitt The mechanism that performs transforms of web.config based on the solution configuration still exists. When I create a new Windows Azure Cloud Service project with a Web Role, I see Web.Debug.config and Web.Release.config files under Web.config (which needs to be expanded in the Solution Explorer). And you can right-click on Web.config to create new config transform files.
from azure-sdk-for-net.
@MFisherMSFT wow, I can’t believe I missed the arrow to expand the web.config node in solution explorer. Embarrassing :-) Thanks for the pointer!
from azure-sdk-for-net.
Hi all,
We have pushed the fix for this issue in the version 2.0.2 on NuGet, would appreciate if you can give it a try and let us hear your feedback.
Cheers,
Ogail
from azure-sdk-for-net.
I tried this out by installing the newest (v2.0.2) Windows Azure Configuration Manager package off NuGet. Oddly enough, while my issues running the web project in IIS Express have gone away, I seem to have a new issue with neither the webrole nor the worker role in my azure project logging data anymore.
My setup looks as follows:
web.config for webrole, app.config for worker role have the same sys.diagnostics section:
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
And the RoleEntryPoint.OnStart() override for both roles has the following code:
var config = DiagnosticMonitor.GetDefaultInitialConfiguration();
config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
config.Logs.BufferQuotaInMB = 1000;
config.Logs.ScheduledTransferLogLevelFilter = Microsoft.WindowsAzure.Diagnostics.LogLevel.Verbose;
Microsoft.WindowsAzure.Diagnostics.LogLevel.Information;
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
My WADLogsTable hasn't received any of my Trace.WriteLine() messages since I've redeployed.
I even flushed the wad-control-container blobs (as has been noted on stackoverflow and other places), to no avail.
Unfortunately I'm not 100% sure that the broken traces is correlated to the new Microsoft.WindowsAzure.Configuration.dll, but I'm starting to run out of ideas.
Update:
Note sure how my deployment got horked but after deleting the production deployment and redeploying everything, my tracing issues seem to have gone away.
I can confirm that I no longer get Azure exceptions when I run the web project in IIS Express.
Thanks!
from azure-sdk-for-net.
Related Issues (20)
- [BUG] Serialization Issue caused by MapsAddress.get_BoundingBox() HOT 1
- [BUG] Azure.Messaging.ServiceBus Version 7.17.x Causing High Request Rates, Performance Issues, and Escalating Billing Costs HOT 4
- [QUERY] Need to filter out Blob response using SDK
- [BUG] error CS0426: The type name 'Create' does not exist in the type 'ServiceClient' HOT 1
- [BUG] IPV6 not supported while creating a Ipv6Enabled SQL Server
- Azure OpenAI streaming + tool calls not possible? HOT 2
- [BUG] Drain excess credits when using sessions to ensure FIFO (#40457) - Timeout and Session Lock Expiration HOT 7
- [BUG] Azure.Core.Sse.SseReader ends up erroneously blocking HOT 2
- [BUG] NullReferenceException in Azure.Core.Pipeline.StorageRequestFailedDetailsParser.TryParse HOT 1
- [BUG] `Messaging.System` attribute value is not following OTel spec HOT 3
- Restore (and possibly other) operations are not handling errors correctly HOT 1
- Azure.AI.OpenAI, how to create a new OpenAIClient with a bearer token? HOT 2
- Correct usage of SqlDatabaseResource.GetMetrics HOT 1
- ServiceBusSender ScheduleMessageAsync() returns timeout on exceeded message size HOT 1
- [BUG] Azure GPT-4-Turbo JSON mode response generation breaks after 1024 tokens HOT 3
- [CDK/Azure.ResourceManager] Decide on whether BicepModelReaderWriterOptions can be avoided
- Include information in the Identity troubleshooting guide for dealing with AADSTS65002 from VisualStudioCredential
- You list an argument as optional and then specify in the documentation that it is required. Required parameters are not optional. HOT 5
- [QUERY] When adding a MicrosoftTeamsUserIdentifier with AddParticipant, is a 403 response expected? Can you add teams members to chat threads? HOT 5
- Cannot run Key Vault tests using -UserAuth test resources switch parameter HOT 14
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 azure-sdk-for-net.