application-start

How to start up your .NET program from web browser?

╄→гoц情女王★ 提交于 2020-01-01 22:20:29
问题 Could you provide example of JavaScript function for starting up application installed on your computer from a web browser (eg google chrome 4). It particular if .Net APPs have any special simplifying this process apis of out there are some libs for such staff, please share link with us. so how to create and store in run on start up programs a small local server which would handel some local urls like http://localhost/maAppServer/MyAppCalculator/Start for starting apps that have written in

Application_Start not behaving correctly in ASP.Net 4.0 Application

妖精的绣舞 提交于 2019-12-25 04:04:01
问题 I'm stumped. I ran through all the recommendations on StackOverflow and Google... no joy. My Application_Start method is not behaving correctly in my ASP.Net 4.0 application. I can set Application variables, but not call my logging method. I can set variables: Application["appStartDT"] = DateTime.Now.ToString(); But my logging method is not called: Utilities.writeLog("Application started at: " + System.DateTime.Now.ToString(), 4); This happened about the time I switched from the internal IIS

How can you hook a SharePoint 2007 feature into the Application_Start of a site?

ぃ、小莉子 提交于 2019-12-22 06:33:58
问题 I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature? Thanks! 回答1: This is actually possible, but it doesn't involve the Global.asax file. Many of Microsoft's examples demonstrate wiring code in via the Global.asax, but this is not a best-practices approach when it comes to SharePoint

What happens if an unhandled exception is thrown in Application_Start?

☆樱花仙子☆ 提交于 2019-12-22 01:53:13
问题 ... will the Application_Start method be ran again for the next request(s) or not? Does it depend on ASP.NET version, hosting server version and/or other context? I am trying to determine if it's a good thing to load critical assemblies there or not. For example data access assemblies which are vital to the functioning of the whole application or not. Failure to load such assembly would make subsequent requests useless. 回答1: Application_Start will be fired only once for each web application

log4net Configuration for console app

荒凉一梦 提交于 2019-12-21 04:02:12
问题 can anyone suggest how to configure the log4net for an console app? Or at least how/where to catch the Application_Start event? (It seams that some calls are required at this moment) Thanks in advance! 回答1: You need to configure it before the first logger is instantiated. To do so: Your main class (Program.cs) should not have a logger The main method should not reference any classes that have a logger. You can then configure log4net in the main method. Alternatively you can use a wrapper

How can I use Server.MapPath() from global.asax?

蹲街弑〆低调 提交于 2019-12-18 09:59:26
问题 I need to use Server.MapPath() to combine some files path that I store in the web.config . However, since Server.MapPath() relies on the current HttpContext (I think), I am unable to do this. When trying to use the method, even though its "available", I get the following exception: Server operation is not available in this context. Is there another method that can map a web root relative directory such as ~/App_Data/ to the full physical path such as C:\inetpub\wwwroot\project\App_data\ ? 回答1

Application_Start not called in global.asax. Why?

无人久伴 提交于 2019-12-13 03:52:46
问题 In my global.asax I have the following code: public static bool Was = false; protected void Application_Start(object sender, EventArgs e) { Was = true; } When I open a page and look at the Was variable, it's still false . What gives? (Note: the variable isn't used anywhere else, I made it just for this test case) Update: I just found out that my whole global.asax file is getting ignored. How can this be? Update 2: Sorry, it does get into play after all. But there's extra weirdness there. So

ASP .NET Application_Start Event + Connection to a DB

跟風遠走 提交于 2019-12-12 04:46:02
问题 I have started developing a full-web application by using the ASP .NET MVC 3 framework. I am a MVC 3 beginner developer. On the server-side I am going to execute some queries to a DB. Consequently I will have to make a connection to the DB. I would like to know if it is better to make a connection in the beginning of each action method or in an event handler. I have thought about making the connection in the Application_Start event handler and then storing an object representing my connection

Stop execution of ASP.NET application

安稳与你 提交于 2019-12-10 18:26:14
问题 In my Application_Start() method, how can I stop the execution of the ASP.NET application when certain conditions are not met? Throwing an exception doesn't appear to work. 回答1: i don't think that's possible; even if you could 'abort' the startup, the next attempt to access a URL from the site would try to start it again perhaps a static variable could be used to signal go/no-go, and begin_request could redirect to a placeholder page instead? 回答2: There seems to be a COM API that you can use

How can you hook a SharePoint 2007 feature into the Application_Start of a site?

北城以北 提交于 2019-12-05 12:29:41
I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature? Thanks! This is actually possible, but it doesn't involve the Global.asax file. Many of Microsoft's examples demonstrate wiring code in via the Global.asax, but this is not a best-practices approach when it comes to SharePoint. Ideally, your code should get packaged as a Feature and deployed via WSP (as you already know). The key