Maybe I haven't had that "a-ha" moment yet, but I think the new
approach to web projects is a step in the wrong direction. My main
beef is that control over the assembly generation process has been
taken away from us! I also don't agree with the logic behind a web
site not having a project file, but I'll save that for another thread!
Here's our scenario:
We have a web project that runs in a non-managed sharepoint directory.
The web project is a strongly named assembly and is deployed to the GAC
on production web servers. Each of our pages in the web project
contains strong references to server controls that are in the same web
project, for example: Register TaxPrefix="ctl"
Assembly="Company.Technology.Class,Version=1.0.0.0 ,Culture=Neutral...".
In addition, all of our page directives use strong references. We
used the migration wizard, and it moved all the class files to the
app_code directory. When we precompiled, we got an app_code.dll and an
assembly for each page. Of course, our app won't work with this setup.
In order to get our application over to 2.0 (which we are eager to do)
we have to modify about 100 pages to point each control directive to
app_code and each page directive to some seemingly randomly named
assembly (which could change if someone forgets to use the fixed name
option). We want to use strong references. I suppose we could put
App_Code in the GAC, but I have more than one application on the
server, how would that work? If I want to use strong references in my
page directives, am I supposeed to put hundreds of randomly named
assemblies into the GAC as well? I haven't even figured out how to make
a strong reference to the app_code assembly yet! What is the version--
0.0.0.0?
Another issue I have is that you can no longer reference a web project
from another assembly. We have components that make references to
classes (not aspx pages) in the web project. I don't believe there are
any design issues with putting web-related classes into a web project,
plese speak up if you disagree. You can no longer add a reference to a
web project, so we have to change our design.
I have come to the conclusion that the only way to get to 2.0 is to
de-stabilize the solution and move shared classes into a separate
assembly. We must also touch every page and change the page directives
to lose the strong references.
I'm sure there are workarounds, but this isn't a V1 product. Don't
take away features, add them! It's early days, and I can only hope for
a service pack to fix it.
Maybe some of you smart guys can answer some of these questions for me:
1.) What is the logic behind special web folders that result in
separate assemblies ?
2.) Why would you want an assembly for each page ?
3.) Why can't you add a reference to a web project--is there some kind
of fundamental design issue or is this out of technical necessity ?
4.) Why can't I put my web assembly(s) into the GAC and use strong
references in my page and control directives ?
5.) Why is the fixed name and generate an assembly per page put
together in one option-- aren't they two different things ?
John Powell