4

我的网站在旧主机上运行完美,但现在我搬到了新主机

请注意:主机同一主机上的VPS

所以我已经停止付钱给他,现在我托管在与共享主机相同的主机上。

因此,我将所有文件移至根文件夹并在Web.config中配置 SQL 详细信息

由于某种原因,我无法加载该网站。我一直都有错误。 请帮我!

在我修复了我的 Ajax 问题之后.. 这里->无法加载文件或程序集 'System.Web.Extensions, Version=1.0.61025.0 错误

我遇到了另一个问题..

这是我的 Sql 服务器详细信息:

服务器名称:WEBSQL2K5

服务器版本:Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)

Windows NT 5.2 上的标准版(内部版本 3790:Service Pack 2)

myLittleAdmin(用于 SQL Server 和 MSDE)v.2.7 r.118

这是连接字符串

<connectionStrings>
        <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/>
    </connectionStrings>

“/”应用程序中的服务器错误。

 A connection was successfully established with the server, but then an
 error occurred during the login process. (provider: TCP Provider,
 error: 0 - The specified network name is no longer available.)

描述: 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.

异常详情: System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

源错误:

Line 25032:            this.Adapter.SelectCommand.Parameters[0].Value = ((int)(id));
Line 25033:            main_ds.TXTDataTable dataTable = new main_ds.TXTDataTable();
Line 25034:            this.Adapter.Fill(dataTable);
Line 25035:            return dataTable;
Line 25036:        }

源文件: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs Line: 25034

堆栈跟踪:

[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +527
   System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +359
   System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket() +88
   System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +39
   System.Data.SqlClient.TdsParserStateObject.ReadByte() +20
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +107
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
   main_dsTableAdapters.TXTTableAdapter.GetDataByID(Int32 id) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs:25034
   _Default.InitSeo() in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:36
   _Default.Page_Load(Object sender, EventArgs e) in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:28
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

网络配置:

<?xml version="1.0"?>
<configuration>
    <appSettings>
        <add key="SiteAddress" value="http://www.picit.co.il/" />
        <add key="SSLSiteAddress" value="https://bonsite-secure.co.il/picit/" />

        <add key="EMAIL_HOST" value="mail.barak.net.il"/>
        <add key="EMAIL_CONTACT_NAME" value="PicIt"/>
        <add key="EMAIL_USER" value="bonsite-barak.net.il"/>
        <add key="EMAIL_PASS" value="013013"/>
        <add key="MASTER_USERNAME" value="bonsite"/>
        <add key="MASTER_PASSWORD" value="master123#"/>

        <add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/>
        <add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/>
    </appSettings>
    <connectionStrings>
        <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <globalization culture="he-IL" uiCulture="he-IL"/>
        <sessionState mode="InProc"/>
        <customErrors mode="Off"/>
        <identity impersonate="true"/>
        <authentication mode="Windows"/>
        <httpRuntime maxRequestLength="22000"
minFreeThreads="16"
executionTimeout="500"
useFullyQualifiedRedirectUrl="false"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="1000" />
        <pages theme="Front">
            <namespaces>
                <add namespace="Website"/>
            </namespaces>
            <controls>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/>
                <add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/>
                <add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
                <add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/>
                <add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/>
                <add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/>
                <add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/>

                <add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/>
            </controls>
        </pages>
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </assemblies>
        </compilation>
        <httpModules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </httpModules>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
            <add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
        </httpHandlers>
    </system.web>
    <system.webServer>
        <modules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
        </modules>
        <handlers>
            <add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
            <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
            <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>
</configuration>
4

9 回答 9

1

I know this is already answered, and these solutions might have worked as well, but I just ran into this problem, and after several hours of trying different suggestions from around the web - one thing worked.

  • Reset IIS app pool that my web app was using.

Sometimes going back to the basics helps!

于 2014-02-20T18:33:06.087 回答
1

再次,您必须要求您的提供商创建MS-SQL databaseusername或者password您可以通过控制面板创建它。

于 2011-10-14T01:41:52.547 回答
1

我有这个问题。

发生这种情况是因为已为数据库服务器分配了第二个 IP 地址。在客户端,名称解析的地址是运气,我得到了新地址。

删除第二个 IP 地址解决了这个问题。

我怀疑 SQL 服务器正在侦听原始地址,但没有侦听附加地址。

于 2013-07-03T11:02:35.437 回答
1

就我而言,“TCP 提供程序,错误:0 - 指定的网络名称不再可用。” 错误是由网络安全设备引起的。一旦来自该服务器的数据库连接被排除在安全监控之外,这个问题就解决了。

于 2014-03-12T06:54:48.647 回答
0

我想补充一点,如果您在系统中使用 *.ini 文件,您可能需要检查在那里输入的服务器名称,并确保它与您的 web.config 连接字符串中的相同。

于 2014-10-24T06:55:06.703 回答
0

我遇到了这个问题并遇到了这篇文章,我想我会添加对我有用的解决方案,因为它没有列出。

更新 System.Data.SqlClient nuget 包解决了该错误。

于 2020-04-16T17:01:11.957 回答
0

我遇到了同样的错误,但能够通过在通过 SSMS 连接时明确选择“TCP/IP”作为网络协议来解决它

SSMS 连接

于 2020-04-23T17:34:57.043 回答
0

我在指向显示相同错误消息的可用性组侦听器名称的 SSRS 数据源上遇到了同样的问题:

报表服务器无法使用您输入的信息连接到数据源。确保您已正确输入连接字符串和任何凭据。
与服务器成功建立连接,但在登录前握手期间发生错误。(提供者:TCP 提供者,错误:0 - 指定的网络名称不再可用。)

我的问题出在只读路由 URL 配置中。端点端口 5022 不起作用。当我使用默认端口时,数据源工作正常。

每个副本的 URL 配置应该是 (SECONDARY_ROLE(READ_ONLY_ROUTING_URL = N'TCP://FQDN:1433')

于 2020-09-28T17:01:17.730 回答
0

我有一个类似的问题,但不完全相同:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established enter code here with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The specified data could not be decrypted.)

我按照@password 重新启动应用程序池,但随后查看了高级设置,发现“启用 32 位应用程序”设置为 false。我把它改成了真的,我的问题就解决了。希望这对尝试过所有其他建议并陷入死胡同的人有所帮助。

于 2016-01-03T15:50:19.380 回答