我的web應用程序(WCF服務)使用SqlRoleProvider
,它在上可以正常工作,Visual Studio Development Server。它切換到IIS8快遞導致它拋出一個NullReferenceException
雖然:IIS8 Express上的SqlRoleProvider
Roles.IsUserInRole(username, role) // neither of them actually null
我無法找到此異常the IsUserInRole
method documentation的提示。切換回Visual Studio開發服務器使其工作。這種例外的原因是什麼,我怎樣才能正確地修復它?該項目的目標框架是.NET Framework 4。
下面是配置的連接字符串:
<add name="ConnectionString"
connectionString="Data Source=.\sqlexpress;Initial Catalog=DevWeb;Integrated Security=True"
providerName="System.Data.SqlClient" />
這是roleManager/providers
節點:
<clear />
<add connectionStringName="ConnectionString" applicationName="MyApp" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
是的,你說得對,我看到的cookie沒有什麼,你只要運行該功能直接。 – Aristos
我開始看到同樣的問題(安裝最新的VS2013 RC之後)。你發現問題是什麼? –