سؤال

هذا هو أول مشروع ASP.NET الخاص بي وأنا عالق على الفور.

أقوم بإعداد BugTracker على Webhotel البعيد ولكن لا يمكنني الحصول على الاتصالات للعمل. إذا قلنا أن مضيفي يسمى Hosting.org وسيكون موقع الويب الخاص بي www.trallala.com

ماذا يجب أن أتغير في هذا البرنامج النصي؟

<configSections>
</configSections>

<system.web>

    <!--
    BugTracker.NET is not compatible with Session serialization.

    Timeout session after 120 minutes
    -->

    <sessionState mode="InProc" timeout="120"/>

    <compilation debug="true">
        <assemblies>
            <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        </assemblies>
    </compilation>
    <pages validateRequest="true" />
    <!-- A few people over the years have needed to override the default IIS settings...
    <httpRuntime executionTimeout="300" maxRequestLength="51200"/>
    -->

    <!-- for my testing <globalization culture="de-DE" uiCulture="en-US" /> -->

</system.web>
<appSettings>
    <!-- 

        ********* QUICK START *************

        If you want to get started quickly, then just change the following
        and then try to log in:

            ConnectionString
            AbsouteUrlPrefix

        After you can log in and create a bug, then you probably want to
        set up the email integration.  Set up the following:

            ErrorEmailTo
            ErrorEmailFrom

            NotificationEmailEnabled
            NotificationEmailFrom

            And your SMTP settings below.

    -->
    <!--
        Change this to point to your database
    -->

    <add key="ConnectionString" value="server=(local)\SQLEXPRESS;database=btnet;user id=sa;password=x;Trusted_Connection=no"/>
    <!--
        Used when creating absolute href's.  For example, in notification emails.
        Don't forget trailing slash!.
    -->
    <add key="AbsoluteUrlPrefix" value="http://127.0.0.1/btnet2/"/>
    <!--
        You can turn the logging and emailing of errors on and off.
        Log file name is "btnet_log_yyyy_mm_dd.txt"

        For the LogFileFolder setting, if you specify the folder starting with a 
        drive letter or the \\ that indicates a UNC path, it's treated as a full path.  
        For example: c:\\something or \\somemachine\something

        Otherwise it's treated as a path relative to where you virtual directory is
        located.

        LogEnabled turns on and off logging as a whole.
        LogSqlEnabled turns on and off just the logging of SQL statements, but
        that's about 98% of what gets logged, so if you want to reduce the
        volume, turn that off.

    -->
    <add key="LogEnabled" value="1"/>
    <add key="LogSqlEnabled" value="1"/>
    <add key="LogFileFolder" value="App_Data\logs"/>
    <!-- If BugTracker.NET itself experiences an error, it can send an email notification -->
    <add key="ErrorEmailEnabled" value="1"/>
    <add key="ErrorEmailTo" value="YOUR EMAIL HERE"/>
    <add key="ErrorEmailFrom" value="FROM EMAIL HERE"/>


    <!--
        You can "subscribe" to email notifications on a per-bug basis.
        You will receive an email whenever the bug is updated.
    -->
    <add key="NotificationEmailEnabled" value="1"/>
    <add key="NotificationEmailFrom" value="FROM EMAIL HERE"/>

    <!--
        This controls the format of the subject of the email notifications.
        The available variables are:
        $THING$ - from the "SingularBugLabel" setting
        $BUGID$
        $ACTION$ - added or changed
        $SHORTDESC$
        $PROJECT$
        $CATEGORY$
        $ORGANIZATION$
        $PRIORITY$
        $STATUS$
        $TRACKINGID$ - from the "TrackingIdString" setting
    -->
    <add key="NotificationSubjectFormat" value="$THING$:$BUGID$ was $ACTION$ - $SHORTDESC$ $TRACKINGID$"/>

    <!--
        If you aren't using the local SMTP server that comes with IIS,
        set the name, user, and password for your SMTP server here.
    -->

    <!-- Sample SMTP Settings -->

    <!--
        These settings work with my SBC account
    -->
    <!--
    <add key="SmtpServer" value="smtp.att.yahoo.com"/>
    <add key="SmtpServerAuthenticateUser" value="ctrager@sbcglobal.net"/>
    <add key="SmtpServerPort" value="465"/>
    <add key="SmtpUseSSL" value="1"/>
    <add key="SmtpServerAuthenticatePassword" value="MY PASSWORD"/>
    -->
    <!--
        These settings work with my GMail account
    -->
    <!--
    <add key="SmtpServer" value="smtp.gmail.com"/>
    <add key="SmtpServerAuthenticateUser" value="ctrager@gmail.com"/>
    <add key="SmtpServerPort" value="465"/>
    <add key="SmtpUseSSL" value="1"/>
    <add key="SmtpServerAuthenticatePassword" value="MY PASSWORD"/>
    -->


    <!--
        These settings work with my GoDaddy account
    -->

    <!--        
    <add key="SmtpServer" value="relay-hosting.secureserver.net"/>
    <add key="SmtpServerAuthenticateUser" value="ctrager@ifdefined.com"/>
    <add key="SmtpServerAuthenticatePassword" value="MY PASSWORD"/>
    <add key="SmtpServerPort" value="25"/>      
    -->

    <!--
        Specify the pickup directory if you have the problem described here:
        http://support.microsoft.com/default.aspx?scid=kb;en-us;816789#8
    -->

    <!--
    <add key="SmtpServerPickupDirectory" value=""/>
    <add key="SmtpSendUsing" value="1"/>
    -->


    <!--
        Ignore this setting unless you are esperiencing the symptoms
        related to this: http://cr.yp.to/docs/smtplf.html
    -->
    <!--
    <add key="SmtpForceReplaceOfBareLineFeeds" value="1"/>
    -->
    <!--
        By default, emails are UTF8 encoded.  If that doesn't work for you,
        uncomment the following.
    -->
    <!--
    <add key="BodyEncodingUTF8" value="0"/>
    -->
