Changing Multiple Web Applications into a Single Web App (with multiple project files)

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Sat, 23 Mar 2002 07:12:43



What is the conventional wisdom here?
Assume the following:

http://localhost/MyApp
http://localhost/MyApp/AnotherApp
http://localhost/MyApp/YetAnotherApp

They exist as virual directories as follows:
c:\MyApp
c:\MyApp\AnotherApp
c:\MyApp\YetAnotherApp

Each of these are c# web application projects. Now I want to combine them
into a single web application under MyApp. What are the steps?

I've missed something in my attempts to make this work (see Message-ID:

Date: Thu, 21 Mar 2002 01:16:43 -0500 ).

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Colin Youn » Sat, 23 Mar 2002 23:07:25


Basically you go into the IIS manager and edit the properties for each
application and remove the "application" from each one. You will still be
able to open them in VS.NET, but they will all be under the same web
application. MS does have a KB article about this procedure, but I don't
know if they have posted it yet. Note that all new projects you create will
be applications and you will need to take the same steps for those.

Colin


> What is the conventional wisdom here?
> Assume the following:

> http://localhost/MyApp
> http://localhost/MyApp/AnotherApp
> http://localhost/MyApp/YetAnotherApp

> They exist as virual directories as follows:
> c:\MyApp
> c:\MyApp\AnotherApp
> c:\MyApp\YetAnotherApp

> Each of these are c# web application projects. Now I want to combine them
> into a single web application under MyApp. What are the steps?

> I've missed something in my attempts to make this work (see Message-ID:

'x.y.z.MyClass'
> Date: Thu, 21 Mar 2002 01:16:43 -0500 ).


 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Sat, 23 Mar 2002 23:24:12


Yes Colin, that would be the first step. The next step would be to remove
the Gobal.asax (and supporting code-behind/resource) files in each
sub-directory. Apparently, removing the web.config file in each
sub-directory is optional as the configuration can be overridden with local
copies of the web.config file. This is what I've already done to date, and
it still does not work (see my posting Message-ID:

'x.y.z.MyClass'"
Date: Thu, 21 Mar 2002 01:16:43 -0500 ). I only have one web.config and one
Global.asax(.*) in the web app. Each sub-directory has html files which are
server up properly, but the dynamic *.aspx(.*)  files do not run (see my
other thread for details).

Thanks for taking a stab at it, though.

