I am attempting to upgrade Umbraco from 7.2.6 to 7.4.2
I've updated all the packages via NuGet but when I attempt to access the AuthorizeUpgrade URL and login to update the database, I get the following error:
System.Data.SqlClient.SqlException
Invalid column name 'securityStampToken',
Invalid column name 'lastLogindate'
As the database has not yet been updated, how can I access these 2 columns and why is the upgrade expecting them to be there when I login?
I've checked that the web.config has the correct membership values (the same as a clean install)
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
</providers>
</membership>
Is there anything else I can check? What is expecting the columns to be there when I authorize the upgrade?
Thanks
Mike
Try to open an incognito tab or clean all your cookies and try it again
Related
I just uploaded my Umbraco website to my server, but I'm getting the following error when trying to access it:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Exception has been thrown by the target of an invocation.
Source Error:
Line 143: <providers>
Line 144: <clear />
Line 145: <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
Line 146: <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
Line 147: </providers>
And there's no other information about the error. Anybody knows how to deal with this?
Thank you very much!
I got this error because I accidentally removed global.asax and packages.config from my Visual Studio solution. I restored these files from recycle bin and everything was fine again (think it was missing global.asax that was the culprit).
Just check the domain service settings, I am not clear about all the settings step but first of all you must set the target to 4.0(or on current) from the settings.
Reference - Error in "web.config" file when i load page in online
I have started developing ASP.NET MVC 4 application with the internet template. I want the login mechanism to work with an external database hosted on a full SQL server. The Internet template created by Visual Studio connects to a database on a localdb with SQLExpress. To make the login mechanism work with an external database I made the following changes:
1. Created the aspnet_schema on my external database using aspnet_regsql.exe.
2. Changed the connection string in the web.config to reflect the externaldb.
<connectionStrings>
<clear />
<add name="DefaultConnection" providerName="System.Data.SqlClient"
connectionString="Data Source=10.183.2.22\Sandbox,1432;
Initial Catalog=ForecastView;Integrated Security=False;
User ID=peak;Password=PvS20150401;
Connect Timeout=15;Encrypt=False;TrustServerCertificate=False" />
</connectionStrings>
3.Added the provider configuration in the web.config.
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider"
type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider,
System.Web,Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
requiresUniqueEmail="false" maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager>
<providers>
<clear />
<add connectionStringName="DefaultConnection" applicationName="/"
name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider,
System.Web, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
With the above changes the login mechanism for an external db works if I use the Mobile Application template for ASP.NET MVC 4. How to make this work for the Internet template? Any help is greatly appreciated!!
I am running into two main problems, which I believe may be related to each other.
When I run the asp.net configuration to set up the provider, it cannot connect.
While running the project, when I try to register a new user I get this error:
"The password retrieval answer provided is invalid. Please check the value and try again."
This is in an MVC4 project, default Internet Application Template. I haven't changed anything in the project other than generating the DB using the code first approach. The database was created the APP_DATA folder. I can connect to it fine in Server Explorer in VS2012, and that connection is coming from this connection string in the web.config:
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|Data Directory|\NerdlyThings.Models.NerdlyContext.mdf;Integrated Security=True;Connect Timeout=90" />
<membership>
<providers>
<add connectionStringName="DefaultConnection" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</providers>
</membership>
<roleManager>
<providers>
<add connectionStringName="DefaultConnection" applicationName="/"
name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</providers>
</roleManager>
I'm integration testing an MVC controller that uses the membership API. I've added my app.config below. The tests attempt to run, but when they make a call to the api, they return null. I inspect the Membership object, and it doesn't contain my connection string, it contains the default one that comes from the machine.config. It also does not pick up my configured application name. It seems to me that I have an issue with my app.config to the point where the membership api is not picking up its settings.
Can anyone spot the error?
var usr = Membership.GetUser(AValidGuid); This is always null!!!!
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web" />
<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web" />
</configSections>
<connectionStrings>
<add connectionString="server=;user id=;password=;database=" name="SqlProvider" />
</connectionStrings>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<remove name="AspNetSqlMembershipProvider"></remove>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="SqlProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/test" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="AspNetSqlProvider">
<providers>
<remove name="AspNetSqlRoleProvider"></remove>
<add connectionStringName="SqlProvider" applicationName="/test" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
</configuration>
Your app.config will need to be updated for the application executing the test. Is that what the posted app.config applies to? I know that's a basic thing but a lot of people get hung up on which config is being utilized by the test runner.
I was following the MVCMusic tutorial with an machine with full sql server 2008 r2
and full visual studio professional, in ASP.NET 4.0 and when I got to the page where it sets up membership (near page 66) the Web administration tool wont work, i got the following error:
An error was encountered. Please return to the previous page and try again.
my web config is like this:
<connectionStrings>
<clear />
<add name="MvcMusicStoreCN" connectionString="Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="MvcMusicStoreEntities" connectionString="metadata=res://*/Models.Store.csdl|res://*/Models.Store.ssdl|res://*/Models.Store.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MvcMusicStoreCN" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" applicationName="/" passwordFormat="Hashed" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider"
connectionStringName="MvcMusicStoreCN" applicationName="/" />
</providers>
</profile>
<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
<providers>
<clear />
<add connectionStringName="MvcMusicStoreCN" applicationName="/"
name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
<customErrors mode="Off">
</customErrors>
</system.web>
EDIT: I've run the
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe
executable and added the tables to my MvcMusicStore database sucessfully, changed the web.config from MY application (MVCMusicStore), and tryed running the ASP.NET Configuration shortcut, and got the error.
My Default Browser is firefox, and when I click the shortcut the browser doesn't even open the page, only when I right click on the tray icon and choose open in web browser.
I've solved it, I entered another project (VS 2010 doesn't let me change the default browser in an MVC project) changed the default browser, changed back to the MVC project and tryed opening the configuration again, and it worked.
Looks like the configuration doesn't allow firefox.
Thanks Anyway Raj.
Get your app to show detailed errors by turning off custom errors
http://msdn.microsoft.com/en-us/library/h0hfz6fc(VS.71).aspx
<configuration>
<system.web>
<customErrors mode="Off">
</customErrors>
</system.web>
</configuration>
I also experienced this problem and found out it was because the directory my solution was in contained a weird character. 'C:....\C#' Changing the directory to CSharp got rid of this problem.