هل كانت مفيدة؟

المحلول

<add key="ConnectionString" value="Persist Security Info=true;User ID=bugtracker;Password=bugs;Initial Catalog=BugTracker;Data Source=[IP ADDRESS]" />

هذا هو ما تحتاجه لإضافة / تحرير في Web.config. بمجرد أن يقوم برنامج الإعداد، سيقوم BugTracker بتشغيل البرامج النصية لإنشاء عناصر قاعدة البيانات المناسبة.

نصائح أخرى

تحتاج إلى التأكد من أن "الاتصالات" يشير إلى قاعدة البيانات الصحيحة ولديها اسم المستخدم وكلمة المرور الصحيحة للوصول إلى DB.

قد ترغب في التأكد من أن قاعدة البيانات الخاصة بك هي في الواقع قيد التشغيل وتشغيلها وأن اسم المستخدم وكلمة المرور صحيحة بمجرد محاولة تسجيل الدخول كتلك المستخدم في DB.

إذا لم ينجح ذلك، فما لم تكمن المشكلة مع تكوين ASP.NET الخاص بك.

ال وثائق bugtracker.net يتضمن هذا القسم على سلاسل الاتصال:

الجزء الأصعب ... بالنسبة لمعظم الناس يحصلون على connectiontring للعمل.

للحصول على المساعدة، راجع هذه الروابط، قسم "SQLConnection (.NET)"
http://www.connectionstrings.com/؟carrier=sqlserver2005.
http://www.sqlstrings.com/sql-server-connection-strings.htm.
https:/web.archive.org/articles.techrepublic٪2ECOM٪2ECOM/5100-3513_11-6084879.html.

شيء آخر قد تحاول الحصول على سلسلة اتصال صحيح هو ما يلي:

  1. قم بإنشاء ملف فارغ جديد واسمه Test.udl.

  2. انقر نقرا مزدوجا فوقه، ويجب أن يظهر مربع حوار "خصائص ارتباط البيانات".

  3. في علامة التبويب "مقدمي الخدمات"، حدد "Microsoft OLE DB Provider ل SQL Server" أو "عميل SQL الأصلي"

  4. في علامة التبويب "اتصالات"، جرب إعدادات مختلفة واستخدم زر "اتصال الاختبار" لاختبارها. انقر فوق "موافق" عندما يعمل.

  5. افتح ملف Test.udl في المفكرة ونسخ السطر الذي يبدأ ب "موفر =" في قيمة "ConnectionTring" في Web.config "، ولكن حذف الجزء الصغير الذي يقول" مزود = SQLNCLI.1؛ "

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top