Set Startup Project Through Coding In C#?
May 26, 2010i would like to run a command prompt to run the project and set its startup project
View 2 Repliesi would like to run a command prompt to run the project and set its startup project
View 2 Replies I manage to change part of it and the rest i not quite sure how to do it. Below is the code written in C#, it is a svc file.
[code]....
Are all loaded on web app startup or only when they’re invoked (i.e., when their code is used)?
View 1 RepliesI used Castle Windsor before and had this routine that fired the certain method of all classes that implement a certain interface.If I recall correctly, the interface was IBootStrapTask and only had an excecute method. Then, for instance, I'd place all my route registrations in one of these, and know it get fired on application startup.Have to admit I did not understand the code to well, so I'm even more unsure how can I do this. I'm using structure map now. (still knowing very little about it)
View 1 RepliesI am in a partnership with someone. We are currently planning a system that can either use ASP.NET MVC or PHP With //Insert your framework here//. At this stage I can't say to much. Now the thing is I have a bit of experience with C# and MVC. I understand the concepts and actually wrote a fully functional blog with it. Now the other side of me wants to take PHP for a test drive. Will I waste my time? How good will ASP.NET MVC scale against PHP? I have to say that I love visual studio and the integration of MVC tools like quickly adding a view and a controller... Everything fits nicely. But the learning curve was quite steep and still is. I haven't really touched AJAX and Jquery yet but how easy is it to use it with ASP.NET MVC? I already googled and researched this but I want opinions of those who have been working with these technologies.
View 6 RepliesI have a site in which I have defined my Start up page, say Sample.aspx. After deployment in server named "Siteserver, Now whenever I open link [URL]. Now, my question is, if I have more than one page like Sample1.aspx and Sample2.aspx and I want to open [URL] directly, how can I do this. It is redirecting again to Sample.aspx. How can I achieve this.
View 1 RepliesI know that when a .NET web application first starts, it will be slow on first access. For that reason, I created a 'keep alive' page in the application that is requested every 8 minutes or so by a scheduled process. I hoped that that would be sufficient to prevent the application from 'unloading' and thus suffer from this initial long startup time again and again.
I can see in my logs that the 'keep alive' page is indeed triggered every 8 minutes, 24 hours a day. But when I actively start working in the application after some time, eg. the following day, I still have to wait a while for it to start up. Once the first page is loaded, all is fine again.
I have around 10 "Excute SQL Task" events in sequence. Each Task uses the same two date parameters, which are declared at the top of each script. Is there a way to set these two at the start of the process instead of within each sql script?
View 2 RepliesI'm trying to troubleshoot a plugin issue and I've seen references to 'take a look at the VS startup log'.
View 2 Replieswe have this problem but can't find a solution. We have an application that references something like 24 dlls. When you invoke the application the very first time (after the application is for any reason reset) it takes 25-40 seconds to start loading contents.
This is what we tried:
1. precompile and publish everything in release mode
2. removing pdbs from bin folder
3. put strong named assemblies into GAC
4. set application to debug = false
consider that the whole bin folder is composed by 24 dlls for a total size of 28MB. Just 4 of these dlls are strong named and they are more and less 25MB. Nothing seems changed. What happens EXACTLY when the application is started is something I couldn't find in any book nor forum/blog/post... What can we monitor more to find where the problem is?
I went to the Code Plex site and down load the latest toolkit. Then followed the instructions on how to set up the toolkit to the letter. When I first loaded the toolkit everything worked. But now every time I start up my computer and start VS all the AJAX controls I have on any page has the green squiggly line underneath it and the error says:Element <AJAX Control Name> is not a known element. This can occur if there is a compilation error in the web site, or the webconfig file is missing.The only thing I can do is delete the Ajax Toolkit tab then add the tab again and then "Choose Items..." and load the Ajax controls again. Then I have to add an AJAX control from the toolkit to any webpage. Once that is done all the green squiggly lines go away and I can continue.This is becoming an incredible pain.
View 1 RepliesWhen I start debugging my application using vs2010 before the default.aspx page is rendered the application_error event is fired in global.asax.
There is nothing happening in the page_load of the default.aspx screen.However, if I set a break point on the default.aspx page_load event and the application_error event here are the sequence of events: The page_load event of default.aspx is fired, there is no code to execute there so I hit F5 to continue. The application_error event is then fired.Here are some of the details from Server.GetLastError();
exception message is "File does not exist."
stack trace:
at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath)
[code]...
I have absolutely no idea why this event is fired. Do all of the events in the Global.asax get fired on startup?There is nothing happening on the page_load so how can an error be thrown?
When I turn on Code Coverage in my test settings, on a project that references the Unity DI container I get the following error:
Cannot initialize the ASP.NET project'{Project Name}'.
The event log specifies the following reason:
Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified.
My application is running in a shared hosting environment. I do have a dedicated App Pool for my app. I've been doing some testing with 1st visits and precompile performance and have been tracking when my application starts up and shuts down.
In my Global.asax I have some logging code in Application_Start and Application_End. I can see from my logs generally when the application is idle and shuts down, then someone visits and it starts back up.
But, I also see cases where a shutdown is logged and then followed by another shutdown about 13 minutes later; without a startup in the middle.
I also see instances where there are two Startups in a row. I'm guessing these might be a recycle, but why wouldn't there be a shutdown log entry?
What I'd really like to know if there is a better way to track when my application starts, when it shuts down and if it is shutdown due to an idle pool, or from a recycle. I don't have access to the Windows Event Log so I need to do this from my app if possible.
startup article over the mixture of ASP.NET MVC and Dynamic Data?
View 1 RepliesI'm trying to find a hook / way to run some initial code to wire up a bunch of things before a service is called.
View 2 Repliesi am trying to ste my Home Page other than Defualt.aspx in IIS but im getting a message saying This is a marker file generated by the precompilation tool, and should not be deleted! i do my precompilation of web project using aspnet_compiler -nologo -f -v i do not want to use Default.aspx and route it to the Home Pgae. it works in Visual STudio but when i deploy it to IIS it gives me this message.
View 2 RepliesI have a scenario in which 5 buttons else two or more same controls need to access the same startupscript (ASP.NET). Is it possible?? If so give me a details code snippet.
View 1 RepliesI use asp.net mvc & going to build javascript files at application startup depending on site configuration.
I am going to have some javascript file templates that will be populated with appropriate constants and put into /scripts folder.
application_startup()
{
string populatedFile = Html.RenderPartial("/scripts/script.template.js");
write populatedFile into /scripts folder...
}
I want to be able to create a style sheet at session startup (based on a large number of variables... this sheet must be created on the fly and can not be hard coded). At the moment i can set up styles and apply them to controls using the VS designer (html behind of a page). But i need to be able to create these styles at runtime because they will differ for each session. The names of the styles may not differ, but the elements inside the style will be changing.
I figured that one thing i could do is create a css file using System.IO to create the file and then use that to apply (but even then, im not sure how i go from creating the file to including it in the project at runtime), but is there an easier way?
Is there a way the Start page can be saved in the Project file of a Web Application project.
Right now it saves in the user file, I tried moving the tag in the CSProj file along with the IIS VD creation tag, but it didnt worked.
I have used the following article to create N local users:
[url]http://www.codeproject.com/KB/system/everythingInAD.aspx?msg=3448333#xx3448333xx[/url]
How do I set some batch file ,that I have wrote ,to be executed right when each user logs-in?
(Include it in the statup functions to be executed).
how can i do perfect coding using all oops concepts?
View 6 RepliesI Developing a erp project in that there are more than 100 screens i should provide a one button or any other option if users click that button it show all screens so far you have used for eg:alt+tab event if we press it comes so far used same functionality should be overcome in my project how to achieve this.
View 1 RepliesI really do not have time to learn new language, in my case asp.net, but would like to start developing website in asp.net. I do not want to use asp:SqlDataSource control. is it ok if i write in codebehind aspx: all database connections and other CRUD operations in ado.net and c#. I already know xhtml, javascript - jquery, css, xml, json, some knowledge in sever-side coding (before php). want to start coding, instead of learning messy asp.net controls.I have to sit and learn all bloody ways of using those asp.net controls?
View 2 Replies