This question already has answers here:
MSSQL Error 'The underlying provider failed on Open'
(31 answers)
Closed last year.
I have the following piece of code, which works at a customer, but not on my computer:
var result = await db.Configurations.FirstOrDefaultAsync().ConfigureAwait(false);
db is derived from a System.Data.Entity.DbContext, defined in EntityFramework.6.4.0\lib\net45\EntityFramework.dll.
In the corresponding SQL Server database, there is a table "Configurations" and it contains an entry.
When I launch the line of source code, an Exception gets generated (I hereby show the slightly formatted content of the immediate window while asking ? ex):
? ex
{"An exception occurred while initializing the database. See the InnerException for details."}
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233087
HelpLink: null
InnerException: {"The underlying provider failed on Open."}
Message: "An exception occurred while initializing the database. See the InnerException for details."
Source: "EntityFramework"
StackTrace: " bij System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)\r\n bij System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
bij System.Data.Entity.Internal.LazyInternalContext.<>c.<InitializeDatabase>b__58_0(InternalContext c)
bij System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
bij System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
bij System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
bij System.Data.Entity.Internal.InternalContext.Initialize()
bij System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
bij System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
bij System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
bij System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
bij System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
bij System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync[TSource](IQueryable`1 source)
bij Project.<GetConfigAsync>d__56.MoveNext() in C:\\Source_Code_Directory\\Source_Code_File.cs:regel 2149"
TargetSite: {Void PerformInitializationAction(System.Action)}
I know this line of code works at customer's system, and I'm working on a restored backup of customer's DB.
What is going wrong and what can I do to fix it (what is the underlying provider)?
Thanks in advance
In the meantime the problem is analysed:
I had taken the backup of the customer's DB and restored it on my PC, but the username, as indicated in the connectionstring in source code, was wrong, hence my application could simply not open the database connection, so now the problem comes down on a database user management issue.
Thanks for all the support.
Related
I got a fresh machine, with just Visual Studio 2015 and the latest .Net Framework, cloned a repository that accesses a remote Oracle 11g Database using Entity and Oracle.ManagedDataAccess from Nuget, this project does work in other machines,
I tested the remote connection using SqlDeveloper, and verified the port access with telnet and even created a simple and local Oracle Database to exclude any network related error
To confirm the error i created a simple Console Project following a Oracle Article and still got the same error
Exception : The provider did not return a ProviderManifestToken string.
InnerException : ORA-01017: invalid username/password; logon denied
I do not have any Oracle Client installed, and as far as i can tell i do not need any because i am using Nuget
And yes, i am extremelly sure of the user and password, as said above, the connection works when using SqlDeveloper
Oracle ManagedDataAccess Nuget
Oracle Article
Full StackTrace
"data source=OracleDS;user id=PUBLICO;password=PUBLICO;min pool size=1;max pool size=1;Incr Pool Size=1 ----- System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> Oracle.ManagedDataAccess.Client.OracleException: ORA-01017: invalid username/password; logon denied
em OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)
em OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)
em OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)
em Oracle.ManagedDataAccess.Client.OracleConnection.Open()
em Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices.GetDbProviderManifestToken(DbConnection connection)
em System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
--- Fim do rastreamento de pilha de exceções internas ---
em System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
em System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
--- Fim do rastreamento de pilha de exceções internas ---
em System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
em System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
em System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
em System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
em System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
em System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
em System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
em System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
em System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
em System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
em System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
em System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
em BemaHybrid.Library.EntityFramework.DbContextExtended.AdquireUsuarioSenhaBaseadoUsuarioPublico() na D:\\Projetos\\hybrid.cliente\\BemaHybrid.Library.EntityFramework\\DbContextExtended.cs:linha 42"
UPDATE
Found this question that nailed the answer, a windows Registry settings that encrypted the password, in this question you can find the way to disabled on the registry or in the application config if you need
Solution
i'm working with React.NET, i recently updated those nugets:
And now i receive this error :
Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.
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.MissingMethodException: Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.
Stack trace:
[MissingMethodException: Method not found: 'JavaScriptEngineSwitcher.Core.IJsEngine JSPool.IJsPool.GetEngine(System.Nullable`1<System.TimeSpan>)'.]
React.JavaScriptEngineFactory.GetEngine() +0
System.Lazy`1.CreateValue() +741
System.Lazy`1.LazyInitValue() +430
React.ReactEnvironment.EnsureUserScriptsLoaded() +40
React.ReactEnvironment.CreateComponent(String componentName, T props, String containerId, Boolean clientOnly) +43
Google didn't helped much, maby you can.
Thanks.
JavaScriptEnginerSwitch 2.0 is not supported yet: https://github.com/reactjs/React.NET/issues/319
and
https://github.com/reactjs/React.NET/issues/306
You will need to revert back to the previous version of those packages to get things working.
I've been using SQL Server Compact Edition 4.0 SP1 with Entity Framework for data access in one of our web applications for the past couple of years without problems, but in the last couple of days I've been getting errors when attempting to run the application locally from within IIS.
The error I'm getting is, unfortunately, not very helpful:
System.Data.SqlServerCe.SqlCeException: Unspecified error [ sqlcese40.dll ]
[EntityException: The underlying provider failed on Open.]
As I had just checked out a branch into a new directory, at first I thought the issue was caused by permissions, but granting the application pool read/write access did not fix it.
I tried a number of other things, uninstalling and reinstalling SQL Server CE etc... but this didn't fix the issue either.
Finally, I changed the "Enable 32-bit Applications" setting for the app pool to true and this "fixed" the issue and I was able to get the application running again.
I'm not satisfied with this solution however, as I've been running without this enabled for months without any problem and I want to figure out what has caused the issue but I'm a bit stumped as where to look next.
Just wondered if anyone had any suggestions?
Here is the full error from the Event Log:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 03/10/2016 12:39:00
Event time (UTC): 03/10/2016 11:39:00
Event ID: a0a208f33d6a4435a26d41aebf98e9a1
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain:
Trust level: Full
Application Virtual Path:
Process information:
Process ID: 752
Process name: w3wp.exe
Account name: IIS APPPOOL\XXX
Exception information:
Exception type: EntityException
Exception message: The underlying provider failed on Open.
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Entity.Internal.EdmMetadataRepository.QueryForModelHash(Func`2 createContext)
at System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext, ModelHashCalculator modelHashCalculator, Boolean throwIfNoMetadata)
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
Unspecified error [ sqlcese40.dll ]
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
Request information:
Request URL: -
Request path: -
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: -
Thread information:
Thread ID: 7
Thread account name: -
Is impersonating: False
Stack trace: at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Entity.Internal.EdmMetadataRepository.QueryForModelHash(Func`2 createContext)
at System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext, ModelHashCalculator modelHashCalculator, Boolean throwIfNoMetadata)
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
I have an exception every time I try to run my program without debugging (Ctrl+F5). The code seems to run fine with debugging. I have tried creating a temp project with just the essentials. I have reinstalled Visual Studio. The problem still occurs. There is already a post about this but not a clear answer.
My Connection String:
"Data Source=(localdb)\\ProjectsV12;Initial Catalog=gatdb;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False;Trusted_Connection=False;"
The Exception occurs here:
(SqlConnection connection = new SqlConnection(connectionString))
This is the exception:
System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
Source=System.Data
TypeName=System.Data.SqlClient.SqlConnection
StackTrace:
at System.Data.SqlClient.SqlConnection..ctor()
at System.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at GatHunter.Sql.IsServerConnected(String connectionString) in c:\users\kold\documents\visual studio 2015\Projects\ScatteredGats\GatHunter\Sql.cs:line 14
at GatHunter.Program.Main(String[] args) in c:\users\kold\documents\visual studio 2015\Projects\ScatteredGats\GatHunter\Program.cs:line 14
InnerException:
HResult=-2146233036
Message=The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception.
Source=System.Data
TypeName=System.Data.SqlClient.SqlConnectionFactory
StackTrace:
at System.Data.SqlClient.SqlConnection..cctor()
InnerException:
HResult=-2146233036
Message=The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception.
Source=System.Data
TypeName=System.Data.SqlClient.SqlPerformanceCounters
StackTrace:
at System.Data.SqlClient.SqlConnectionFactory..ctor()
at System.Data.SqlClient.SqlConnectionFactory..cctor()
InnerException:
BareMessage=Configuration system failed to initialize
HResult=-2146232062
Line=0
Message=Configuration system failed to initialize
Source=System.Configuration
StackTrace:
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.InitializeConfigSettings()
at System.Diagnostics.Switch.InitializeWithStatus()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp)
at System.Data.SqlClient.SqlPerformanceCounters..ctor()
at System.Data.SqlClient.SqlPerformanceCounters..cctor()
InnerException:
HResult=-2146233036
Message=The type initializer for 'System.Uri' threw an exception.
Source=System.Configuration
TypeName=System.Uri
StackTrace:
at System.Configuration.ClientConfigurationSystem..ctor()
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem()
InnerException:
HResult=-2146233036
Message=The type initializer for 'System.UriParser' threw an exception.
Source=System
TypeName=System.UriParser
StackTrace:
at System.Uri..cctor()
InnerException:
HResult=-2146233036
Message=The type initializer for 'System.Runtime.Versioning.BinaryCompatibility' threw an exception.
Source=mscorlib
TypeName=System.Runtime.Versioning.BinaryCompatibility
StackTrace:
at System.Runtime.Versioning.BinaryCompatibility.get_TargetsAtLeast_Desktop_V4_5()
at System.UriParser..cctor()
InnerException:
HResult=-2146233033
Message=Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
at System.Version.TryParseVersion(String version, VersionResult& result)
at System.Version.Parse(String input)
at System.Version..ctor(String version)
at System.Runtime.Versioning.BinaryCompatibility.ParseFrameworkName(String frameworkName, String& identifier, Int32& version, String& profile)
at System.Runtime.Versioning.BinaryCompatibility.ParseTargetFrameworkMonikerIntoEnum(String targetFrameworkMoniker, TargetFrameworkId& targetFramework, Int32& targetFrameworkVersion)
at System.Runtime.Versioning.BinaryCompatibility.ReadTargetFrameworkId()
at System.Runtime.Versioning.BinaryCompatibility.get_AppWasBuiltForFramework()
at System.Runtime.Versioning.BinaryCompatibility.BinaryCompatibilityMap..ctor()
at System.Runtime.Versioning.BinaryCompatibility..cctor()
InnerException:
In your connection string Integrated Security is set to False.
User ID = ****; Password = **** missing in your connection string.
If you would like to connect using Windows Authentication use
Integrated Security=SSPI; instead of Integrated Security=true;
If you try to use Integrated Security=true/false/yes/no with OleDb provider, you will get an exception during connection.
I want to thank everybody for their advise. I do not know why but what fixed this issue for me (even though I created an entirely new project and didn't touch the app.config) was this.
delete app.config
re-create via add->new item-> app.config
switch the target framework from 4.6.1 to 4.0 then back to 4.6.1
again.
Initially I wanted to see what the reaction was when I switched to the 4.0 framework and to my surprise it suddenly started working. I know this sounds strange and I have no explanation for it.
This mostly due an error in your app.config file, Check for badly formed XML or unexpected elements.
Also double check you connectionstring.
Try simplifying the connection string to;
string str="Data Source=(localdb)\\ProjectsV12;Initial Catalog=gatdb;Integrated Security=False;User ID=sa;Password=sa;";
SqlConnection connection = new SqlConnection(str);
and try again.
Do the following steps.
Create "xyz.udl" file on desktop.
Double click on that file.
Select appropriate provider
Select server
Set user / password and allow to save password
Select database and hit test connection.
Click on Ok button.
Open that "xyz.udl" file in notepad.
Copy your connection string and use that.
Can somebody please help me?
After receiving an email from Google yesterday that advised a couple of links in my site (www.bigint.biz) were broken, I repaired them. Then I made a change to the sitemap.
Afterwards, when accessing the site I received the message: Server Error in '/' Application, Runtime Error, This tag should then have its "mode" attribute set to "Off".
So, I put the site exactly back how it was before the changes to the sitemap; but, I received
an internal server error 500 error message.
Then, I removed the whole site from the host provider and uploaded it again with the original version that worked fine with no joy.
Since, I have set the customErrors tag "mode" attribute to "Off" to get a more detailed error message - below:
Server Error in '/' Application.
Unspecified error [ 5,sqlcese40.dll ]
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.Data.SqlServerCe.SqlCeException: Unspecified error [ 5,sqlcese40.dll ]
Source Error: Line 2: #{ Line 3: Line 4: WebSecurity.InitializeDatabaseConnection("PhotoGallery", "UserProfile", "UserId", "Email", true);
Source File: \web-123win\winpackage22\XXX.COM\web\content_AppStart.cshtml Line: 4
Stack Trace:
[SqlCeException (0x80004005): Unspecified error [ 5,sqlcese40.dll ]]
System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent) +2182
System.Data.SqlServerCe.SqlCeConnection.Open() +47
WebMatrix.Data.Database.EnsureConnectionOpen() +44
WebMatrix.Data.<QueryInternal>d__0.MoveNext() +66
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +164
WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args) +103
WebMatrix.WebData.DatabaseWrapper.QuerySingle(String commandText, Object[] parameters) +14
WebMatrix.WebData.SimpleMembershipProvider.CheckTableExists(IDatabase db, String tableName) +57
WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded() +49
WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +73
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) +51
ASP._Page__appstart_cshtml.Execute() in \\web-123win\winpackage22\bigint.biz\www.bigint.biz\web\content\_AppStart.cshtml:4
System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__0() +65
System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__3(Action action) +7
System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78
System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, IVirtualPathFactory virtualPathFactory, IEnumerable`1 supportedExtensions) +184
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, IVirtualPathFactory virtualPathFactory, IEnumerable`1 supportedExtensions) +30
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, IVirtualPathFactory virtualPathFactory, IEnumerable`1 supportedExtensions) +96
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +170
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +126
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71
System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +127
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9874568
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
I noticed that when I was uploading the site again using FileZilla Client that 4 files failed to copy to the host; however, the same files are in the host bin directory as they did not originally delete for some reason - access rights I think. The files are:
web/content/bin/X86/sqlceer40ENN.dll
web/content/bin/X86/sqlceqp40.dll
web/content/bin/X86/sqlcese40.dll
web/content/bin/X86/sqlceme40.dll
Is this just coincidence, as the error message references one of these files?
Any help would be really appreciated.
Thank you.
EDIT - I have found a little more info here but I am struggling to understand how it can help me: http://www.blakepell.com/Blog/?p=227
I have got the site back up and running for the minute by removing: WebSecurity.InitializeDatabaseConnection("PhotoGallery", "UserProfile", "UserId", "Email", true);
But the issue still exists
I picked this problem up again today all this time later and found the solution with research. This is how I got there.
Replacing the dll files as recommended above didn't work before.
So, I started again by switching off my custom errors page which enabled me to get to get to the error code again.
I Googled the error and research pointed to a connection string issue or a folder permissions issue.
It's a good job I checked the permissions again because I previously set the folder permissions in the App_Data folder where the .sdf database was to enable read and write access using FileZilla but nothing actually changed. It seemed to work because changes appeared to cascade down through all the sub directories, but it didn't work.
The permissions were not actually changed using the FTP method although it looked like it had happened. I only found out because another post that I saw today suggested changing permissions through the control panel so I went back there to check them only to see a padlock by the folders.
So, I unlocked the folder permissions on App_Data correctly this time in the control panel file manager. I then un-commented the web security code below in the _AppStart page again and tried the site online and it worked.
Finally, I set custom errors back to on.
The moral is use the control panel and not FTP client to change folder permissions on hosted folders. I hope this helps someone else.