.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Application_Start event stops happening when another project is added to the solution

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net

I'm having something unusual happening with a Web Service created using Visual Studio 2008.  Basically, the Application_Start event stops getting called when I add another project to the solution.  Here's what I'm doing (note that I'm using the ASP.NET Development Server):

1. Create a new Web Service project.
2. Add a new WebService class.
3. Add Global.asax.
4. Add a single line "System.Diagnostics.Debugger.Break();" to Application_Start in Global.asax.
5. Change Web.Config compilation debug="true" (actually VS did it for me when I first try to run it).
6. Run the solution.  Result: Visual Studio breaks in the Application_Start event.
7. Manually stop the ASP.NET Development Server.
8. Re-run the solution.  Result: Visual Studio breaks in the Application_Start event.

All good so far.  However, when I continue...

9. Manually stop the ASP.NET Development Server.
10. Add new project (a Windows Class Library) to the solution.  This is NOT set as the startup project (the startup project is still the web service project).  No references are added to either project and no other changes are made to either project.
11. Delete the default Class1.cs that automatically gets added to the class library project.<

View Complete Post

More Related Resource Links

Solution/project structure


Hello, I am working in a aspx web application that must be built in several separate "modules" with different functionality which will be partly developed by different teams.

However, I need the completed app to reside in ONE virtual directory. There will be a single startup page. I need session state to be preserved across pages in different modules.

I structured it as one solution with different Web Projects and one class library project with common functionalities.


1) is this the right approach to do this? Or which one would be better?

2) each time I add a new web project to the solution, a new web.config gets created. What do I do and where do I put them?

VS 2010 + framework 4.0 + TFS

Regarding TFS and source control, I have a single Team project, the solution and web projects are inside it.



Installed Visual Studio 2005 on new laptop - can't open C# web services project solution.

Installed Visual Studio 2005 on new laptop - can't open C# web services project solution - get the 'project not supported by this installation' error. Tried re-installing to no avail. Have run various flavors of devenv as recommended in various posts. Still the same message. I can open the solution fine on my old laptop.    Update: We re-installed service pack 1 for VS and the problem was resolved.

App stops writing to event log on 64 bit

This is the 3rd different forum I have placed this question to.  (i have been told to move the question to a specific forum that is more suited for my question) We have an application that logs exceptions to a custom event log.  The event log is created when the application is installed.  One server 2008 (32-bit) the application writes to the event log as it should when certain exceptions are thrown and handled.  Now that the app is installed on Server 2008 R2, being accessed via RDP and RemoteApps, the event log is empty.  Has anyone seen this?  DEP is turned off as that is the only hint of a possible issue I found searching the internet.

Sharepoint 2010 List Added Event Problem

Hi All, I have created List Added Event Handler. In that Event I want to Add Custom Field in List as List is created. I get an Error "The Specified Program Requires    a newer version of windows" Is there ant solution for it. I have tried it also creating new instances of spweb and spsite rather than getting it from "Properties" Thanks Saumil Thakkar

Image stretch inside a grid stops working horizontally once columns are added to grid.

I have a simple setup of a window. Window contains a grid, inside the grid there is an image. I want the image to always stretch across the entire cell. I've set it's Stretch property to Fill and it works fine, as long there is only one column in the parent grid. As the window is resized, the image stretches correctly. As soon as I add another column, the image stops stretching horizontally. Vertially it works just like before, horizontally it now appears with a fixed width corresponding to the width of the picture used as the source. Does not matter which column it's positioned in, and I've tried encapsulating it into another grid but behaviour does not change. It behaves the same in both Visual studio 2010 designer and at runtime. In addition when I tried to encapsulate it in a second grid, this seond grid also now has altered behavior - instead of sizing itself to it's container (both height and width are not set) as it's parent grid does, it now sizes itself to its contents - the image. But only horizontally. What is going wrong here, is this a bug or am I missing something, and any advice on how I can get the image to fill one of the cells of a grid with more then one column?

Click event for added RibbonButton in quick access toolbar

Hi! I'm using the new RibbonWindow from Microsoft. When I add a ribbon button to the quick access toolbar at runtime (via right click => add to quick access toolbar) and I click on the button in the quick access toolbar, the associated click event is not fired. It seems, the toolbar makes a copy of the original button, but does not copy the click event handler. How do I detect a click on the newly added button? Thanks! Jus    

host and consume wcf rest service in web project in single solution

