Friday, February 24, 2012

HELP ME PLEASE! GODADDY - ASPNETDB Security DB

Hi,

I have two sql db's. One for company record info, other for users (aspnetdb) I created the users one using the login control and web administration wizard. This all worked well until I had to publish to godaddy. I had to rebuild my company db, but eventually I was able to pull info and all that is working. The problem is, how the heck do I add users? I noticed that it put users table in my db to start. So I manually went into the db on godaddy's servers, and added an application. Then when I tried to add a user manually, it kept giving me errors. Is there an easier way to add website users through godaddy? Something like the web admin tool that comes with visual studio? Man it is driving me crazy!!!

For the poor man's approach, you can upload a file from the learnvisualstudio.net tutorials (begennirs lesson 09),

Signup.aspx

<%@. Page Language="C#" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99"
BorderStyle="Solid" BorderWidth="1px" ContinueDestinationPageUrl="~/Default.aspx"
Font-Names="Verdana" Font-Size="10pt" Style="z-index: 100; left: 241px; position: absolute;
top: 152px">
<WizardSteps>
<asp:CreateUserWizardStep runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" />
<TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" />
<SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="#FFFFFF" />
<NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" HorizontalAlign="Center" />
<CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<StepStyle BorderWidth="0px" />
</asp:CreateUserWizard>

</div>
</form>
</body>
</html
And here's my Web.config file:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<!--
<trace enabled="true" requestLimit="50" localOnly="false"/>
-->
<compilation debug="true"/>
<roleManager enabled="true"/>
<customErrors mode="Off"/>
<authentication mode="Forms"/
<membership defaultProvider="MySqlMembershipProvider" >
<providers>
<clear/>
<add name="MySqlMembershipProvider"
connectionStringName="MyLocalSQLServer"
applicationName="MyAppName"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
</system.web
<connectionStrings>
<add name="MyLocalSQLServer"
connectionString="Data Source=whsql-v01.prod.mesa1.secureserver.net;Initial Catalog=DB_nnnnn;User ID=user;Password=password;" />
</connectionStrings
</configuration
|||I'd like to know if there is decent user management app for this.

Also when I work with Roles I run into errors. Since I don't have access to the ASP.NET configuration tool I'm notsure if Role Management Enabled is checked on godaddy servers or ifthis would even matter for this app.

Here's my error screen.

Server Error in '/' Application.

TheSSE Provider did not find the database file specified in the connectionstring. At the configured trust level (below High trust level), the SSEprovider can not automatically create the database file.

Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details:System.Configuration.Provider.ProviderException:The SSE Provider did not find the database file specified in theconnection string. At the configured trust level (below High trustlevel), the SSE provider can not automatically create the database file.

Source Error:

Line 11: }
Line 12:
Line 13: if (Roles.IsUserInRole("Basic User") == false)
Line 14: Server.Transfer("unauthorized.aspx");
Line 15: }


Source File: d:\Hosting\javagrinder\SecurePage.aspx Line: 13

Stack Trace:

[ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.]
System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString) +2466581
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +87
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +771
System.Web.Security.RolePrincipal.IsInRole(String role) +272
System.Web.Security.Roles.IsUserInRole(String username, String roleName) +533
System.Web.Security.Roles.IsUserInRole(String roleName) +16
ASP.securepage_aspx.form1_Load(Object sender, EventArgs e) in d:\Hosting\javagrinder\SecurePage.aspx:13
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42|||Hi JavaGrinder, have you tried setting the trust level higher (e.g. "Full")?|||

Lori,

Can you explain how to do that? That may solve another problem I am running into...

Thanks!

|||Ah, that's probably the problem. I get the following error, and am contacting godaddy to see if I can have them unlock this and allow overrides for sites upon request.

I suspect there is something more to it since I'm having troubles adding roles to the tables from their SQL server manager. I can add users and applications from that panel, but not Roles.

Server Error in '/' Application.

Configuration Error

Description:Anerror occurred during the processing of a configuration file requiredto service this request. Please review the specific error details belowand modify your configuration file appropriately.

Parser Error Message:Thisconfiguration section cannot be used at this path. This happens whenthe site administrator has locked access to this section using<location allowOverride="false"> from an inherited configurationfile.

Source Error:

Line 22: </providers>
Line 23: </membership>
Line 24: <trust level="Full"/>
Line 25: </system.web>
Line 26: </location>


Source File: d:\hosting\javagrinder\web.config Line: 24


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42|||

Java,

Let me know how this goes... I am trying to run the reportviewer control from their servers and it gives me permssion errors. I have heard that the reportviewer control requires full trust. Please let me know if they allow you to use full trust.

Thanks!

|||

Oh and by the way Java, I had asked Godaddy before about the trust level and all they kept saying was that I could create folders myself. I don't think they really had a clue what I was talking about... Good luck and let me know how it goes!! I might have to end up swiching host since I need this reportviewer control to work..

Thanks!

|||They say on shared hosting the trust level is set to medium. You have to have a dedicated hosting account to increase it to full.|||Ok, so after talking to godaddy support (useless) I started searching around on google again. I don't know where I got this web.config, but it works for me. Maybe it will work for report viewer.

-Jon

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
<location allowOverride="true"
<system.web>
<!--
<trace enabled="true" requestLimit="50" localOnly="false"/>
-->
<compilation debug="true"/>
<!-- roleManager enabled="true"/ -->
<customErrors mode="Off"/>
<authentication mode="Forms"/>
<membership
<providers
<remove name="AspNetSqlMembershipProvider" /
<add name="AspNetSqlMembershipProvider"

type="System.Web.Security.SqlMembershipProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="MyLocalSQLServer"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="true"

applicationName="/"

requiresUniqueEmail="false"

passwordFormat="Hashed"

maxInvalidPasswordAttempts="5"

minRequiredPasswordLength="7"

minRequiredNonalphanumericCharacters="1"

passwordAttemptWindow="10"

passwordStrengthRegularExpression="" /
</providers
</membership
<profile
<providers
<remove name="AspNetSqlProfileProvider" /
<add name="AspNetSqlProfileProvider"

connectionStringName="MyLocalSQLServer"

applicationName="/"

type="System.Web.Profile.SqlProfileProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a" /
</providers>

</profile
<roleManager enabled="true">

<providers
<remove name="AspNetSqlRoleProvider" /
<add name="AspNetSqlRoleProvider"

connectionStringName="MyLocalSQLServer"

applicationName="/"

type="System.Web.Security.SqlRoleProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a" /
</providers
</roleManager>
<!--
<membership defaultProvider="MySqlMembershipProvider" >
<providers>
<clear/>
<add name="MySqlMembershipProvider"
connectionStringName="MyLocalSQLServer"
applicationName="MyAppName"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
-->
</system.web>
</location>
<connectionStrings>
<add name="MyLocalSQLServer"
connectionString="Data Source=whsql-v01.prod.mesa1.secureserver.net;Initial Catalog=DB_nnnnnn;User ID=userid;Password=password;" />
</connectionStrings
</configuration>|||

Didn't work for me :( I still get this error...

Required permissions cannot be acquired.

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.Security.Policy.PolicyException: Required permissions cannot be acquired.

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:

[PolicyException: Required permissions cannot be acquired.] System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2737861 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57[FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141 System.Reflection.Assembly.Load(String assemblyString) +25 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3479081 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177 System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +267 System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +36 System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +429 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +73 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +580 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31 System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

No comments:

Post a Comment