<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>VS Web Deployment Projects</title><link>http://forums.asp.net/1020.aspx</link><description>General discussions of VS Web Deployment Projects</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>masterurl token not working, can't load type, and other mysteries of deploying an ASP.NET app under Sharepoint</title><link>http://forums.asp.net/thread/3258077.aspx</link><pubDate>Thu, 25 Jun 2009 14:54:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3258077</guid><dc:creator>Chris.S</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3258077.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1020&amp;PostID=3258077</wfw:commentRss><description>&lt;p&gt;I am trying to deploy an ASP.NET application under Sharepoint, and am getting stuck in two places.  (I am working off the suggestions in an article I found on CodeProject called &amp;quot;Converting an ASP.NET site into a SharePoint site&amp;quot; by srivatsan24.)
&lt;/p&gt;
&lt;p&gt;
1. Begin with my existing project.&lt;br /&gt;
Generated a strong name keypair with sn.exe and used that in the Signing tab of Properties. 
&lt;/p&gt;
&lt;p&gt;
2. Add Web Deployment Project.&lt;br /&gt;
Selected these options:&lt;br /&gt;
&amp;quot;Merge all outputs to a single assembly&amp;quot;&lt;br /&gt;
&amp;quot;Enable Strong Naming&amp;quot; with the above snk file&lt;br /&gt;
Mark assemblies with AllowPartiallyTrustedCallersAttribute (APTCA).
&lt;/p&gt;
&lt;p&gt;
3. Created a Sharepoint Web Application and site.&lt;br /&gt;
This makes an IIS application pool, web site, registers it in Sharepoint, makes a Virtual Directory.
The directory is &lt;code&gt;Inetpub\wwwroot\wss\VirtualDirectories\www.mydomain.com80\&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
4. Build my solution.&lt;br /&gt;
The web deployment assembly name is &amp;quot;Foobar.webdeploy&amp;quot; and the output is in Foobar.webdeploy\Debug.
&lt;/p&gt;
&lt;p&gt;
5. Copy the bin subdir there into the my site&amp;#39;s bin.&lt;br /&gt;
This included two files: Foobar.dll and Foobar.pdb&lt;br /&gt;
Also from the Debug directory, copied Default.aspx into the site. 
&lt;/p&gt;
&lt;p&gt;
6. Modified the site&amp;#39;s web.config as follows: &lt;br /&gt;
In the previously empty &lt;code&gt;&amp;lt;pageparserpaths&amp;gt;&lt;/code&gt; section: &lt;br /&gt;
&lt;code&gt;&amp;lt;pageparserpath virtualpath=&amp;quot;/*&amp;quot; compilationmode=&amp;quot;Always&amp;quot; allowserversidescript=&amp;quot;true&amp;quot; includesubfolders=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/pageparserpath&amp;gt;&lt;/code&gt;
&lt;br /&gt;In the &lt;code&gt;&amp;lt;safecontrols&amp;gt;&lt;/code&gt; section:  &lt;br /&gt;
&lt;code&gt;&amp;lt;SafeControl Assembly=&amp;quot;Foobar.webdeploy&amp;quot; Namespace=&amp;quot;Foobar&amp;quot; TypeName=&amp;quot;*&amp;quot; Safe=&amp;quot;True&amp;quot;  /&amp;gt;&lt;/code&gt;
&lt;br /&gt;Change the global trust from &amp;quot;Minimal&amp;quot;: &lt;code&gt;&amp;lt;trust level=&amp;quot;WSS_Medium&amp;quot; originUrl=&amp;quot;&amp;quot; /&amp;gt;

&lt;/code&gt;&lt;/p&gt;&lt;p&gt;
If I now go to my page (which is default.aspx in the site directory), it runs ok.
But this page has no server controls on it or anything, just some HTML.
&lt;br /&gt;
It has this at the top: 
&lt;code&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;Foobar._Default&amp;quot; %&amp;gt;
&lt;/code&gt;
This was a minimalist attempt, and it worked.
&lt;/p&gt;&lt;p&gt;
But my real project is of course very elaborate, and for starters it uses a master page.  If I try to add a master page, I get stuck multiple ways (and these are the same problems as in my real project).
&lt;/p&gt;&lt;p&gt;
One path of instructions says to change the master page to be the Sharepoint default master page. So I moved the page content inside a &amp;lt;Content&amp;gt; tag&amp;nbsp; with ContentPlaceHolderID=&amp;quot;PlaceHolderMain&amp;quot; and I set the @Page attribute MasterPageFile=&amp;quot;~masterurl/default.master&amp;quot;.
&lt;/p&gt;&lt;p&gt; Now when I try to go to the page, I get this error:&lt;br /&gt;
&lt;code&gt;Parser Error Message: The referenced file &amp;#39;/~masterurl/default.master&amp;#39; is not allowed on this page.&lt;/code&gt;&lt;br /&gt;
It doesn&amp;#39;t seem to matter what token or pathname I put into that MasterPageFile.
This is the first problem I would like to solve, since those are really supposed to work.
&lt;/p&gt;&lt;p&gt;
The second problem comes when I change to my own MaserPageFile. I think it finds it, but I get a &amp;quot;Cannot load type&amp;quot; error.&amp;nbsp; One thing I am unclear on here is what the Inherits @Page directive is supposed to say (in any of these cases).&amp;nbsp; The assembly name?&amp;nbsp; Type name?&amp;nbsp; DLL filename?&amp;nbsp; Something else?&amp;nbsp; Should the web deployment be putting something there for me automagically? &amp;nbsp; What is that &amp;quot;Foobar._Default&amp;quot; name?&lt;/p&gt;

&lt;p&gt;What I hope to do in the end is make my master page cascade off the default Sharepoint master page.&amp;nbsp; I am willing to add the PreInit() method to load the page or set up the context or whatever mumbo-jumbo is needed there, but thus far have not built my project with any Sharepoint references or code changes from my original ASP.NET.&amp;nbsp;&amp;nbsp; My app currently has its own SiteMap and navigation panes and login such, but I would ultimately prefer to ditch that.&amp;nbsp; But for now I just want to get it working at all.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;
Where am I going wrong?&lt;/p&gt;</description></item></channel></rss>