Last post Feb 13, 2009 03:25 AM by hansmeiser
Feb 09, 2009 08:25 PM|hansmeiser|LINK
When you create a Web Site Project in VS2008 and add a Web Deployment Project you can choose to create a single output assembly and leave the aspx and ascx files updateable.
In this scenario you can deploy your unfinished Web Site to a Webdesigner that modifies the layout.
The problem now is, to get those files back in the source tree. As the web deployment project removes the CodeFile attribute of such files I need to readd it manually or write a program that does this step for me. Is my scenario so uncommon
and why or am I missing a point? I don't want to give my source code in the page behind files to the designer. The CodeFile attribute destroys some cool flexibilty. I also tried to add the class in the inherits attribute but iis searches explicitly for the
codefile if the attribute is present. if there were just a search order in iis7: first try codefile, than class if it's there it would work!
I am looking forward to an answer! Someone (http://forums.asp.net/p/1010031/1346769.aspx#1346769) asked a similar question but got no answer.
I can't believe there is no answer to this simple question on the whole net!
codefile workflow content design webdesigner class attribute aspx ascx updateable
Feb 12, 2009 04:17 AM|Thomas Sun – MSFT|LINK
If we compile ASP.NET website with updatable option, the code behind class file will be compiled to assembly and the codefile attribute is moved from Page directive. In runtime, CLR uses
Inherits attribute to load type.
Since it is used to deploy website in server without source code, people just can make limited changes, such as layout. This is by design.
If we want to modify source code in server, I think we need to put source code file in server.
I look forward to receiving your test results.
Feb 13, 2009 03:25 AM|hansmeiser|LINK
this ist not the point. I repeat my scenario, a scenario that shouldn't be that uncommon in a workflow with designers.
1. create web site project with web deployment project with a unfinished layout
2. deploy functioning web site in a single assembly with layout files aspx/ascx to a designer (CodeFile attribute is removed inherits attribut is modified with assembly name; you can't place the aspx/ascx files with CodeFile attribute and Inherits attribute
with additional assembly as IIS then implicitly needs the *.cs file. The momentary logic works like: If exists CodeFile attribute ==> CodeFile must be present...instead of: If exists assembly OR CodeFile ==> CodeFile Or assembly must be present...)
3. desginer modifies layout and gives aspx/ascx files back to me
4. I want to put aspx/ascx back into my web site project *IT DOESN'T WORK, AS CodeFile ATTRIBUTE IS REMOVED*
5. Only solution: readd CodeFile attribute to ascx/aspx files
So of course it would be a solution to give my designer the source code, but I don't want to! Who wants to give his source code away?
Well as I wrote before. It would be just that simple, if IIS would not search for the codefile attribute if the Inherits attribute has enough information to find the assembly. In my web site project with source code and without single assembly it would find
the source code and on the designers server it would find the assembly. I would give the designer my ascx/aspx files with codefile attribute or the web deployment project could just leave the CodeFile attribute where it is.
I am looking forward to your answers.