title: Web Pages issue with azure when servicestack is deployed
body: <p>I am trying to deploy Servicestack application to azure website. Application is with asp.net host and razor view engine. </p>
  
  <p><a href="http://servicestacksignalrfsharp.azurewebsites.net/" rel="nofollow">Here</a> is final deployed version. And also <a href="https://github.com/kunjee17/ServicestackSignalRFSharp" rel="nofollow">github project</a></p>
  
  <p>Now, it working fine in local without any issue. But giving problem after deployment. If I forcefully load the assembly in web.config azure can't load it. And if don't do that servicestack crashed nullpointer exception.</p>
  
  <p>I checked the application setting, as per it azure sites are running webpages version 3.x.x.x. </p>
  
  <p>Please let me know if any further information needed. </p>
  
  <p>Here is stack trace of error </p>
  
  <pre><code>[NullReferenceException: Object reference not set to an instance of an object.]
     ServiceStack.HttpHandlerFactory..cctor() +336
  
  [TypeInitializationException: The type initializer for 'ServiceStack.HttpHandlerFactory' threw an exception.]
     ServiceStack.HttpHandlerFactory..ctor() +0
  
  [TargetInvocationException: Exception has been thrown by the target of an invocation.]
     System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
     System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +113
     System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +232
     System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
     System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark&amp; stackMark) +1136
     System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
     System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +18
     System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
     System.Web.Configuration.HandlerFactoryCache..ctor(String type) +46
     System.Web.HttpApplication.GetFactory(String type) +86
     System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +262
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  </code></pre>
  
  <p><strong>[UPDATE]</strong> I guess issue is not on servicestack side. Things are working fine if I deploy the C# version of it. 
  To make compile on azure there is need to add below code in fsproj file. </p>
  
  <pre><code>&lt;Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" 
          Condition="'$(VSToolsPath)' != ''" /&gt;
  &lt;Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" 
          Condition="true" /&gt;
  </code></pre>