PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

Deployment of source code?

 
 
Scott M.
Guest
Posts: n/a
 
      22nd Apr 2010
I thought I understood this, but I guess not.

In ASP .NET 3.5, using VS 2008 Pro. and working with Web Applicaiton
Projects (NOT WEB SITES) that use the code-behind model, I was under the
impression that deployment of the .aspx files and the pre-compiled .dll in
the /bin folder was all that is needed. As far as I can remember, this is
what I've been doing since ASP.NET's inception.

But, now I've switched hosting providers and am starting fresh by uploading
only the files needed for the site to function. I've built my project in
release mode and used the Publish feature with "Only files needed to run this
applicaiton" selection turned on. As expected, only my .aspx, web.config,
global.asax, and /bin directory (with my compiled .dll in it) are deployed.
But, now I'm getting errors when I try to access the .aspx pages that say
that the referenced CodeFile cannot be found.

Again, to be clear, I'm NOT using Web Site, this is an ASP.NET Web
Application Project that is built locally and I just want to deploy the .aspx
pages but not the source code. I'm sure this is what I've done in the past.

I've tried taking the CodeFile="" portion out of the @Page directive line,
but then I get an error saying that an instance of that page's class could
not be made.

What gives?
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      22nd Apr 2010


"Scott M." <s-(E-Mail Removed)> wrote in message
news:B43A5666-28C2-41A7-9245-(E-Mail Removed)...
> I thought I understood this, but I guess not.
>
> In ASP .NET 3.5, using VS 2008 Pro. and working with Web Applicaiton
> Projects (NOT WEB SITES) that use the code-behind model, I was under the
> impression that deployment of the .aspx files and the pre-compiled .dll in
> the /bin folder was all that is needed. As far as I can remember, this is
> what I've been doing since ASP.NET's inception.
>
> But, now I've switched hosting providers and am starting fresh by
> uploading
> only the files needed for the site to function. I've built my project in
> release mode and used the Publish feature with "Only files needed to run
> this
> applicaiton" selection turned on. As expected, only my .aspx, web.config,
> global.asax, and /bin directory (with my compiled .dll in it) are
> deployed.
> But, now I'm getting errors when I try to access the .aspx pages that say
> that the referenced CodeFile cannot be found.
>
> Again, to be clear, I'm NOT using Web Site, this is an ASP.NET Web
> Application Project that is built locally and I just want to deploy the
> .aspx
> pages but not the source code. I'm sure this is what I've done in the
> past.
>
> I've tried taking the CodeFile="" portion out of the @Page directive line,
> but then I get an error saying that an instance of that page's class could
> not be made.
>
> What gives?


What gives? Without the page class, you only have a partial class that is
the tags being rendered. So, without an actual class definition, it screams
at you.

To deploy without source, right click on the web project and choose publish.
Then choose a folder to publish to. You can then deploy the compiled
solution from that point. It will compile the code into DLLs and NOT include
the code behind files.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************

 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      22nd Apr 2010


"Gregory A. Beamer" wrote:

>
>
> "Scott M." <s-(E-Mail Removed)> wrote in message
> news:B43A5666-28C2-41A7-9245-(E-Mail Removed)...
> > I thought I understood this, but I guess not.
> >
> > In ASP .NET 3.5, using VS 2008 Pro. and working with Web Applicaiton
> > Projects (NOT WEB SITES) that use the code-behind model, I was under the
> > impression that deployment of the .aspx files and the pre-compiled .dll in
> > the /bin folder was all that is needed. As far as I can remember, this is
> > what I've been doing since ASP.NET's inception.
> >
> > But, now I've switched hosting providers and am starting fresh by
> > uploading
> > only the files needed for the site to function. I've built my project in
> > release mode and used the Publish feature with "Only files needed to run
> > this
> > applicaiton" selection turned on. As expected, only my .aspx, web.config,
> > global.asax, and /bin directory (with my compiled .dll in it) are
> > deployed.
> > But, now I'm getting errors when I try to access the .aspx pages that say
> > that the referenced CodeFile cannot be found.
> >
> > Again, to be clear, I'm NOT using Web Site, this is an ASP.NET Web
> > Application Project that is built locally and I just want to deploy the
> > .aspx
> > pages but not the source code. I'm sure this is what I've done in the
> > past.
> >
> > I've tried taking the CodeFile="" portion out of the @Page directive line,
> > but then I get an error saying that an instance of that page's class could
> > not be made.
> >
> > What gives?

>
> What gives? Without the page class, you only have a partial class that is
> the tags being rendered. So, without an actual class definition, it screams
> at you.
>
> To deploy without source, right click on the web project and choose publish.
> Then choose a folder to publish to. You can then deploy the compiled
> solution from that point. It will compile the code into DLLs and NOT include
> the code behind files.
>
> --
> Peace and Grace,
> Greg
>
> Twitter: @gbworld
> Blog: http://gregorybeamer.spaces.live.com
>
> ************************************************
> | Think outside the box! |
> ************************************************


Unfortunately, the Publish option doesn't work as you describe.

I get that there are partial classes and that not deloying the .vb codefile
means that part of the class definition is missing, but that shouldn't matter
if I'm deploying my application assembly (.dll) because the entire class
definition is in that.

When I choose Publish and select "Only files needed to run the application"
the published files do not include source code files (as I expect and want),
but when you try to call one of the .aspx files, I get a message saying that
the codefile cannot be found.

I've tracked this down to the change from the older "CodeBehind" attribute
to the new CodeFile attribute. It seems that when working with the
codebehind model, but utilizing the "CodeFile" attribute, source code MUST be
deployed along with the other files, but if you put all your code back into
one code-behind, remove the "partial" keyword, and change "CodeFile" to
"CodeBehind" that you can deploy just the .aspx pages and the assembly in the
/bin folder.

-Scott
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Source Code Control and ASP.NET Web Deployment project Leo Violette Microsoft ASP .NET 2 9th May 2009 07:51 AM
Software deployment change source naqoyqatsi.04@gmail.com Microsoft Windows 2000 Group Policy 2 7th Sep 2005 09:24 AM
Source control and Deployment =?Utf-8?B?QW5keQ==?= Microsoft ASP .NET 1 17th Jun 2005 04:46 PM
Source control and deployment =?Utf-8?B?QW5keQ==?= Microsoft ASP .NET 2 17th Jun 2005 01:09 AM
iexplorer shows source code instead source code's output, i.e., the actual page Michael Windows XP Internet Explorer 0 17th Sep 2003 02:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:35 AM.