-Roy

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Tess Norlander ( » Sun, 24 Mar 2002 01:19:34


Hi Roy,

Try these steps to merge the subwebs:

1. Close out the parent solution if you have it open in visual studio
2. In IIS remove the subwebs application status
3. Remove the following files from the subweb
        ServerExtensions directories
                _vti_cnf
                _vti_pvt
                _vti_script
                _vti_txt
        ProjectFile    
                .csproj or .vbproj
        AssemblyInfo.cs or AssemblyInfo.vb
        Global.asax files      
                Global.asax
                Global.asax.cs/vb
                Global.asax.resx
        Web.config
        bin directory
        webinfo file
        vsdisco file
4. Open the parent project
5. Click on the View all files button
6. Select all directories and choose include in project from the context
menu
7. Build the project

Hope this helps
Tess

This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Sun, 24 Mar 2002 01:44:49


Hello Tess,

Are you saying that multiple vstudio projects are not supported in a web application? What about the article
HOW TO: Create an ASP.NET Application from Multiple Projects for Team Development (Q307467)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q307467&GSSNB=1

I was hoping to keep the .vcproj files so there would be many smaller assemblies instead of one big one. The article describes
Creating the ASP.NET App from scratch; I'm trying to modify an existing set of projects. I was hoping someone could point out the
difference(s) without me having to re-create all the projects.

-Roy

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Colin Youn » Sun, 24 Mar 2002 03:04:44


Umm, yeah... sorry about that. It's become an automatic response for me so I
sometimes forget what all the steps are. What I have found is that the
individual subdirectories also have a /bin directory where all their DLLs
go. You need to copy those into the /bin directory of the "root" web. It's a
PITA during development.

Also, I usually strip most of the information from the web.config file and
only include those that I wish to override in the subdirectory.

Colin


> Yes Colin, that would be the first step. The next step would be to remove
> the Gobal.asax (and supporting code-behind/resource) files in each
> sub-directory. Apparently, removing the web.config file in each
> sub-directory is optional as the configuration can be overridden with
local
> copies of the web.config file. This is what I've already done to date, and
> it still does not work (see my posting Message-ID:

> 'x.y.z.MyClass'"
> Date: Thu, 21 Mar 2002 01:16:43 -0500 ). I only have one web.config and
one
> Global.asax(.*) in the web app. Each sub-directory has html files which
are
> server up properly, but the dynamic *.aspx(.*)  files do not run (see my
> other thread for details).

> Thanks for taking a stab at it, though.

> -Roy

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Tess Norlander ( » Sun, 24 Mar 2002 04:27:46


Hi Roy,

I'm sorry I think I misunderstood your question a bit. I thought you wanted
to merge the projects to create
one big project to handle in visual studio.

If you want to see all the projects at once in visual studio, you can open
up the solution for the parent web
in Visual Studio and rightclick on it to add existing projects and open the
subweb projects in there.

The of course you would remove the application setting and the web.config
and global.asax (it is not necessary to
remove neither of these but it gives it a cleaner look because global.asax
simply wont execute without the app setting
and the default web.config contains some sections that are only valid at an
application root level)

If you do this and build one of the sub apps, or try to view an aspx page
in the subapps you will get the error you described.

----------------------------------------------------------------------------
-------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not load type 'child1.WebForm1'.

Source Error:


AutoEventWireup="false" Inherits="child1.WebForm1" %>
Line 2:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
Line 3:  

Source File: f:\inetpub\wwwroot\parentweb\child1\WebForm1.aspx    Line: 1
----------------------------------------------------------------------------
-------------------------------------------------------------------------

This is because it will now look for child1.dll in the parents bin
directory, whereas the output directory for the child1 project (in my case)
is
underneath parentweb\child1\bin. So what you need to do is go into the
parent project and set project references to the child projects which will
copy the dlls down to the parents bin directory. After that the pages
should work since it can find the child1.WebForm1 at that point.

Hope this helps

Thanks
Tess

This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Thu, 28 Mar 2002 06:13:46


Thanks for the help, Tess, but my problem has not been solved by your suggestion :-(

I've set up a Web application root (with a global.asax and web config). The web.config has no modifications from the starting
template that VStudio gave me. The global.asax contains an instance of a class factory initialized in it's constructor. Otherwise,
no modifications.

Each of the subdirectories contain c# projects. The web application root contains references to each of these projects. It compiles
cleanly with VStudio, but croaks when the page is compiled to native code when it is served the first time by IIS.

In the error page snippet below '/EpsilonHome' is the web app root project. I'm trying to load
'http://localhost/EpsilonHome/Samples/SampleData.aspx'. The error message is as follows:

Server Error in '/EpsilonHome' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following
specific error details and modify your source code appropriately.

Compiler Error Message: CS1595: 'Com.DadeBehring.Epsilon.UserInterface.Web.Samples.SampleData' is defined in multiple places; using
definition from 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\epsilonhome\d8792c82\ed2a958a\tfa7gzgl.dll'

Source Error:

Line 27:
Line 28:     [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 29:     public class SampleData_aspx : Com.DadeBehring.Epsilon.UserInterface.Web.Samples.SampleData,
System.Web.SessionState.IRequiresSessionState {
Line 30:
Line 31:

Source File: C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\epsilonhome\d8792c82\ed2a958a\waytfm--.0.cs    Line:
29

I tried deleting C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\*.*, all the web project bin and obj
directories, the VSWebCache contents, then rebuilt everything, but I got the same result.

Each project has its own bin dir it uses for output. I suppose by adding the references to each sub-project from the Web
applicatrion root it copies the assemblies from the sub-project bin\debug folders up to the web app root\bin\debug folder.

How can I fix this error?

-Roy

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Tess Norlander ( » Fri, 29 Mar 2002 00:56:55


Roy,

This error message usually appears when you mix and match src and
codebehind attributes for pages.
Do you use both of these in your projects?

Thanks
Tess

This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Fri, 29 Mar 2002 07:32:40



| Roy,
|
| This error message usually appears when you mix and match src and
| codebehind attributes for pages.
| Do you use both of these in your projects?

Not intentionally, but yes, I did. I'm guessing the codebehind attribute is a deprecated artifact from the Beta2 compiler as it no
longer seems to be documented anywhere. I've since replaced every instance of codebehind="..." to Src="...".  Now I'm getting the
same error earlier up in the food chain:

Server Error in '/EpsilonHome' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following
specific error details and modify your source code appropriately.

Compiler Error Message: CS1595: 'Com.DadeBehring.Epsilon.UserInterface.Web.EpsilonHome.Global' is defined in multiple places; using
definition from 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET
Files\epsilonhome\d8792c82\ed2a958a\assembly\dl\f2ecf531\0ca9084a_dcd5c101\Com.DadeBehring.Epsilon.UserInterface.Web.EpsilonHome.DLL
'

Source Error:

Line 26:
Line 27:     [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 28:     public class Global_asax : Com.DadeBehring.Epsilon.UserInterface.Web.EpsilonHome.Global {
Line 29:
Line 30:         private static bool __intialized = false;

Source File: C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\epsilonhome\d8792c82\ed2a958a\etodicfq.0.cs    Line:
28

To try and solve this, I deleted each web project's bin directory contents. Then I deleted the VSWebCache contents. Then I deleted
the contents of 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\epsilonhome\*.*'. Finally I fired up VStudio,
recompiled everything, and loaded up the web app in the browser. Static pages look fine. All dynamic pages generate this same error.
I looked in all the folders under 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\epsilonhome and found only one
instance of Com.DadeBehring.Epsilon.UserInterface.Web.EpsilonHome.DLL exactly where the error message says it is. Where else is it
looking for this DLL?

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Sat, 30 Mar 2002 03:59:45


Tess-

I'm re-creating a subset of my Web App to better understand this. When I created the Web Application root, VStudio created the
following contents for the Global.asax file:


Where is the Codebehind attribute defined in the docs? I'm looking at MSDN Jan 2002 and it only mentions two attributes supported by

  Description
  A text description of the application. This value is ignored by the ASP.NET parser and compiler.
  Inherits
  The name of the class to extend. Defines a code-behind class for the application to inherit. Can be any class derived from the
HttpApplication class.

bogus template for me? Should I delete the Codebehind in the Global.asax file or change it to a Src attribute or delete the
codebeind attribute entirely?

-Roy

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Michael Graham ( » Sat, 30 Mar 2002 05:09:23


Hi Roy,

Tess and I are right next to each other.  I'm going to close out this
thread (internally - it will still be seen by others), and
we're going to work on the other thread together, so you just need to reply
to that one.  I hope that's OK...


This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Roy Mulle » Sat, 30 Mar 2002 06:06:00


That is fine with me, Michael :-)

Thanks Tess. You've got me heading down the right path. I've found a solution. I
guess I'll reveal my solution here and in the other thread (with proper context).


code-behind files use the default name of Filename.aspx.cs so this seemed
intuitive. My Global.asax file still has the undocumented Codebehind

had to assume this might be correct.

I'm setting project references in the Root web app to each sub-dir project so
that all dlls are copied to the Root web app bin directory.

I wish I had tried this last week :-(

Thanks again for your help.

 
 
 

Changing Multiple Web Applications into a Single Web App (with multiple project files)

Post by Tess Norlander ( » Sat, 30 Mar 2002 23:10:18


Thats great Roy,

I'm very happy you got it working.

Tess

This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

1. Multiple web projects in one Web App Root (Q307467)

Has anybody gotten Q307467 to work when trying to create
1 or more web projects as "sub-projects" of the main web
application?  I have had this working before, but it was
in a pre-release version of .Net..  (Maybe something
changed for RTM??)

We have followed all the steps listed under the
heading: "Make Multiple Visual Studio .NET Projects
Participate in the Same Web Application" and we get the
following error:

Server Error in '/MainWeb' Application.
----------------------------------------------------------
----------------------

Parser Error
Description: An error occurred during the parsing of a
resource required to service this request. Please review
the following specific parse error details and modify
your source file appropriately.

Parser Error Message: Could not load type 'Sub1.WebForm1'.

Source Error:


Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="Sub1.WebForm1" %>
Line 2:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN" >
Line 3:  <HTML>

Source File: c:\inetpub\wwwroot\MainWeb\Sub1
\WebForm1.aspx    Line: 1

----------------------------------------------------------
----------------------
Version Information: Microsoft .NET Framework
Version:1.0.3705.209; ASP.NET Version:1.0.3705.0

If we put the Sub1 project back as it's own application
in IIS Admin, then it works.  Also, if we change the
Inherits="Sub1.WebForm1" to
Inherits="System.Web.UI.Page"  Then the error also goes
away, but of course our page code in our codebehind never
gets called.  It is like it is having problems accessing
the types in the assembly, but it never fails to load the
assembly.  FusLogVw (set to asp.net) never logs any
errors loading the assembly..  Is there a step missing??

Thanks.

Paul

2. Help! Microphone Input Jack Port #?

3. Can forms authenication be used for multiple web apps with a single login ?

4. Who knows a useful API Reference?

5. Urgent - problem with multiple web.config files in one web application

6. Portmaster/Qube/other stuff

7. Single Web Service vs. Multiple Web Services

8. Tandy lt1400

9. .Net 3.5 Web App. Writing multiple text files in one run fails

10. Help: How to download multiple files from asp.net web application server to local machine.

11. Is it possible to deploy multiple WinForm applications as a single application?

12. Multiple Adapters for Multiple Tables in a single Dataset?

13. .Net Webservices - Multiple Public Classes in a single Web Service?