Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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,

VB
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 


it was working fine with this dlls.

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

VB
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,
Error:
"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()"
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
Posted
Updated 22-May-15 3:05am
v3
Comments
krish2013 22-May-15 0:45am    
Hi all,
i have also faced same issue.

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:

C#
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.Management.Sdk.Sfc
 
Share this answer
 
Comments
D-Kishore 22-May-15 9:03am    
Yes you are correct, but i have replaced all the files then only i deployed to the server, no luck
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900