473,611 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Single DLL - How to get rid of ASPX files?

I'm using a Web Deployment Project under Visual Studio 2005.

What I would love to be able to deploy to a fresh server is just the \bin
folder and the web.config (and perhaps a couple of other support files). But
essentially I don't want to have to deploy all the ASPXs, images, .js etc.

Is there a way to achieve this?

I seem to remember some sort of special ASP.NET marker file you could put in
the application root which would tell it to get all the ASPX content from the
DLL. Did I dream it?

Thanks,
- Boris Y
Oct 25 '06 #1
18 8359
The ASPX files, with a dll compile, are placeholders. If they are not there,
you get a 404. If they are, the DLL has smarts to find the pointer in code.
It is an unfortunate side effect. AFAIK, if you want to completely get rid
of them, you would need to create your own handler that redirects the 404.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"Boris Yeltsin" <bo****@nospam. nospamwrote in message
news:2A******** *************** ***********@mic rosoft.com...
I'm using a Web Deployment Project under Visual Studio 2005.

What I would love to be able to deploy to a fresh server is just the \bin
folder and the web.config (and perhaps a couple of other support files).
But
essentially I don't want to have to deploy all the ASPXs, images, .js etc.

Is there a way to achieve this?

I seem to remember some sort of special ASP.NET marker file you could put
in
the application root which would tell it to get all the ASPX content from
the
DLL. Did I dream it?

Thanks,
- Boris Y

Oct 25 '06 #2
"Boris Yeltsin" wrote:
What I would love to be able to deploy to a fresh server is just the \bin
folder and the web.config (and perhaps a couple of other support files). But
essentially I don't want to have to deploy all the ASPXs, images, .js etc.

Is there a way to achieve this?
Yes, open a command prompt and cd to your 2.0 framework folder (something
like C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 ) and use
aspnet_compiler .exe, like this:

aspnet_compiler .exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder

You can then copy the contents of C:\OutputFolder to the virtual directory
/VirtualDirName on your IIS server. Remember to make sure the virtual
directory is set to use v2 of the .net framework, or you'll just get
placeholder text (as all the aspx files still exists, they are just blank)

Oct 25 '06 #3
OK, this is similar to the standard publish function. It's almost there though.

Some issues:

1) There are assemblies (DLLs) for each file in the bin folder, not just a
single DLL for the web site

2) My external resources (Images, JavaScript files) are not compiled into
the DLL

So, if we can find solutions to these, we'll be rocking!

Thank you,
- Boris Y

"Leon Mayne" wrote:
"Boris Yeltsin" wrote:
What I would love to be able to deploy to a fresh server is just the \bin
folder and the web.config (and perhaps a couple of other support files). But
essentially I don't want to have to deploy all the ASPXs, images, .js etc.

Is there a way to achieve this?

Yes, open a command prompt and cd to your 2.0 framework folder (something
like C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 ) and use
aspnet_compiler .exe, like this:

aspnet_compiler .exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder

You can then copy the contents of C:\OutputFolder to the virtual directory
/VirtualDirName on your IIS server. Remember to make sure the virtual
directory is set to use v2 of the .net framework, or you'll just get
placeholder text (as all the aspx files still exists, they are just blank)
Oct 25 '06 #4
the default compile is a dll per page. ms has a utility to merge them into
one dll. you can get rid of images by inserting them into a resource, and
changing all reference to a resource reference (though there is a
performance cost for having asp.net serve images rather than iis)

-- bruce (sqlwork.com)

"Boris Yeltsin" <bo****@nospam. nospamwrote in message
news:17******** *************** ***********@mic rosoft.com...
OK, this is similar to the standard publish function. It's almost there
though.

Some issues:

1) There are assemblies (DLLs) for each file in the bin folder, not just a
single DLL for the web site

2) My external resources (Images, JavaScript files) are not compiled into
the DLL

So, if we can find solutions to these, we'll be rocking!

Thank you,
- Boris Y

"Leon Mayne" wrote:
>"Boris Yeltsin" wrote:
What I would love to be able to deploy to a fresh server is just the
\bin
folder and the web.config (and perhaps a couple of other support
files). But
essentially I don't want to have to deploy all the ASPXs, images, .js
etc.

Is there a way to achieve this?

Yes, open a command prompt and cd to your 2.0 framework folder (something
like C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 ) and use
aspnet_compile r.exe, like this:

aspnet_compile r.exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder

You can then copy the contents of C:\OutputFolder to the virtual
directory
/VirtualDirName on your IIS server. Remember to make sure the virtual
directory is set to use v2 of the .net framework, or you'll just get
placeholder text (as all the aspx files still exists, they are just
blank)

Oct 25 '06 #5
OK, let's take this one step at a time. We'll worry about the resource file
issue afterwards.

I've run:
aspnet_compiler .exe -v /VirtualDirName -p C:\ProjectPath C:\OutputFolder

So now I have a project which has no ASPX files, a whole lot of .dll and a
whole lot of .compiled files in the \bin folder. Works great.

So, now I run:
aspnet_merge.ex e C:\OutputFolder -o MyProject

And that creates a single .dll from all the .dll files in the \bin.

I still have a huge supply of .compiled files in the \bin though (one for
every ASPX).

What can I do about these?

Thanks,
Boris Y
Oct 25 '06 #6
Hi Boris,

The .Compiled file is a marker file for each page and control in the Web
site and identifies the class used inside of the assembly. These files are
not optional as they map the ASPX pages to the appropriate precompiled
classes in the precompiled assemblies. If you remove the .Compiled file,
the page that it maps will not be able to execute and you get an execution
error.

