<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.sharepointblogs.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Roni&amp;#39;s SharePoint Thoughts</title><subtitle type="html">A developer blog about SharePoint technologies (MOSS and WSS)</subtitle><id>http://www.sharepointblogs.com/roni/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.sharepointblogs.com/roni/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.sharepointblogs.com/roni/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20611.960">Community Server</generator><updated>2007-08-18T17:53:00Z</updated><entry><title>MOSS 2007 – Indexing Problems with ModifiedBy</title><link rel="alternate" type="text/html" href="http://www.sharepointblogs.com/roni/archive/2007/09/26/moss-2007-indexing-problems-with-modifiedby.aspx" /><id>http://www.sharepointblogs.com/roni/archive/2007/09/26/moss-2007-indexing-problems-with-modifiedby.aspx</id><published>2007-09-26T20:28:14Z</published><updated>2007-09-26T20:28:14Z</updated><content type="html">&lt;p&gt;With default settings the ModifiedBy property of the documents (the user who last modified the document) won&amp;#39;t be indexed and therefore can&amp;#39;t be used in advanced search.
&lt;/p&gt;&lt;p&gt;After some hours of investigation without any success I got a solution from MSDN forum posted by Pritam Dahake that seems to work:
&lt;/p&gt;&lt;p style="background:#e0e0e0;"&gt;&lt;span style="color:#333333;font-family:Verdana;font-size:10pt;"&gt;1) Open Central administration -&amp;gt; Shared Services -&amp;gt; SharedServices (X being the number of the shared services provider for the site you are creating a mapping)  - &amp;gt; search settings -&amp;gt; metadata property mappings &lt;br /&gt;2) Click &amp;quot;Modifiedby&amp;quot; to edit the properties &lt;br /&gt;3) Make sure  &amp;quot;Include values from all crawled properties mapped&amp;quot; is selected&lt;br /&gt;4) Click &amp;quot;add mapping&amp;quot; and select the &amp;quot;Office&amp;quot; category from the dropdown list. &lt;br /&gt;5) look for a property named &amp;quot;OFFICE:8&amp;quot; , click &amp;quot;OK&amp;quot;&lt;br /&gt;6) Click &amp;quot;add mapping&amp;quot; and select the &amp;quot;ows_Last_x0020_Modified(text)&amp;quot; from the ALL categories dropdown list, Click &amp;quot;OK&amp;quot;&lt;br /&gt;7)  Make sure the box is checked &amp;quot;Allow this property to be used in scopes&amp;quot;, click &amp;quot;OK&amp;quot;&lt;br /&gt;8) Click on &amp;quot;Crawled Properties&amp;quot; link on the left side of the Shared ...&lt;/span&gt;
	&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=6373" width="1" height="1"&gt;</content><author><name>rho</name><uri>http://www.sharepointblogs.com/members/rho.aspx</uri></author></entry><entry><title>Canceling Check-out Event in Lists and Document Libraries returns an Error Message</title><link rel="alternate" type="text/html" href="http://www.sharepointblogs.com/roni/archive/2007/09/06/canceling-check-out-event-in-lists-and-document-libraries-returns-an-error-message.aspx" /><id>http://www.sharepointblogs.com/roni/archive/2007/09/06/canceling-check-out-event-in-lists-and-document-libraries-returns-an-error-message.aspx</id><published>2007-09-06T20:13:46Z</published><updated>2007-09-06T20:13:46Z</updated><content type="html">&lt;p&gt;With the new event model in WSS 3.0 we have the ability to cancel some user actions on the behalf of synchronous events like ItemUpdating or ItemDeleting.
