I'm working on an enterprise-wide solution where i'm attempting to share master pages across multiple web applications. To achieve this I'm precompiling my master pages and reference them in client applications. The issue is that some HTML markup in the master page causes the above error when the master page is being referenced at run-time. While doing some research, it appears that the error is taking place (at least in my case) if more than 1 <script> tag appears in the head section. When this issue occurs, the compiler generates a call to TemplateControl.CreateResourceBasedLiteralControl() to create the <script> tag mark-up (which fails with the above error) instead of using LiteralControl object as it does in normal cases.