i have a asp.net web application written about 2 years ago .It does not have any logging mechanism in it. Ideally I would like to log any errors that happen especially at the database level. I cannot afford to break the application however, and I have limited time.
I have heard about ELMAH. Is it possible to have something that doesn't talk to my code directly and just does its own thing by monitoring the server?
It was made in ASP.NET 3.5.
It has AJAX as well as heavy use of ViewState.
The application also communicates with Excel.
It is built in Visual Studio 2008 w/ SQL Server 2005 on the backend.
How do I go about deploying this website with above requirements?
Yes.
Added ELAMH to your application - it will log the errors. It's non-invasive.
Once ELMAH is added to your application it hooks into the OnError Event and captures all errors throw by your application. This is assuming that your application does not swallow the errors.
The documentation around ELMAH is through and easy to follow.
There is also log4net -
http://logging.apache.org/log4net/
Related
I would like to implement logging but would prefer just to use the Microsoft Stack. With all of the changes to diagnostics I find it difficult to keep up.
Can anyone tell me if they have removed Elmah and been able to replace it with the Microsoft Stack of diagnostics. Note my application is an ASP.NET Web API Azure worker role Web application.
Why don't you just use the diagnostics code for Windows Azure? It's super easy to add and the portal is great for viewing and analyzing logs:
http://azure.microsoft.com/en-gb/documentation/articles/web-sites-enable-diagnostic-log/
I'm trying to eliminate (or at least minimize) startup/warmup times for my .NET applications. I'm not really sure on how to do this even though it's a common concern.
There's a ton of questions about slow startup of .NET applications. These are easily explained by pool recycles, worker process startup, dynamic compilation of .aspx files, JIT etc. In addition, there are more things that may need to be initialized within the application such as EntityFramework and application caches.
I've found alot of different solutions such as:
ASP.NET Precompilation
IIS 8 Application Initialization (and for IIS 7.5)
Auto-Start ASP.NET Applications
However, I'm not entirely satisfied with any of the solutions above. Furthermore I'm deploying my applications to Azure Websites (in most cases) so I have limited access to the IIS.
I know that there are some custom "warmup scripts" that uses various methods for sending requests to the application (e.g. wget/curl). My idea is to create a "Warmup.aspx" page in each of my ASP.NET applications. Then I have a warmup service that sends an HTTP GET to the Warmup.aspx of each site every ... 5 minutes. This service could be a WorkerRole in Azure or a Windows Service in an on-premise installation. Warmup.aspx will will then do the following:
Send an HTTP GET to each .aspx-file within the application (to
dynamically compile the page)
This could be avoided by precompiling the .aspx pages using aspnet_compiler.exe
Send a query to the database to
initialize EntityFramework
Initialize application caches etc
So, my final question is whether there are better alternatives than my "Warmup.aspx" script? And is it a good approach or do you recommend some other method? I would really like some official method that would handle the above criteria.
Any and all suggestions are welcome, thanks!
Did you try this IIS Auto-Start feature described here ?
https://www.simple-talk.com/blogs/2013/03/05/speeding-up-your-application-with-the-iis-auto-start-feature/
You could have two instances of the site. When you need to deploy a new version, and therefore suffer a startup cycle, remove one instance out of load balancer rotation, deploy and start it, set it in and do the same for instance 2. A rolling deployment.
I have a asp.net website developed in asp.net 2.0 on production which is using enterprise library for keeping the log/error and saving them into the text file. Can I use ELMAH without comipling the website and read log/error via ELMAH interface?
ELMAH can be very well used without recompile, however note that if your existing logging frameworks are handling errors, then elmah may not be able to get the error since other frameworks would have taken some actions and used up the stack trace of it.
I know a lot of people have posted for this, but I'm still having trouble matching the symptoms I have to what other people have encountered. I created a simple web service in an empty asp.net website using Visual Studio 2010 (I just used the default web service with its Hello World implementation). Then I created a WPF application and tried to call the web service from the application. But I can't find the XXXAsync methods, or BeginXXX methods in the soap client proxy class using intellisense. There's a method for calling HelloWorld synchronously, but nothing for asynchronous calls. Is there something that I have to do in order to enable asynchronous support for a web service in asp.net?
Thanks,
Andrew
Okay, I think I figured out what I was doing wrong. In Visual Studio 2010, I didn't mark the checkbox labeled "Generate asynchronous operations". This can be found by:
right-clicking the name of the service in the solution explorer (which should be in the "Service References" folder".
going to "Configure Service Reference...".
Checking the box labeled "Generate asynchronous operations".
Hope this helps someone quicker than I was able to find it!
Andrew
I developed an ASP.NET web application that reads an MS Access database with ADO.NET. This application will have to be run on Linux with Mono. Unfortunately, I am having problems getting Mono to work with the ADO.NET database connection.
With the connection string enabled on an onLoad event, the web app will not render; however, when I delete the onLoad event, the web app renders in the browser. I verified that it wasn't just the onLoad event as the problem by pressing a button that has an onClick event that reads the Access database, as well. The problem then persists, which is the following error: System.DllNotFoundException: gda-2...
I did some research on this error and downloaded the library libgda, but this did not fix the problem. Now I am seeing posts that Mono doesn't work with MS Access driven ASP.NET web applications.
Has anyone been able to get an MS Access driven ASP.NET web Application to work with Mono? If so, what steps did you take to get it to work?
I really appreciate everyones feedback, and if anyone has any suggestions, I would really be greatfull.
Thank you,
DFM
I do not think that MS Access will work with mono, because it depends on the MS JET database engine which is not a part of the .NET framework itself, but a windows component.
That said, developing a web application that accesses an Access database is not a very good idea. Access is a desktop application, and not scalable for web application usage.
I would recommend that you find an alternative database engine, such as MySQL (since the application should run on Linux)