Tôi đang thử Windows Azure để lưu trữ ứng dụng web MVC4. Tôi đã tạo một ứng dụng thử nghiệm, sử dụng mẫu ứng dụng internet VS2012 MVC4 và thêm Mô hình và Bộ điều khiển tùy chỉnh vào nó.Phương thức WebSecurity.InitializeDatabaseConnection chỉ có thể được gọi là
Tôi đã xuất bản nó trên Azure và được quản lý để nhận 'cơ sở dữ liệu cập nhật' áp dụng di chuyển sang Cơ sở dữ liệu Azure.
Khi tôi thử ứng dụng cục bộ, nhưng sử dụng cơ sở dữ liệu Azure SQL, nó hoạt động tốt. Tôi có thể đăng nhập/đăng ký và sử dụng bộ điều khiển kiểm tra của mình.
Khi tôi cố gắng ứng dụng trực tuyến, tôi có thể sử dụng bộ điều khiển thử nghiệm nhưng đăng nhập hoặc đăng ký liên kết cung cấp cho các ngoại lệ sau đây:
Server Error in '/' Application.
The "WebSecurity.InitializeDatabaseConnection" method can be called only once.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The "WebSecurity.InitializeDatabaseConnection" method can be called only once.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: The "WebSecurity.InitializeDatabaseConnection" method can be called only once.]
WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +123
WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +52
MembershipTest2.Filters.SimpleMembershipInitializer..ctor() +193
Bạn có bất cứ ý tưởng nơi mà đến từ đâu? Nếu tôi gỡ lỗi (phiên bản cục bộ), phương thức này chỉ được gọi một lần.
Cảm ơn.
cách tắt chủ đề này? Tôi có một vấn đề tương tự. –
mã mà bạn gọi là WebSecurity.InitializeDatabaseConnection ở đâu? – Nikos