locked
Classifieds Website hosted in godaddy, Trust Issue. RRS feed

  • Question

  • User822267303 posted

    Hi All,

    I deployed starter classified website in godaddy. Some pages are not working properly. Example (MyAds.aspx, MyProfile.aspx, Register.aspx). I think the issue is with trust level.It expects full trust level. But godaddy does not allows full trust applications.

    The error is:

    Security Exception

    Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Can someone help me to get a workaround or a solution to fix this issue. OR suggest me wheather i have to go with some other hosting provider who allow full trust level application.

    Regards,

    Richard I.P


    Saturday, November 22, 2008 2:53 PM

All replies

  • User-1311796039 posted

     Hey there Richard

    Today i just uploaded all the files up on godaddy.

    But i cant even acess the Default.aspx on the browser.

    Ikeep getting this error:( An error occurred. Please contact the site administrator.)

    How did you get bypass this issue ?

    Please help.

    Another thing when registering a new account user it seems like no password would work.How did you fix that ?

    Thanks Richard.

    Hope in hearing from you soon.

    Damien 

    Saturday, November 22, 2008 8:40 PM
  • User1055287656 posted

    The Security exception is likely caused by something in your web.config file.  I run a modified version of the classified site in a medium trust environment, the same as godaddy and I don't have the issue.  I did have issues with the connection string causing the same error you have.  For example if you use ;&#xD in the connection string. If you can post your web.config i can help you.

    Saturday, November 22, 2008 9:14 PM
  • User1055287656 posted

    if you try to register with no password the field validators will catch it, and indeed it will fail, you must have a password.  Now about the other issue you have, you are not providing enough information about the error for us to help you.  We need the full error output.

    Saturday, November 22, 2008 9:17 PM
  • User-1311796039 posted

     Im entering a password .Ive tried everything it keeps giving me this error

    Password length minimum: 7. Non-alphanumeric characters required: 1.


    Thanks 



     

    Saturday, November 22, 2008 9:36 PM
  • User-1311796039 posted

     My other issue is : i uploaded all the files

    i went to the browser enterd: post.youradult411.com/Default.aspx

    and it points to error.aspx page. 

    Saturday, November 22, 2008 9:40 PM
  • User1055287656 posted

    That is because your password does not contain some character that is not numeric or alpha, for example any of the following !@#$%^&*()-+  You can turn that off by changing the web.config membership connection settings:

    See the setting in bold italics, that is set to "1" in original web.config

    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>

     

    Saturday, November 22, 2008 9:47 PM
  • User1055287656 posted

    remove the following line from the web.config to see full error:

     

    <customErrors defaultRedirect="Error.aspx" mode="RemoteOnly"/>

     

    Saturday, November 22, 2008 9:49 PM
  • User-1311796039 posted

     did what you told me this is the error

     

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
     
     
     
     
     
     
     
     
    thanks appreciate the help

    Saturday, November 22, 2008 10:01 PM
  • User-1311796039 posted

     HELLO

    Chris

     

    this is my web.config file

    if you see anything wrong please let me know....   thanks

     

    <?xml version="1.0" encoding="utf-8"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <location path="Admin">
        <system.web>
          <authorization>
            <allow roles="Administrators" />
            <deny users="*" />
          </authorization>
        </system.web>
      </location>
      <location path="PostAd.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="EditPhotos.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="MyAds.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="MyProfile.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <system.web>
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

        <pages styleSheetTheme="Red" />
        <authentication mode="Forms" />
        <membership>
          <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
          </providers>
        </membership>
        <profile enabled="true">
          <properties>
            <add name="FirstName" type="System.String" />
            <add name="LastName" type="System.String" />
            <add name="MemberId" defaultValue="0" type="System.Int32" />
            <group name="Core" />
          </properties>
        </profile>
        <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" />
        <compilation debug="false" />
        <siteMap defaultProvider="RoleEnabled_AspNetXmlSiteMapProvider" enabled="true">
          <providers>
            <clear />
            <add name="RoleEnabled_AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true" />
          </providers>
        </siteMap>
      </system.web>
      <connectionStrings>
        <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"  />
      </connectionStrings>
      <system.net>
        <mailSettings>
          <smtp>
            <network
              host="yourSMTPhostname"
              port="25"
              defaultCredentials="true"
              userName="enterUserNameHereIfRequired"
              password="enterPasswordIfRequired"/>
            /&gt;
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>

    Saturday, November 22, 2008 10:25 PM
  • User1055287656 posted

    I see two things wrong with the web.config you posted.  First, remove this from the web.config

    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

    that causes a parse error. Second thing I see that is a problem, you have the role manager set to AspNetWindowsTokenRoleProvider and you cannot manage windows users on godaddy's boxes.  You need to either use the SqlRoleProvider, or set the line back they way it was in the starter kit, which was:

    <roleManager enabled="true"/>

     

    Saturday, November 22, 2008 10:34 PM
  • User-1311796039 posted

     Good morning Chris

     

    I went ahead and changed my web.config file 

    and my Default page is still coming up with an error.    Thanks once again

     

    this is how the file looks like now::

    <?xml version="1.0" encoding="utf-8"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <location path="Admin">
        <system.web>
          <authorization>
            <allow roles="Administrators" />
            <deny users="*" />
          </authorization>
        </system.web>
      </location>
      <location path="PostAd.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="EditPhotos.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="MyAds.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <location path="MyProfile.aspx">
        <system.web>
          <authorization>
            <deny users="?" />
          </authorization>
        </system.web>
      </location>
      <system.web>


        <pages styleSheetTheme="Red" />
        <authentication mode="Forms" />
        <membership>
          <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
          </providers>
        </membership>
        <profile enabled="true">
          <properties>
            <add name="FirstName" type="System.String" />
            <add name="LastName" type="System.String" />
            <add name="MemberId" defaultValue="0" type="System.Int32" />
            <group name="Core" />
          </properties>
        </profile>
        <roleManager enabled="true" />
        <compilation debug="false" />
        <siteMap defaultProvider="RoleEnabled_AspNetXmlSiteMapProvider" enabled="true">
          <providers>
            <clear />
            <add name="RoleEnabled_AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true" />
          </providers>
        </siteMap>
      </system.web>
      <connectionStrings>
        <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"  />
      </connectionStrings>
      <system.net>
        <mailSettings>
          <smtp>
            <network
              host="yourSMTPhostname"
              port="25"
              defaultCredentials="true"
              userName="enterUserNameHereIfRequired"
              password="enterPasswordIfRequired"/>
            /&gt;
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>

     

     

    Sunday, November 23, 2008 10:15 AM
  • User-1311796039 posted

     

     I tried entering all my pages on the browser and all of them give me the same( runtime error )

    so there is something really wrong on my (web.config file)

     

    what about here::  (does ithe SMTP HSTE WITH USER AND PASSWORD HAVE TO BE MENTIONED ?

    <network
              host="yourSMTPhostname"
              port="25"
              defaultCredentials="true"
              userName="enterUserNameHereIfRequired"
              password="enterPasswordIfRequired"/>
            /&gt;
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>

    Sunday, November 23, 2008 10:31 AM
  • User822267303 posted

    Hi, This is the connection string which i use.

    <add name="classifiedsConnection" connectionString="Data Source=p3nw3shsql-v01.shr.prod.phx3.secureserver.net;Initial Catalog=xxxxx;Persist Security Info=True;User ID=xxxxx;Password=xxxxx;" providerName="System.Data.SqlClient"/>

    If the connection string is wrong how can i able to add all the categories as admin and view it on th homepage? and while registering (submitting) i am taken to error.aspx page, but the values are there in the database.

    The same error is thrown when i work in my developement machine by changing the Trust level="Medium". If I change it to FULL then it works fine.

     Regards,

    Richard I.P

     

    Sunday, November 23, 2008 10:37 AM
  • User822267303 posted

    Hi Damien, I have'nt faced this issue. Just use the connection string properly. I am using this connection string. and I have worked a lot on the membership provider, so totally how the member details is saved is diffrent from the original version.

    <add name="classifiedsConnection" connectionString="Data Source=p3nw3shsql-v01.shr.prod.phx3.secureserver.net;Initial Catalog=xxxxx;Persist Security Info=True;User ID=xxxxx;Password=xxxxx;" providerName="System.Data.SqlClient"/>

    Regards, Richard I.P

     

    Sunday, November 23, 2008 10:40 AM
  • User822267303 posted

    Hi, This is the validator control for the password field. which works fine for me. I removed the "ValidationExpression" property.

    <legend>Password:</legend><span>

    <asp:TextBox Runat="server" TextMode="Password" ID="Password" CssClass="register_password"></asp:TextBox></span>

    <asp:RequiredFieldValidator Runat="server" ControlToValidate="Password" ValidationGroup="CreateUserWizardControl"

    ErrorMessage="Password is required." ToolTip="Password is required." ID="PasswordRequired">

    </asp:RequiredFieldValidator>

     

    Regards,Richard I.P

    Sunday, November 23, 2008 10:45 AM
  • User730446648 posted

    This is simple, put your web.config back to how it came with the kit.

    And this is your error.

    <connectionStrings>
        <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"  />
      </connectionStrings>

     

    To fix this you just need to tell the web.config how to connect to your godaddy databases.

    Note that there are two databases, the aspmembers database and the classifieds database.

    The code for the connection strings work great when used on your local computer,
    so I recommend keeping a copy of the original for use on your local computer.

    GoDaddy makes it easy, to get your connection string.
    I recommend using two MSSQL databases, and if you click the description (I think) tab
    it will give you proper information to use instead of my xxxxx's.

    It should be a format simular to this, note that the second string (LocalSqlServer) is the string for the aspmembers database.

    <connectionStrings>
        <add name="classifiedsConnection" connectionString="Data Source=whsql-vxxxxxxxxxxsecureserver.net;
          Initial Catalog=xxxxxxxxxx;
          User ID=user;
          Password='Pass';" />

        <remove name="LocalSqlServer"/>

        <add name="LocalSqlServer" connectionString="Data Source=whsql-xxxxxxxxxxxx.secureserver.net;
          Initial Catalog=xxxxxxxxxxxx;
          User ID=user;
          Password='pass';" />

      </connectionStrings>

    Also take a look at another post I did, it's a more complete walk through to use godaddy as your host server.

    http://forums.asp.net/t/1196793.aspx

    Good Luck

    Daniel

     

    Sunday, November 23, 2008 10:57 AM
  • User-1311796039 posted

     Hey there Richard

    on the  :Initial Catalog=xxxxx  WHAT MUST I WRITE THERE DATABASE NAME.

    HOW DO I ENABLE  MY CONFIG FILE SO IT CAN GIVE ME THE FULL STACK ERROR  ...THANKS 

    Sunday, November 23, 2008 11:26 AM
  • User-1311796039 posted

     Hey there Daniel

    Thanks 

    Iwent onto that other forum you listed and i have done every thing and it still gives me the same problem do i need 2 sql servers

    im doing it wth only one. this is how my config looks now:

    <add name="LocalSqlServer" connectionString="Data Source=p3nw3shsql-v01.shr.prod.phx3.secureserver.net; Initial Catalog=xxxxxt; User ID=xxxxxt; Password='xxxxx';/>
      </connectionStrings>

    Sunday, November 23, 2008 12:17 PM
  • User1055287656 posted

    You do not need 2 SQL servers, but you do need the two connection strings.  They can both point the same server and initial catalog (ie database) as long as all the tables and all exist.  Also, in the connection string you posted, you are missing a closing quotation mark. 

     This is the connection string for the asp membership:

    <add name="LocalSqlServer" connectionString="Data Source=p3nw3shsql-v01.shr.prod.phx3.secureserver.net; Initial Catalog=xxxxx; User ID=xxxxx; Password=xxxxx;"/>
      </connectionStrings>

     

    Now you need the other one that is used by the data.  The other article you were pointed to goes into in detail.

    Sunday, November 23, 2008 3:32 PM
  • User730446648 posted

    While chris is right that you don't have to have two databases, it is bad practice, and a long drawn out process to combine the two into one.

    Not to mention your database size limit will be reached long before it would have with two seperate databases.

    So basically it's better performance, and a lot easier to use two MSSQL databases.

    Sunday, November 23, 2008 10:53 PM
  • User-694986221 posted

    I have been raking my Brains too.

    Just got of the phone with godaddy and apparently the only way to get full trust is by using "ASP.net 1.1"

    Best wishes,

    Jeff P

    Saturday, February 21, 2009 2:26 AM
  • User730446648 posted

    Hey Jeff you should really start a new post to help you with your specific issue.

    But why do you need Full trust?

    I use 2 MSSQL databases with Asp.Net 2.0

    Works great!

    Saturday, February 21, 2009 10:09 AM