CopyExceptionFailedException:Microsoft.SqlServer.Management.Smo.FailedOperationException的复制异常失败 [英] CopyExceptionFailedException: Copy exception failed for Microsoft.SqlServer.Management.Smo.FailedOperationException

查看:75
本文介绍了CopyExceptionFailedException:Microsoft.SqlServer.Management.Smo.FailedOperationException的复制异常失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Coders,



我们有两个服务器,如开发(Windows Server 2008 R2和SQL Server 2005和Visual Studio 2010)和部署(Windows Server 2008 R2和SQL Server 2005)服务器。



部署服务器我们在2年前从开发服务器部署了asp.net应用程序。

跟随,



Hi Coders,

We have two servers like development(windows server 2008 R2 and SQL server 2005 and visual studio 2010) and deployment(windows server 2008 R2 and SQL server 2005)server.

in the deployment server we have deployed asp.net application from development server 2 years back.

in that asp.net application we have referenced dlls are following,

Microsoft.SqlServer.ConnectionInfo.dll-> version:10.0
Microsoft.SqlServer.Management.Sdk.Sfc.dllversion:10.0
Microsoft.SqlServer.Smo.dll-> version:10.0
Microsoft.SqlServer.SmoExtended.dll-> version:10.0
Microsoft.SqlServer.SqlClrProvider.dll-> version:10.0
Microsoft.SqlServer.SqlEnum.dll-> version:10.0 





这个dll工作得很好。



后来在开发服务器中我们添加了以下最新的项目参考,





it was working fine with this dlls.

Later in the development server we have added the following latest references to the project,

Microsoft.SqlServer.ConnectionInfo.dll-> version:11.0
Microsoft.SqlServer.Management.Sdk.Sfc.dllversion:11.0
Microsoft.SqlServer.Smo.dll-> version:11.0
Microsoft.SqlServer.SmoExtended.dll-> version:11.0
Microsoft.SqlServer.SqlClrProvider.dll-> version:11.0
Microsoft.SqlServer.SqlEnum.dll-> version:11.0





在开发服务器中它工作正常没有任何问题。



测试完成后我们将其部署到部署服务器,当我们运行应用程序时,它抛出了以下错误,



In the development server it is working fine without any issues.

After testing done we deployed this to the deployment server, when we running the application, it was throwing the following error,

错误:

CopyExceptionFailedException:Microsoft.SqlServer.Management.Smo.FailedOperationException的复制异常失败:目标引发了异常请参阅原始错误的内部异常.---> Microsoft.SqlServer.Management.Smo.FailedOperationException:数据库'Test_Newsetup_RDM'的预取对象失败.---> System.IndexOutOfRangeException:索引超出了界限范围Microsoft.SqlServer.Management.Smo.Prope上的Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName,PropertyAccessPurpose pap)中的数组。 Microsoft.SqlServer.Management.Smo.Database.PrefetchObjectsImpl(类型objectType,ScriptingOptions scriptingOptions)中的Microsoft.SqlServer.Management.Smo.Database.CheckDbCompatibilityLevel()的rtyCollection.GetValueWithNullReplacement(String propertyName,Boolean throwOnNullValue)---内部异常结束堆栈跟踪---在Microsoft.SqlServer.Management.Smo.Database.PrefetchObjectsImpl(类型objectType,ScriptingOptions scriptingOptions)在DbTools.DbaTasks_CatModelling.Workflow.CopyDatabaseObjectsCmd.GenerateScripts()

"CopyExceptionFailedException: Copy exception failed for Microsoft.SqlServer.Management.Smo.FailedOperationException: Exception has been thrown by the target of an invocation. See the inner exception for the original error. ---> Microsoft.SqlServer.Management.Smo.FailedOperationException: Prefetch objects failed for Database 'Test_Newsetup_RDM'. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap) at Microsoft.SqlServer.Management.Smo.PropertyCollection.GetValueWithNullReplacement(String propertyName, Boolean throwOnNullValue) at Microsoft.SqlServer.Management.Smo.Database.CheckDbCompatibilityLevel() at Microsoft.SqlServer.Management.Smo.Database.PrefetchObjectsImpl(Type objectType, ScriptingOptions scriptingOptions) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Smo.Database.PrefetchObjectsImpl(Type objectType, ScriptingOptions scriptingOptions) at DbTools.DbaTasks_CatModelling.Workflow.CopyDatabaseObjectsCmd.GenerateScripts()"

我无法弄清楚问题,在部署服务器上完成部署之后,部署服务器需要重新启动。



问候

KishoreD

I am unable to figure out the issue, after deployment is done on the deployment server is this restart required for the deployment server.

Regards
KishoreD

推荐答案

搞定了。强烈建议删除旧版SQL Server中对SMO dll的引用。并且必须包含对新SQL Server版本提供的新SMO dll的引用。



最低限度,您将参考以下内容:



Got it. It is highly recommended to remove the references to SMO dlls in older versions of SQL Server. And references to the new SMO dlls that are provided with new SQL Server version must be included.

Minimally, you would reference the following:

Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.Management.Sdk.Sfc


微软官方网站提供了一个很好的参考资料,关于向前兼容性(不会修复)和向后兼容性(Denali SSMS将能够管理2000,2005,2008,2008 R2) : http://connect.microsoft.com/SQLServer/feedback/details/622441
A good reference is available at Microsoft's official site about forward compatibility (not going to fix) and backward compatibility (Denali SSMS will be able to manage 2000, 2005, 2008, 2008 R2): http://connect.microsoft.com/SQLServer/feedback/details/622441


这篇关于CopyExceptionFailedException:Microsoft.SqlServer.Management.Smo.FailedOperationException的复制异常失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