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 th
e
DLL. Did I dream it?
Thanks,
- Boris YThe 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" <borisy@.nospam.nospam> wrote in message
news:2A7E1017-7FDA-41C9-A155-B792A50355F7@.microsoft.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
"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). B
ut
> 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\Microsoft.NET\Framework\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)
OK, this is similar to the standard publish function. It's almost there thou
gh.
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:
> Yes, open a command prompt and cd to your 2.0 framework folder (something
> like C:\WINDOWS\Microsoft.NET\Framework\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)
>
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" <borisy@.nospam.nospam> wrote in message
news:173C5915-8132-4123-B278-E1DE6B83B345@.microsoft.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:
>
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.exe 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
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/...Compilation.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 (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.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/subscript...t/default.aspx.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
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/...Compilation.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 (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> [url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/ur
l]
> 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 repl
y
> 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/subscript...t/default.aspx.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
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.WebResourceAttribute
http://www.nikhilk.net/WebResourceAttribute.aspx
Regards,
Walter Wang (wawang@.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.
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("MyWebProject.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.WebResourceAttribute
> http://www.nikhilk.net/WebResourceAttribute.aspx
> Regards,
> Walter Wang (wawang@.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
.
>