2013-07-24 28 views
0

我有一个网站与。NET框架4和telerik 2012,当我上传我的网站在服务器上我的网页之一有这个错误。关于连接字符串名称的ASP.NET错误

The entry 'ConnectionString' has already been added.

解决这个犯错我用这个solution

<remove name="ConnectionString" /> 

这行后,我的定义在web配置连接。但这种犯错apear:

** Method not found: 'System.Web.UI.ScriptResourceDefinition System.Web.UI.ScriptResourceMapping.GetDefinition(System.String)'. 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.MissingMethodException: Method not found: 'System.Web.UI.ScriptResourceDefinition System.Web.UI.ScriptResourceMapping.GetDefinition(System.String)'.

源错误:

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.

**

{Note : this err just occurred on the server not in local } and when i removed this line : <remove name="ConnectionString" /> the first err apear again : The entry 'ConnectionString' has already been added.

我现在该怎么办?

+0

你有两个问题,当你解决连接字符串问题时,出现java脚本问题。他们似乎不太可能相关,我会针对js问题创建一个新问题。 – faester

+0

连接问题解决后发生的第二个问题,也是在服务器上加载时发生的,但在本地运行良好 –

+1

连接池中还有另一个与您的connectionString具有相同名称的ConnectionString。也许你应该检查你的IIS连接池。 –

回答

1

请检查您的Web服务器上的框架版本,它应该是4.5。在4.0 GetDefinition函数中,没有超载只能给出一个字符串参数。在web.config中保留以下条目,因为它与您得到的其他错误无关。

<remove name="ConnectionString" /> 
+0

起初我的框架版本是4.5,服务器是4.我把我的网站框架从4.5改为4.你认为我的问题的原因是这样吗? –

+0

@hony可能是这个问题,请检查您本地web.config的部分,如果它涉及正确版本的System.Web.Extensions.dll。 –

+1

如果您的网络服务器有4.5可用,则将其框架版本更改为4.5。 –