* AssemblyBuilder.cs: introduced a kludge to add #pragma checksum
and #pragma lines (or its vb equivalent - #ExternalSource) to
code-behind files named in the CodeFile/Src directives while
copying them to the dynamic directory for compilation. The kludge
works by recognizing the .cs and .vb extensions and wrapping the
file contents in the appropriate directives. This is done in this
way because the other possible way, using the
CodeSnippetCompileUnit, requires the entire file to be read in
memory and then passed to CodeDOM. We fall back to this way when
the file being copied is neither C# or VB.
svn path=/trunk/mcs/; revision=130566
* AspTokenizer.cs: MD5 checksum calculation happens here. It's
done incrementally as characters are read.
* AspParser.cs: the MD5 checksum is no longer computed here. Moved
to AspTokenizer.
After parsing, both the tokenizer and the string reader are
disposed of.
svn path=/trunk/mcs/; revision=130245
* AssemblyBuilder.cs: renamed CopyFile to CopyFileWithChecksum, in
prepration for future inclusion of checksum and line pragmas in
the file being copied.
Files are copied chunk by chunk, not by reading the entire
contents.
svn path=/trunk/mcs/; revision=130244
* TemplateBuildProvider.cs: add values of the CodeFile and Src
page/master/control directives to the list of file dependencies.
Extract language also for master/page, not only for controls.
* PageCompiler.cs: CreateConstructors now triggers master page
build, if the current page is using one. Fixes bug #487857
svn path=/trunk/mcs/; revision=130082
* AspGenerator.cs:
TagParsed now better handles <script> tags. For both server and
client tags ProcessScript is called and the input text, in case of
client tags, is read verbatim to be processed when ProcessScript
is called to close the tag. At this point the verbatim text is
checked whether it contains server-side tags and/or expressions.
svn path=/trunk/mcs/; revision=129491
* AspGenerator.cs: when parsing nested tags (includes tags inside
client-side javascript script blocks) pass the closing tag up to
the containing parser.
Instead of parsing the whole plain text contents, plus the two
constructs we're interested in from it using regexs. This is
necessary as we might be passed JavaScript code and without
understanding its syntax we'll confuse the '<' character for the
start of a tag.
svn path=/trunk/mcs/; revision=129449
* AspGenerator.cs: when parsing nested tags (includes tags inside
client-side javascript script blocks) pass the closing tag up to
the containing parser.
svn path=/trunk/mcs/; revision=129412
* BuildManager.cs, BuildManagerDirectoryBuilder.cs,
BuildProvider.cs, TemplateBuildProvider.cs: dependencies are
returned as an IDictionary <string, bool>. Dependencies must be
compared case-insensitively.
svn path=/trunk/mcs/; revision=129142
* TagAttributes.cs: modified ToString to return string formatted
in a more helpful way.
* AspParser.cs: added ToString, helpful when debugging.
* AspGenerator.cs: properly print leading and trailing plain text
when looking for embedded tags in ProcessTagsInAttributes.
svn path=/trunk/mcs/; revision=128091
* AspTokenizer.cs: put_back now uses a stack and allows more than
one invocation when called inside a tag.
* AspGenerator.cs: when a nested parser is used, pay attention to
server tags found inside client tags and add them to the control
tree.
svn path=/trunk/mcs/; revision=127935
* System.Web/HttpWriter.cs: new Response property and WriteUTF8Ptr
method.
* System.Web/HttpResponseStream.cs: added support for writing from an
IntPtr. copied the memcpy method from String.cs.
* System.Web.Compilation/BuildManager.cs: updated comment.
* System.Web.UI/ResourceBasedLiteralControl.cs: new Control. It's just
like a LiteralControl but will render itself from the bytes pointed to
by an IntPtr and not create any string from the underlying data unless
needed.
* System.Web.UI/TemplateControl.cs: implemented a bunch of methods
that are used from the precompiled assemblies for a web project. The
most notable change needed is to be able to read a win32 resource from
the dll of the control. The resource is a concatenation of literals
with plain text for the control and a specialized LiteralControl is
generated from different chunks of the resource.
* System.Web.UI/HtmlTextWriter.cs: new method that returns the
HttpWriter in use.
* System.Web.dll.sources: added new file.
* System.Web.Util/ICalls.cs: new internal call to get a pointer to the
win32 resource associated with the control's assembly.
svn path=/trunk/mcs/; revision=127579
* System.Web/HttpApplicationFactory.cs: check of global.asax was precompiled.
* System.Web.UI/MasterPage.cs: the items in ContentPlaceHolders are lowercase.
* System.Web.Compilation/TemplateControlCompiler.cs: lowercase place holder names
* System.Web.Compilation/BuildManager.cs: initial support for
precompilation. No 'updatable', please.
svn path=/trunk/mcs/; revision=127352
* AspParser.cs: added an event raised when parsing is complete.
* AspGenerator.cs: added support for PageParserFilter which, if
found, is used to control certain aspects of code parsing
(accepting/rejecting control types, accepting/rejecting code
snippets, parsing completion)
Added the AddControl method, used by PageParserFilter when a
custom filter wants to inject a control in the current control
builder tree.
2009-02-13 Marek Habersack <[email protected]>
* TemplateParser.cs: PageParserFilter handling moved to here.
PagesConfig must use the current virtual path when retrieving the
section, or otherwise we'll miss the lower level web.configs.
Added the AddControl method, used by PageParserFilter.
Implementing filtering of: parsed directives and the base type, if
a page parser filter is present.
* PageParserFilter.cs: added missing 3.5 members and implemented
everything.
* PageParser.cs: moved PageParserFilter processing to
TemplateParser.
VirtualPath must be set before anything else.
Call page parser filter's directive preprocessing code from
AddDirective if a filter is present and a mastertype or
previouspagetype directive is parsed.
* MasterPageParser.cs: when PageParserFilter is present use it to
preprocess the MasterType directive.
svn path=/trunk/mcs/; revision=126855
* AppResourcesCompiler.cs: implemented a type resolver for
ResXResourceReader so that it can correctly resolve
System.Resources types which are normally found in
System.Windows.Forms but are included by System.Web
directly. Without the type resolver, code comparing types inside
ResXResourceReader when file references are used in side the .resx
file will not work correctly. The reason for that is that .resx
files will name "System.Resources.ResXFileRef,
System.Windows.Forms" as the file reference handler, while inside
System.Web ResXFileRef will be of type
"System.Resources.ResXFileRef, System.Web". Fixes bug #466059
svn path=/trunk/mcs/; revision=125945
* GenericBuildProvider.cs: added a new virtual method, MapPath,
which can be overriden by builders which need special handling of
virtual path mapping.
* PageBuildProvider.cs: provide implementation of
GenericBuildProvider.MapPath which takes into account fake virtual
paths. Fixes bug #463950
svn path=/trunk/mcs/; revision=125857
* Makefile (SYSTEMCORE_DEP):
If NO_SYSTEMCORE_DEP is defined System.Web.dll will not be linked
with System.Core.dll and BuildManager will use ReaderWriterLock
instead of ReaderWriterLockSlim.
2009-01-22 Marek Habersack <[email protected]>
* BuildManager.cs:
- if SYSTEMCOR_DEP is undefined use ReaderWriterLock instead of
ReaderWriterLockSlim
svn path=/trunk/mcs/; revision=124253
* Makefile (net_2_0_dirs): added System.Web - it now depends on
System.Core, so it needs to be recompiled one more time after
System.Core is done.
2009-01-22 Marek Habersack <[email protected]>
* System.Web.dll.sources: added
System.Web.Compilation/BuildManagerCacheItem.cs,
System.Web.Compilation/BuildManagerDirectoryBuilder.cs,
System.Web.Compilation/BuildProviderGroup.cs
* Makefile (SYSTEMCORE_DEP): added. Defines SYSTEMCORE_DEP on the
mcs command line when System.Core is present.
Added the DEVEL define, which defines DEVEL on the mcs command
line. This is used to conditionally compile development helper code in
System.Web.Util.FileUtils (and possibly other stuff later on)
2009-01-22 Marek Habersack <[email protected]>
* XsdBuildProvider.cs: added missing BuildProviderAppliesTo
attribute.
* BuildProvider.cs: added new internal virtual method,
ExtractDependencies() whose purpose is to extract virtual path
dependencies without compiling the code, if possible.
* TemplateBuildProvider.cs: implemented the new
ExtractDependencies () method which uses regular expressions to
extract file dependencies from the source without having to
compile the file.
* CompilationException.cs: added a new public property, Results,
which returns the compilation results.
* BuildProviderGroup.cs: added. A simple class descending from
List <BuildProvider> which is used to hold a compilation batch -
that is a collection of BuildProvider instances.
* BuildManagerDirectoryBuilder.cs: new class which takes care of
generating compilation batches for the requested virtual path. A
set of batches is generated from files found in the same virtual
directory as the requested virtual path and all of the
dependencies of those files. All files are grouped in batches
within which no file depends upon its siblings. An attempt is made
to sort the batches from the "least dependent" to the "most
dependent" batches - i.e. the batches which do not depend on other
batches go to the top.
Code generating the batches now correctly detects dependency loops
and throws an exception when one is encountered.
Batches are represented as instances of a new class -
BuildProviderGroup.
* BuildManagerCacheItem.cs: added. Contains all the compilation
result information needed by BuildManager. See below.
* BuildManager.cs: complete batch building rewrite:
- only one build lock is held instead of a set of compilation
tickets. Only one thread can compile anything at one given
time.
- retrieving types from the build cache now uses a slim rw lock,
so that readers aren't blocked while compilation is in
progress. Writer lock is acquired only when adding a newly
compiled type to the build cache and when removing it after its
dependencies made it invalid.
- assembly references for each compilation are now collected
dynamically as the source is being compiled, this removed a lot
of complexity in dealing with assembles containing conflicting
types. As a consequence right now there may exist several
loaded assemblies containing the same type, but only the latest
of them will be used in new compiles.
- the thread compiling code can recurse into the Build method
which causes the recursively referenced code to be compiled
into a separate, uniquely named, assembly. This deals with all
recursion loops and dependency problems.
- automatic app domain restart after a certain number of compiles
is enabled now.
- improved compilation error handling. If a compilation error
occurs, the code attempts to recompile the assembly up to 3
times, each time removing from the batch the files/virtual
paths which failed parsing/compilation. If the attempts failed,
another one is made to compile only the virtual path requested
by the calling code. Only should that fail a compilation
exception is thrown. All the compilation errors are written to
stdout if the application is in the debug mode.
- changed assembly naming. It now generates assembly names based
on whether the compilation is recursive and whether the batch
being compiled contains more than one code unit or
not.
- compilation results are now stored in the cache as instances of
the new BuildManagerCacheItem class, which contains all the
information required by BuildManager to return types,
assemblies, dependencies etc.
- GetReferencedAssemblies now correctly returns only the
assemblies defined in the .config files.
- GetVirtualPathDependencies does not need to compile code
anymore in order to extract virtual path dependencies. New code
in BuildProvider.ExtractDependencies () takes care of that.
- a BuildManagerDirectoryBuilder class instance is used to
generate compilation batches.
* AssemblyBuilder.cs: added support for keeping track of which
code unit was generated by which BuildProvider andr which
BuildProvider produced a given source file. Both changes serve the
purpose of dealing with compilation errors in BuildManager.
* ApplicationFileBuildProvider.cs: added missing
BuildProviderAppliesTo attribute
2009-01-22 Marek Habersack <[email protected]>
* FileUtils.cs: added two conditionally compiled methods (they
require DEVEL to be defined) which output lines to a log file.
2009-01-22 Marek Habersack <[email protected]>
* WebTest.cs: Run () sets the internal field
BuildManager.suppressDebugModeMessages to true.
2009-01-22 Marek Habersack <[email protected]>
* Web.mono.config: added numRecompilesBeforeAppRestart attribute
to the compilation element, set to 100000, to avoid appdomain
restarts during tests.
svn path=/trunk/mcs/; revision=124179
* AspGenerator.cs: implemented a work around which allows the
server controls embedded in client tag attributes to be parsed and
compiled.
svn path=/trunk/mcs/; revision=123397
* CodeBuilder.cs, RootBuilder.cs, CollectionBuilder.cs: updates
related to ControlBuilder cleanup.
* ControlBuilder.cs: code cleanup - no field should be visible
outside the class unless it's a constant or a read-only field.
2009-01-13 Marek Habersack <[email protected]>
* XmlBuilder.cs: updates related to ControlBuilder cleanup.
2009-01-13 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs, AspGenerator.cs, BaseCompiler.cs,
GlobalAsaxCompiler.cs, PageThemeCompiler.cs: updates related to
ControlBuilder cleanup.
svn path=/trunk/mcs/; revision=123229
* LiteralStringControlBuilder.cs: added. Fixes bug #461214
* ControlBuilder.cs: added location tracking for literal string
children. Fixes bug #461214
* TemplateParser.cs: line pragmas are on by default. Fixes bug
#460479
2009-01-12 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: the LiteralStringControlBuilder
class is now used to track the location of the plain strings being
output to the generated code. Fixes bug #461214
* AspGenerator.cs: AppendLiteralString is called with the current
parser location as one of its parameters in FlushText (). Fixes
bug #461214
2009-01-12 Marek Habersack <[email protected]>
* System.Web.dll.sources: added
System.Web.UI/LiteralStringControlBuilder.cs
svn path=/trunk/mcs/; revision=123106
* TemplateParser.cs: in the 2.0 profile when a custom control is
registered, do not compile it right away but store the tag name in
a registry to be compiled at a later stage.
2008-12-11 Marek Habersack <[email protected]>
* BaseCompiler.cs: added a new method, InitializeType, to be
overriden in child classes when any class initialization needs to
be performed before methods, constructors and fields are created.
* TemplateControlCompiler.cs: if the parser has any custom
controls registered, compile them here - in the InitializeType
method.
svn path=/trunk/mcs/; revision=121262
* MasterPageParser.cs: do not compile anything while
parsing. MasterType virtual path is not compiled, but stored for
later. It is compiled when the MasterType property is requested
from within MasterPageCompiler.
* PageParser.cs: do not compile anything while
parsing. MasterPageFile, MasterType and PreviousPageType virtual
paths aren't compiled but checked for existence and stored for
later. Actual compilation happens when the MasterType and
PreviousPageType are requested from within PageCompiler.
* BaseParser.cs: added a new helper method, ThrowParseFileNotFound.
2008-12-10 Marek Habersack <[email protected]>
* ParseException.cs: made serializable.
* PageCompiler.cs: CreateStronglyTypedProperty calls
AddReferencedAssembly to add type's assembly to the unit's
references after the typed property has been created.
* BaseCompiler.cs: added a new helper method,
AddReferencedAssembly to be used whenever an assembly location
needs to be added to the compilation unit's list after the parsing
is done (e.g. when processing PreviousPageType or MasterPageType
properties in PageParser)
2008-12-10 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/MissingMasterFile.aspx
* System.Web_test.dll.sources: added System.Web.UI/PageParserTest.cs
2008-12-10 Marek Habersack <[email protected]>
* NunitWebResources/MissingMasterFile.aspx: added
2008-12-10 Marek Habersack <[email protected]>
* PageParserTest.cs: added
svn path=/trunk/mcs/; revision=121181
* NunitWebResources/ValidPropertyBind5.aspx: added
* NunitWebResources/ReadWritePropertyControl.ascx: added a
writable string property.
2008-12-08 Marek Habersack <[email protected]>
* TemplateControlCompilerTest.cs: added another valid Bind
expression test.
2008-12-08 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: use the correct regex match group
index in SanitizeBindCall (), fixes bug #457011
svn path=/trunk/mcs/; revision=120988
* BuildManager.cs: attempt to enter the compilation critical
section with a timeout up to 3 times before giving up. This avoids
deadlocks in situations where there are two virtual directores
each containing user controls referencing user controls from the
other directory.
svn path=/trunk/mcs/; revision=120861
* TemplateControlCompiler.cs: instead of adding ContentPlaceHolder
instances to the ContentPlaceHolders collection when the
placeholder is instantiated in the control build method, collect
the ids and store them in ContentPlaceHolders inside the
constructor. Fixes bug #449970
For each content placeholder generate a public virtual property
named "Template_PLACEHOLDERID", this is compatible with what .NET
does.
* BaseCompiler.cs: added new virtual method,
AddStatementsToConstructor, which is called just before
CreateConstructor returns.
2008-12-01 Marek Habersack <[email protected]>
* MasterPage.cs: use List <string> for ContentPlaceHolders instead
of ArrayList.
CreateMasterPage now directly accesses the ContentPlaceHolders as
it is now a list of strings
svn path=/trunk/mcs/; revision=120353
* System.Web.dll.sources: added
System.Web.Compilation/AspComponent.cs
2008-11-25 Marek Habersack <[email protected]>
* RootBuilder.cs: use new API in AspComponentFoundry to retrieve
registered control type.
* TemplateControlParser.cs: AddControlImports () removed. Its
functionality is now implemented in ControlBuilder.AddChild in a
more elegant, fine grained and correct way.
* TemplateParser.cs: replaced some "" with String.Empty
* ControlBuilder.cs: AddChild now adds an import for child's
namespace if the control being added has been registered in the
web.config file. Possible fix for #447896 and #447898
* PageParser.cs, MasterPageParser.cs: do not call
AddControlImports, it no longer exists.
2008-11-25 Marek Habersack <[email protected]>
* AspComponentFoundry.cs: GetComponentType methods replaced with
GetComponent returning an instance of AspComponent which fully
describes the registered item. Components are cached, indexed by
full tag name.
* AspComponent.cs: added
svn path=/trunk/mcs/; revision=119893
* TemplateControlCompiler.cs: make the Bind regex stricter.
When creating Eval expression from Bind, replace single quotes
with double quotes. Fixes bug #447597
When processing Bind expressions and the regex doesn't match,
throw an exception.
2008-11-21 Marek Habersack <[email protected]>
* ControlBuilder.cs: in BindingContainerType if builder is a
RootBuilder and no naming container is found, return typeof
(Page). In the TemplateBuilder case return cb.ControlType, not
this.ControlType.
svn path=/trunk/mcs/; revision=119661
* AspTokenizer.cs: if there's a newline between the opening server tag
and any other special character, treat the block as a code-render
block.
Bug #445889 fixed.
svn path=/trunk/mcs/; revision=119126