3

is it possible to deploy all codebehind files to a webapplication in addition to all resource files in the bin folder. In such a manner that it will generate the website binary dynamically similarly to how a website works?

We have a asp.net 4.5 vb.net webforms application which we would like to deploy to certain customers in uncompiled mode so custom changes can be made. Is this possible? and if so what is it in either the IIS metadata or the web.config e.t.c. which tells IIS that it should generate the binary itself?

Update typo webforms not winforms :)

Tim
  • 7,401
  • 13
  • 61
  • 102
  • "winforms application". Typo? – Jon Egerton Feb 20 '14 at 12:11
  • http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/determining-what-files-need-to-be-deployed-cs – Steve Feb 20 '14 at 12:42
  • @Steve have read through that but i'm still not sure what it is which "tells" the website/application to re/compile or to expect a binary. I've tried deleting the binary from the bin folder and my webapplication gives a YSOD "Could not load type 'Global_asax'." – Tim Feb 20 '14 at 13:42

2 Answers2

2

A "Web Application" project cannot be deployed like this, however a "Web Site" project can. Have a look at the differences between the two here:

http://msdn.microsoft.com/en-us/library/dd547590(v=vs.110).aspx

Much more information on this subject is contained in this SO question: ASP.NET Web Site or ASP.NET Web Application?

Community
  • 1
  • 1
Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
  • yeah i was wondering what it was that tells iis this? and if it was a web.config setting or not. – Tim Feb 20 '14 at 13:28
  • or will a website always need the codefiles to recompile and a webapplication always need a compiled binary? – Tim Feb 20 '14 at 13:44
0

I came across this post while looking information for pros and cons of using this specific way of deployment as I have been doing this myself for quite sometime now. This can be possible if you deploy both your .cs file and .aspx files in the website folder but make sure your .aspx file is directed to .cs file instead of dll file while running. I have been doing this for sometime, where I need some features customization for client and use code file for that specific page only.

aspx file:

<%@ page title="" language="C#" masterpagefile="~/School/MasterPage.master" autoeventwireup="true" CodeFile = "academicdashboard.aspx.cs"inherits="School_AcademicDashboard" %>

code file:

public partial class School_AcademicDashboard 
HK boy
  • 1,398
  • 11
  • 17
  • 25
A Bhandari
  • 13
  • 3