question about using multiple asp.net projects for a web site

G

Guest

I have broken up my web site into smaller web site projects. When I look at
the precompiled files, it always has the virtual directory in them ie:

<preserve resultType="3" virtualPath="/Security/DefaultLogin.aspx"
hash="fde4916e6" filehash="ffffe84d717a4765" flags="110000"
assembly="App_Web_-xo1n4yg" type="ASP.defaultlogin_aspx">
<filedeps>
<filedep name="/Security/DefaultLogin.aspx" />
</filedeps>
</preserve>

The /security - how can I get the compile/system to pre-compile without the
virtual path ie "/security"

Also, is it possible to break a web site up into smaller units and combine
this units to make a bigger site? If so, where is the documentation on the
recommended way to do it?

Thanks

Eric
 
J

Juan T. Llibre

There are three approaches you could use:

1) The VS 2005 Web Deployment Project. This includes the aspnet_merge.exe utility
that will merge assemblies into a single well named assembly. This is what you'd want
to use if you want to use the VS 2005 Web Site Project option and generate a single
named assembly :

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

2) The VS 2005 Web Application Project. This provides a VS 2003-like compilation model
where the project always gets compiled into a single assembly. Here is a tutorial that walks
through how to-do this with the current preview:

http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx

3) You can use either the publish web or aspnet_compiler MSBuild task with the released
VS 2005 and generate fixed name assemblies that are updatable (which means that .ascx files
are preserved).

This blog post walksthrough how to-do this:

http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx
 
G

Guest

If we were to use option 1. Would we build each of our asp.net web projects
into separate named assemblies?

I used the IDE to publish the web sites, but it sounds like I would use the
option of creating a named assembly for each of our web projects?

What we are attempting to do, is if a set of web pages change, we only want
to move those modified webpages up to the production server while leaving the
rest of the web site alone.

Say we have 20 pages, which are divided into 5 projects. We would build the
5 projects and copy these assembies up to our prod web site. Later if one of
the projects changes, we would rebuild this project and copy it back up to
the prod server. Is this correct?

Thanks

Eric
 
S

Steven Cheng[MSFT]

Hi Eric,

All of the options Juan has posted in his message is based on single web
project, the aspnet_compiler or aspnet_merge tool all precompile single
website's source files and UI components into different assemblies. If
you've separated a single website into multiple website, I'm afraid those
option(like web deployment project) won't work.

Generally, we just consider for a single web site web application, then we
can use the Web Deployment Project to help make the whole precompiled
website has only one assembly which contains all the precompiled web UI
component classes and other helper classes.... For detailed mechanism of
the asp.net 2.0 precompilation and the web deployment project, see the
articles linked in the following page:

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

I think I understand that the developers only looked at a single web site as
a single web application.

What I am talking about is a single web site, single web application made up
of multiple VS.Net web projects. In the end I want a single web site, single
web application made up of multiple VS.NET web projects compiled into
multiple assemblies stored in the bin directory of the single web site. The
bin directory would contain multiple assemblies storing the source code of
our application components. Is this possible with option number 1 of Juan's
options?

Thanks

Eric
 
S

Steven Cheng[MSFT]

Thanks for the response Eric,

I think this is just the problem here.

As you mentioned, in your case there're multiple vs 2005 web projects
making up of a single website. However, the precompilation of the VS
2005(aspnet_compiler) or web deployment project(aspnet_merge) is targeting
a single web project(not a logical site in your scenario. So if you want
to build a single assembly for your whole site, you need to do the
precompilation after you've intergrated all those seprate vs 2005 web
projects into single main web project, then use the options mentioned in
previous message on that single project.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

Hi Steven,

Can you have multiple compiled assemblies make up a web site? If so, it
looks like the best way would be to make them updateble. Is this the correct
assumption. What I do not want to do is to make one giantic assembly for the
web site.

Instead we are attempting to make smaller assemblies that will make up the
whole web site. Is this possible under VS 2005?

Thanks

Eric
 
S

Steven Cheng[MSFT]

Thanks for your response Eric,

Well, I've got that what you want is make the whole website separated into
multiple parts and precompiled them into separate assemblies rather than
generate a single too huge one. I'm afraid this not supported by the
current precompilation model. The current precompiler will perform the
precompilation based on project/website level. So when precompiling the
website, it'll build some application scope data and helper
classes(internal use) into the precompiled assembly, if we separate one
web site project into multiple ones and precompile the separately, I'm
afraid there will cause those assemblies contains duplicate items which
will conflict with one another. In addition ,the path problem you mentioned
is also one of the potenital issues.

Currently I think the "merge each individual folder output to its own
assembly" option of the "Web Deployment Project" may be one possible
workaround, this can help make each sub folder( the page or resources in
it) in the applicaiton be precompiled into a separate assembly.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top