&lt;/p&gt;&lt;p&gt;To do this you have to implement an event handler: Create a class library with a class that inherit from Microsoft.SharePoint.SPItemEventReceiver. And then override the desired event methods (ItemDeleting, ItemUdating, …).
&lt;/p&gt;&lt;p&gt;Now you have to register your event handler within SharePoint. You can do this programmatically through the object model or declaratively through a feature for a specific list type or a specific content type. Details are well documented in the WSS SDK. There is also a nice book excerpt about the whole story of event handling in WSS: &lt;a href="http://www.wrox.com/WileyCDA/Section/id-306329.html"&gt;http://www.wrox.com/WileyCDA/Section/id-306329.html&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;To cancel an event you can use the following code in your event handler:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;
			&lt;span style="color:blue;"&gt;override&lt;/span&gt;
			&lt;span style="color:blue;"&gt;void&lt;/span&gt; ItemCheckingOut(&lt;span style="color:teal;"&gt;SPItemEventProperties&lt;/span&gt; properties)&lt;br /&gt;{&lt;br /&gt;    properties.Status = &lt;span style="color:teal;"&gt;SPEventReceiverStatus&lt;/span&gt;.CancelWithError;&lt;br /&gt;    properties.ErrorMessage = &lt;span style="color:maroon;"&gt;&amp;quot;Operation not allowed because...&amp;quot;&lt;/span&gt;;&lt;br /&gt;    properties.Cancel = &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;With ItemDeleting or ItemUpdating this is working perfectly: the user action will be canceled and the user will be presented the custom error message &amp;quot;Operation not allowed …&amp;quot;. 
&lt;/p&gt;&lt;p&gt;But with ItemCheckingOut is something wrong. The user action (Check-out) is canceled but the user will be presented the following system error message instead of our custom error message:
&lt;/p&gt;&lt;p&gt;&lt;span style="color:red;"&gt;&amp;quot;Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&amp;quot;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="http://hofer.triadis.ch/blog/090607_2013_CancelingCh1.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;I also tested this with WSS/MOSS SP1 (Technical Preview) and got exactly the same behavior.
&lt;/p&gt;&lt;p&gt;Did anyone come across this issue (bug?) or does anyone know a workaround?&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=5437" width="1" height="1"&gt;</content><author><name>rho</name><uri>http://www.sharepointblogs.com/members/rho.aspx</uri></author><category term="MOSS 2007" scheme="http://www.sharepointblogs.com/roni/archive/tags/MOSS+2007/default.aspx" /><category term="WSS" scheme="http://www.sharepointblogs.com/roni/archive/tags/WSS/default.aspx" /><category term="SharePoint" scheme="http://www.sharepointblogs.com/roni/archive/tags/SharePoint/default.aspx" /><category term="Visual Studio" scheme="http://www.sharepointblogs.com/roni/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>MOSS 2007 – Using Property Bag of SPWeb to store Metadata</title><link rel="alternate" type="text/html" href="http://www.sharepointblogs.com/roni/archive/2007/08/27/moss-2007-using-property-bag-of-spweb-to-store-metadata.aspx" /><id>http://www.sharepointblogs.com/roni/archive/2007/08/27/moss-2007-using-property-bag-of-spweb-to-store-metadata.aspx</id><published>2007-08-27T14:58:00Z</published><updated>2007-08-27T14:58:00Z</updated><content type="html">&lt;p&gt;On an SPWeb there is no out-of-the-box solution to store custom metadata, you only have the name (URL), the title and the description. If you need more (e.g. status (active/inactive) or location) you have to implement a custom solution. 
&lt;/p&gt;&lt;p&gt;A possible way is to create a list (with the fields you need) that has only one list entry: the metadata of the parent SPWeb. With versioning enabled you also versioned metadata for your SPWeb. But if you have many sites of this type this may be some overkill to have an extra list for the metadata in each site. 
&lt;/p&gt;&lt;p&gt;Another solution is to use the property bag of the SPWeb and store the additional metadata directly in the SPWeb. This needs some coding of course (Web Part or &lt;a href="http://www.sharepointblogs.com/roni/archive/2007/08/18/moss-2007-creating-an-asp-net-application-in-the-layouts-directory-using-the-visual-studio-2005-plug-in-web-application-project.aspx"&gt;Layouts application&lt;/a&gt;) and you have to integrate it into your sites. But the code is very simple:
&lt;/p&gt;&lt;p&gt;Writing values:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:green;"&gt;// attention: SPWeb.Properties.Remove(string pKey) doesn&amp;#39;t work to remove &lt;br /&gt;// a property. To remove a property clear the content.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strKey = &lt;span style="color:maroon;"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strValue = &lt;span style="color:maroon;"&gt;&amp;quot;MyValue&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (webCurrent.Properties.ContainsKey(strKey))&lt;br /&gt;&lt;span style="color:green;"&gt;    // property exists already -&amp;gt; update it&lt;br /&gt;&lt;/span&gt;    webCurrent.Properties[strKey] = strValue;&lt;br /&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt;
			&lt;span style="color:blue;"&gt;if&lt;/span&gt; (strValue.Length &amp;gt; 0)&lt;br /&gt;&lt;span style="color:green;"&gt;    // property doesn&amp;#39;t exist -&amp;gt; add it if there is value to set&lt;br /&gt;&lt;/span&gt;    webCurrent.Properties.Add(strKey, strValue);&lt;br /&gt;webCurrent.Properties.Update();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Reading values:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strKey = &lt;span style="color:maroon;"&gt;&amp;quot;MyKey&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strValue = string.Empty;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (webCurrent.Properties.ContainsKey(strKey))&lt;br /&gt;    strValue = webCurrent.Properties[strKey];&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;If you want to save some metadata about the lists in the current SPWeb you can also use the property bag of your SPWeb. Just add the Guid of the list to each name of the property:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; strKey = &lt;span style="color:maroon;"&gt;&amp;quot;MyKey_&amp;quot;&lt;/span&gt; + listCurrent.ID.ToString();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=4847" width="1" height="1"&gt;</content><author><name>rho</name><uri>http://www.sharepointblogs.com/members/rho.aspx</uri></author><category term="WSS" scheme="http://www.sharepointblogs.com/roni/archive/tags/WSS/default.aspx" /><category term="SharePoint" scheme="http://www.sharepointblogs.com/roni/archive/tags/SharePoint/default.aspx" /><category term="Visual Studio" scheme="http://www.sharepointblogs.com/roni/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>MOSS 2007 – Creating an ASP.NET Application in the “_layouts” Directory using the Visual Studio 2005 Plug-In “Web Application Project”</title><link rel="alternate" type="text/html" href="http://www.sharepointblogs.com/roni/archive/2007/08/18/moss-2007-creating-an-asp-net-application-in-the-layouts-directory-using-the-visual-studio-2005-plug-in-web-application-project.aspx" /><id>http://www.sharepointblogs.com/roni/archive/2007/08/18/moss-2007-creating-an-asp-net-application-in-the-layouts-directory-using-the-visual-studio-2005-plug-in-web-application-project.aspx</id><published>2007-08-18T15:53:00Z</published><updated>2007-08-18T15:53:00Z</updated><content type="html">&lt;p&gt;There are several ways to create custom applications for the SharePoint platform. Chris Johnson has a great &lt;a href="http://blogs.msdn.com/cjohnson/archive/2006/09/05/740498.aspx"&gt;post&lt;/a&gt; on this topic with pro and cons of each way. 
&lt;/p&gt;&lt;p&gt;In this post I will describe how I create &amp;quot;_layouts&amp;quot; application on behalf of the &lt;a href="http://webproject.scottgu.com/"&gt;Visual Studio 2005 Web Application Project&lt;/a&gt; extension. 
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Download and install the Visual Studio 2005 extension &amp;quot;Web Application Project&amp;quot; &lt;a href="http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx"&gt;(&lt;span style="font-family:Wingdings;"&gt;à&lt;/span&gt; Download&lt;/a&gt;, &lt;a href="http://webproject.scottgu.com/"&gt;&lt;span style="font-family:Wingdings;"&gt;à&lt;/span&gt; Documentation&lt;/a&gt;). 
&lt;/li&gt;&lt;li&gt;In Visual Studio 2005 add a new project of the type &amp;quot;ASP.NET Web Application&amp;quot;. Name it appropriate and select as the location the LAYOUTS directory of your SharePoint installation (...\12\TEMPLATE\LAYOUTS).&lt;br /&gt;&lt;img src="http://hofer.triadis.ch/blog/081807_1553_MOSS2007Cre1.png" alt="" /&gt;
		&lt;/li&gt;&lt;li&gt;In the project properties change the output path to the &amp;quot;_app_bin&amp;quot; of your web application&lt;br /&gt;(e.g. &amp;quot;C:\Inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin\&amp;quot;) 
&lt;/li&gt;&lt;li&gt;Sign the assembly:&lt;br /&gt;&lt;img src="http://hofer.triadis.ch/blog/081807_1553_MOSS2007Cre2.png" alt="" /&gt;
		&lt;/li&gt;&lt;li&gt;Add a reference to Windows SharePoint Services in the project. 
&lt;/li&gt;&lt;li&gt;&lt;div&gt;Add a dummy master page to the project with the following content: 
&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Master&lt;/span&gt;
					&lt;span style="color:red;"&gt;Language&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;C#&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color:maroon;"&gt;DOCTYPE&lt;/span&gt;
					&lt;span style="color:red;"&gt;html&lt;/span&gt;
					&lt;span style="color:red;"&gt;PUBLIC&lt;/span&gt;
					&lt;span style="color:blue;"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt;
					&lt;span style="color:blue;"&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;html&lt;/span&gt;
					&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;
					&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;head&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Untitled Page&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;form&lt;/span&gt;
					&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;
					&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageImage&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;
					&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageTitle&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;
					&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageTitleInTitleArea&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;
					&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderMain&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;contentplaceholder&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;form&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
			&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Add an aspx page (or use Default.aspx) with the following content: 
&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Page&lt;/span&gt;
					&lt;span style="color:red;"&gt;Language&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;C#&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;CodeBehind&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Default.aspx.cs&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;MasterPageFile&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;DummyMasterPage.master&amp;quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:red;"&gt;Inherits&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Documena.PDSearch._Default, Documena.PDSearch, Version=1.0.0.0, Culture=neutral, PublicKeyToken=33d7cc1d9943a411&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Import&lt;/span&gt;
					&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Import&lt;/span&gt;
					&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint.ApplicationPages&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt;&lt;/span&gt;
				&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Register&lt;/span&gt;
					&lt;span style="color:red;"&gt;Tagprefix&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;SharePoint&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint.WebControls&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt;&lt;/span&gt;
				&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="background-color:yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue;"&gt;@&lt;/span&gt;
					&lt;span style="color:maroon;"&gt;Register&lt;/span&gt;
					&lt;span style="color:red;"&gt;Tagprefix&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Utilities&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;Namespace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint.Utilities&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;Assembly&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot;&lt;/span&gt;
					&lt;span style="background-color:yellow;"&gt;%&amp;gt;&lt;/span&gt;
				&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Content1&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;contentplaceholderid&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageTitle&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;SharePoint&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;EncodedLiteral&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;EncodedLiteral1&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;text&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;My Title&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;EncodeMethod&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;#39;HtmlEncode&amp;#39;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Content2&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;contentplaceholderid&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageTitleInTitleArea&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;SharePoint&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;EncodedLiteral&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;EncodedLiteral2&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;text&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;My Title&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;EncodeMethod&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;#39;HtmlEncode&amp;#39;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Content3&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;contentplaceholderid&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderPageImage&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;
					&lt;span style="color:red;"&gt;ID&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Content4&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;contentplaceholderid&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;PlaceHolderMain&amp;quot;&lt;/span&gt;
					&lt;span style="color:red;"&gt;runat&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;server&amp;quot;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:maroon;"&gt;Content&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
			&lt;/p&gt;&lt;p&gt;The point here is the page directive with the &lt;strong&gt;MasterPageFile&lt;/strong&gt; property that references the above created dummy master page and the &lt;strong&gt;Inherits&lt;/strong&gt; property that references the assembly that will be copied to the _app_bin. 
&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;The corresponding code behind (Default.aspx.cs) looks like: 
&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Data; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Configuration; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Collections; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.Security; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI.WebControls; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI.HtmlControls; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; Microsoft.SharePoint; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; Microsoft.SharePoint.WebControls; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; Microsoft.SharePoint.Utilities; &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;namespace&lt;/span&gt; Documena.PDSearch &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    &lt;span style="color:blue;"&gt;public&lt;/span&gt;
					&lt;span style="color:blue;"&gt;partial&lt;/span&gt;
					&lt;span style="color:blue;"&gt;class&lt;/span&gt;
					&lt;span style="color:teal;"&gt;_Default&lt;/span&gt; : System.Web.UI.&lt;span style="color:teal;"&gt;Page &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        &lt;span style="color:blue;"&gt;protected&lt;/span&gt;
					&lt;span style="color:blue;"&gt;override&lt;/span&gt;
					&lt;span style="color:blue;"&gt;void&lt;/span&gt; OnPreInit(&lt;span style="color:teal;"&gt;EventArgs&lt;/span&gt; e) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;            &lt;span style="color:blue;"&gt;base&lt;/span&gt;.OnPreInit(e); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;            &lt;span style="color:blue;"&gt;using&lt;/span&gt; (&lt;span style="color:teal;"&gt;SPWeb&lt;/span&gt; webCurrent = &lt;span style="color:teal;"&gt;SPControl&lt;/span&gt;.GetContextSite(Context).OpenWeb()) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;            { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;                &lt;span style="color:blue;"&gt;this&lt;/span&gt;.MasterPageFile = webCurrent.MasterUrl; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;                &lt;span style="color:green;"&gt;// or: this.MasterPageFile = webCurrent.CustomMasterUrl; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;            } &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        } &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        &lt;span style="color:blue;"&gt;protected&lt;/span&gt;
					&lt;span style="color:blue;"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color:teal;"&gt;EventArgs&lt;/span&gt; e) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        { &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;        } &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;    } &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;} &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;The point here is the &lt;strong&gt;OnPreInit&lt;/strong&gt; method where we change the master page from our dummy master page to the master page of the current site (SPWeb). (LAYOUTS applications are always called in the context of a site: &lt;a href="http://.../sitename/_layouts/MyApp/Default.aspx"&gt;http://.../sitename/_layouts/MyApp/Default.aspx&lt;/a&gt;). 
&lt;/p&gt;&lt;/li&gt;&lt;li&gt;Build the new application within Visual Studio. 
&lt;/li&gt;&lt;li&gt;&lt;div&gt;To run the new application we have to configure it manually in the IIS Manager. 
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Start IIS Manager 
&lt;/li&gt;&lt;li&gt;Open the Web Sites tree 
&lt;/li&gt;&lt;li&gt;Open your SharePoint Web App (e.g. &amp;quot;SharePoint - 80&amp;quot;) 
&lt;/li&gt;&lt;li&gt;Open &amp;quot;_layouts&amp;quot; 
&lt;/li&gt;&lt;li&gt;Select the directory of your application and open the properties dialog 
&lt;/li&gt;&lt;li&gt;In the &amp;quot;Directory&amp;quot; tab click on the &amp;quot;Create&amp;quot; button and choose the Application Pool of your SharePoint Web Application 
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;img src="http://hofer.triadis.ch/blog/081807_1553_MOSS2007Cre3.png" alt="" /&gt;
			&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Click on OK to close the dialog 
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Start your Application in the context of a site &lt;a href="http://.../sitename/_layouts/MyApp/Default.aspx"&gt;http://.../sitename/_layouts/MyApp/Default.aspx&lt;/a&gt; (You should get an empty page with the master page of the site.) 
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Drawback of this solution: 
&lt;/p&gt;&lt;p&gt;Because the assembly is built directly to the _app_bin directory you have to recycle the IIS application pool before rebuilding the application within Visual Studio. 
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Updated 2007-08-24:
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Due to the comment of Daniel I did some further investigations. There is indeed a problem if you want to use your layouts Application in the server root web site (e.g. http://server/_layouts/MyApp/Default.aspx). You will get a server error.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;To avoid this don&amp;#39;t configure your directory in the IIS Manager as an application. May be you will get then an empty page (on the server root) or the following message (when you call your application in the context of sub site):
&lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;It is an error to use a section registered as allowDefinition=&amp;#39;MachineToApplication&amp;#39; beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\layouts\MyApp\web.config line 21)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt;Correct your web.config (here I had to comment out the line &amp;lt;authentication mode=&amp;quot;Windows&amp;quot; /&amp;gt; and everything works fine.
&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=4522" width="1" height="1"&gt;</content><author><name>rho</name><uri>http://www.sharepointblogs.com/members/rho.aspx</uri></author><category term="MOSS 2007" scheme="http://www.sharepointblogs.com/roni/archive/tags/MOSS+2007/default.aspx" /><category term="WSS" scheme="http://www.sharepointblogs.com/roni/archive/tags/WSS/default.aspx" /><category term="SharePoint" scheme="http://www.sharepointblogs.com/roni/archive/tags/SharePoint/default.aspx" /><category term="Visual Studio" scheme="http://www.sharepointblogs.com/roni/archive/tags/Visual+Studio/default.aspx" /></entry></feed>