However, you could remove the .ASPX file marker file if you're not using
Windows Authentication. If you need to set specific Windows file rights on
a directory or specific file, an actual file must exist in order for
Windows Authentication to work. If you don't use Windows Authentication in
your Web application, these marker files can be removed and you can run
entirely off the files in the BIN directory.

You can find an excellent article about ASP.NET Compilation and Deployment
here:

#Compilation and Deployment in ASP.NET 2.0
http://west-wind.com/presentations/A...ompilation.asp

Please let me know if you need further information about this or how to
embed resource files and javascript files in your assembly too.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

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

Oct 26 '06 #7
Thanks for the reply and explanation Walter.

I'm not using Windows Auth, so I've removed all the ASPX files and am just
left with all the external resources (CSS, JS, images etc).

If I used embedded resource files, would the output be cachable so that it
wouldn't have to be processed through the entire ASP.NET chain on every
request?

I'm cautious about changing something which is just a very simple static
file into something that could massively increase IIS overheads.

Let me know...

Many thanks,
Boris Y

"Walter Wang [MSFT]" wrote:
Hi Boris,

The .Compiled file is a marker file for each page and control in the Web
site and identifies the class used inside of the assembly. These files are
not optional as they map the ASPX pages to the appropriate precompiled
classes in the precompiled assemblies. If you remove the .Compiled file,
the page that it maps will not be able to execute and you get an execution
error.

However, you could remove the .ASPX file marker file if you're not using
Windows Authentication. If you need to set specific Windows file rights on
a directory or specific file, an actual file must exist in order for
Windows Authentication to work. If you don't use Windows Authentication in
your Web application, these marker files can be removed and you can run
entirely off the files in the BIN directory.

You can find an excellent article about ASP.NET Compilation and Deployment
here:

#Compilation and Deployment in ASP.NET 2.0
http://west-wind.com/presentations/A...ompilation.asp

Please let me know if you need further information about this or how to
embed resource files and javascript files in your assembly too.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

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

Oct 26 '06 #8
Hi Boris,

The embedded web resource will be cached. You can find more information
here (look for the "Perf" section):

#Nikhil Kothari's Weblog : Whats with System.Web.UI.W ebResourceAttri bute
http://www.nikhilk.net/WebResourceAttribute.aspx

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

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

Oct 27 '06 #9
Thanks Walter, Nikhil's page was very helpful.

My next question is this:

All the examples of using WebResource seem to imply that you need to create
a separate Class Library project for the resources.

Currently I'm using the "Web Site Project" model.

Is there anything I can do from the UI or even from custom build flags etc
that would allow me to simply embed the resources I already have in the
project?

e.g. I just have a file in the root of the web project called "logo.gif".
And I want that to stay in the project but get compiled in as a resource
which I could then refer to as WebResource("My WebProject.logo .gif").

Let me know...

Thanks,
Boris

"Walter Wang [MSFT]" wrote:
Hi Boris,

The embedded web resource will be cached. You can find more information
here (look for the "Perf" section):

#Nikhil Kothari's Weblog : Whats with System.Web.UI.W ebResourceAttri bute
http://www.nikhilk.net/WebResourceAttribute.aspx

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

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

Oct 27 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
10509
by: BPearson | last post by:
Hello I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to do this? (IIS 5 or 6 In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common configuration information. I'd like to ease some administration by having one...
10
2305
by: Tim Mulholland | last post by:
My company is about to begin working on an ASP.NET application. There are going to be two primary developers working on this project. It will be a fairly deep project (lots of lines of code) but not a very wide project (pretty much limited to a few purposes, not many ways to split it up). I've done alot of ASP.NET development before by myself so writing the application shouldn't be an issue, but my question is this: How do multiple...
2
1810
by: Holger (David) Wagner | last post by:
Hi all, I'd like to have several "skins" for an application that are "structurally different" (i.e. controls at different locations, some controls visible only in a particular "skin"). The application is implemented with a single default.aspx which loads a couple of ascx-Controls (navigation, contents depending on parameter and so on). Now, an obvious approach is simply duplicating the ascx-Files into an own directory structure which...
7
2153
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user using the application needs to see their own data only. My problem is that when multiple users are in the application, when in the session object, data is fine, however as there is only one instance of the class files, when data is put into them,...
0
1395
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not REDIRECT to the first domain). Example: http://www.maindomain.com (main hosted package) http://www.subdomain1.com -> www.maindomain.com/subdomain1/ http://www.subdomain2.com -> www.maindomain.com/subdomain2/
3
2069
by: Claudio Pacciarini | last post by:
Hi everyone, I have a question about .NET code sharing and reuse, and also about application design best practices / guidelines. Currently, we have many different .NET projects in source depot. Although they are different, in some of them we share C# code by referencing source files that are external (not part of the projects) on each project. For instance, some of our projects have the typical “sources” file with:
2
1876
by: dan_williams | last post by:
I am working with an asp.net 1.1 web application. Do I have to rebuild the whole application and deploy the compiled DLL to my production server everytime I modify a single aspx page? Is there a way to not re-compile (or rebuild) the whole application every time a single page is modified? We do use CVS for our version control, but there's always a doubt that I have the latest code.
1
1607
by: archana | last post by:
Hi all, I am confuse regarding concept of code behind model and single file model.. I have heard that single file model compiles dynamically. suppose i have application in which i am having one aspx page and its equivalent cs file i completed my application and deployed dll and aspx page.
3
17237
by: Kerem Gmrkc | last post by:
Hi, until today i always forced users to download/install the complete package of the Microsoft Visual C++ 2008 Redistributable Package (x86), but mostly my applications only need the msvcr90.dll to run. So my question here is if i can pack this file into my installer and redistribute it with my application. For my case it would be just fine if the dll would be in the same directory as the app is.
0
8149
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8097
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8561
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8240
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8411
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7038
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4108
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2546
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.