Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't use Azure TableStorageMembershipProvider from console application (and mstest)
    text
    copied!<p>In a web app I'm building I'm using the TableStorageMembershipProvider sample code (downloaded from <a href="http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=windowsazuresamples&amp;DownloadId=8221" rel="nofollow">here</a>) for user management. I've setup the web.config correctly and everything works just fine.</p> <p>I now want to write some tests, so I create a test project, reference the TableStorageMembershipProvider dll, copy the relevant sections from web.config to app.config and write one simple test. Problem is that the first time I hit the membership code, it throws the following error:</p> <pre><code>Could not load type 'Microsoft.Samples.ServiceHosting.AspProviders.TableStorageMembershipProvider' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. </code></pre> <p>It's trying to load the TableStorageMembershipProvider from System.Web...</p> <p>So I then create two separate projects - a console app and a new MVC3 web app - both of which simply reference the TableStorageMembershipProvider dll. I setup the web.config and app.config with the same entries which specify the membership provider and write one line of code:</p> <pre><code>Membership.ApplicationName = "test"; </code></pre> <p>The MVC app works, the console app throws the same error as above.</p> <p>I've tried duplicating all web app references in the console app and setting all to Copy Local = true - no luck. Tearing my bloody hair out over this...</p> <p>VS2010, all projects target .Net 4</p> <p>There's got to be a real simple solution?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload