title: InfoPath XmlFormView in custom ASP.NET web site with forms authentication
body: <p>I have a custom ASP.NET web site, it has code in App_Code and lots of dependencies in bin folder. Additionally, this web site should host InfoPath <strong>XmlFormView</strong> control. I also have custom authentication system, based on forms authentication (&lt;authentication&gt; and &lt;authorization&gt; are configured in web.config).</p>
  
  <p>There is some documentation on hosting XmlFormView in custom environment (like this one - <a href="http://msdn.microsoft.com/en-us/library/aa701078.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa701078.aspx</a>), however I counldn't find any resources, describing our particular case.</p>
  
  <p>I have the following problems:</p>
  
  <ul>
  <li>App_Code and bin folders. Because of these, we cannot deploy our site to virtual directory (such as _layouts). I've solved this by setting up IIS application within SharePoint IIS web site. This seems to work, but is this correct?</li>
  <li>Forms authentication. This is the hardest problem. It is not clear how to set it up correctly for custom web site, working in SharePoint context (so that XmlFormView would work). If I configure forms authentication in web.config of IIS application of SharePoint web site and configure SharePoint for anonimous access, XmlFormView cannot download some resources and crash with error. Also the problem is that I have to configure both whole SharePoint and forms library for anonimous access, otherwise I get access denied error. I don't really like to have my SharePoint web site having public anonimous access.</li>
  </ul>
  
  <p>In general the question is – what is the correct way of hosting XmlFormView control in custom web site with .dlls in bin folder and code in App_Code folder and custom authentication, based on ASP.NET forms authentication.</p>
  
  <p>Installed software:</p>
  
  <ul>
  <li>Windows Server 2008</li>
  <li>IIS 7</li>
  <li>MOSS 2007</li>
  </ul>