I have  create a solution which have multiple class library project and a web application Like Web(UI),BL,DAL etc. I have also add a WCF REST starter kit Collection project in the same Solution.WCF Rest API is working fine if I host it on IIS but i want to consume this in my web project without using IIS. Is this possible? if yes then what will be the URI  for my WCF Rest services? Add service reference is also not working because WSDL is disable in rest.

convert 2003 project to vistudio 2005 get solution is unavailable

I have  three  folders , which original is build by vistual 2003 , recent ly  I install vistuall 2005 on Win 7 and succesful covert one  folder from vistual 2003 t0 2005 ( I forget how , I am new on win 7) , when I deat with my second folder I always get Test2( unviable) under the Solution Exporer ( vistual 2005)  But I can access this folder  by brows ( when I try http://localhost/test2/) I get all the files under this folder , why I can see them on my vistual studio 2005 ???

Mdi Form Locks Up When Trying To Show Form from Added Project

I added a second project to my solution, and now I am trying to load a form from the added project as a child to the Mdi which is in my first project.  Everything looks okay, but the Mdi locks up when I click on my toolStripMenuItem.  There are no error messages and it builds okay.  I am using VS2010. using PDFToImage; private void pDFToImageToolStripMenuItem_Click(object sender, EventArgs e) { PDFToImage.FormMain FormMain = new PDFToImage.FormMain(); FormMain.MdiParent = this; FormMain.Show(); } Rob Evans

Keeping Custom properties in GridView Added on OnRowDataBound Event While Sorting

All of my columns are bound in the Gridview. On OnRowDataBound event, I am adding some custom styles like underlines and colors to the text of the columns. Sorting of data is working fine but I am losing my custom styles when I sort. I am using the generic sorting code for the GridView. How I can keep my custom styles on sorting that I added during OnRowDataBound event.   Thanks for your help.

application_start event called multiple times in MVC application

hi, In my MVC application ,I am updating my web.config at runtime through application_start event.So, ideally it should be done only when the application is started.BUT in MY mvc application the application_start event of global.asax is being called multiple times , even when i have not restarted the application. Its being repetadly called when i am calling different actions , so the webconfig is repetedly updating & making my application very very slow. Can you please let me know , what's the reason & how to handle this .   Thanks in advance gbhatnagar    

Reading in values in text file in a project solution to an array



I have a tab delimited text file that has 6 columns (all integers) and 500 rows (and no column headings) called ProjectData.txt that I have added to my Windows Form Application (c#) (by added I mean I have it in my project solution). 

I have declared an array in my code called ProjectDataArray which has dimensions [500, 6].

I wish to load each column of each row into the array.

All the code I have seen shows how to do this for text files that are not included in the project solution. 

Is this easy to do?

An entry has been added to the Windows event log of the server. Log ID:5337


I found the solution of this error. I am using moss2010 there are two possibility for this kind of error

1>your code containing some logical error like you are fetching query string or something like that you need to first check is found or not

2>check your content type that, is your published content type default or sherepoint content type is default?

if you are facing no. 2 problem then make your published content type the default one and you can resolve the error.

trigger an automatic sharepoint site provision event from within Office project 2010



can anyone give me an idea on what i could do to automate the site creation in sharepoint when i press the sync button in project ? thanks

Can't change the code in Solution (Project)



I have problem using Visual Studio.NET 2003. When I open solution made early ago, choose the code of the existing .aspx page, could not change it, because when type nothing happened, no letter, no sign, like the keyboard is "dead" (but it is not, ofcourse). If I type the code in other application, then put it in .aspx.vb code page using copy-paste, everything is ok, can build the solution and it's working.

I appreciate for Your time, any help is welcome.



How to: include more project in a SharePoint 2007 Workflow solution in Visual Studio 2008

I just develop  a little bit complex workflow and I want some objects put into an library (simple c# class project) project  in the solution. It is signed, referenced, but when I debug  it send a "System.IO.FileNotFoundException: Could not load file or assembly ..." How to resolve?
Thanks in advance, bts

Unable to deploy solution,getting "The OutputPath property is not set for project " error


Hi Guys,

I am having this configuation issue which I can't seem to resolve. When I am deploying my SP2010 solution to my farm Ii ge thi error mesage when I deploy a solution which contains output dll references.

Error 1 The OutputPath property is not set for project 'XXX.SharePoint2010.KnowledgeBase.Helper.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='AnyCPU'.  This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. KnowledgeBaseSite

Any help would be appreciated.



SharePoint Developer
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend