Deployed App - SMO Error

Author Message
 Posted 12/3/2014 9:29:38 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 12/8/2014 4:29:38 AM
Posts: 80, Visits: 239
Hello,

From a non-development machine, I'm running a customized/compiled version of the SF Database Installer sample app and am getting the following error when the DDT metadata is deployed:

The SQLSMOMergeModulel.msm was installed on the workstation along with the SF DLL's.

Any ideas?

• 12/03/2014 2:10:53 PM -> Deploying meta-data for database 'DDTdeploymentTest'
X 12/03/2014 2:10:53 PM -> An error occurred while deploying the meta-data to the server.
X 12/03/2014 2:10:53 PM -> IndexOutOfRangeException       
X 12/03/2014 2:10:53 PM ->   Index was outside the bounds of the array.       
X 12/03/2014 2:10:53 PM ->        
X 12/03/2014 2:10:53 PM -> Source     : Microsoft.SqlServer.Smo       
X 12/03/2014 2:10:53 PM ->        
X 12/03/2014 2:10:53 PM -> Stack Trace:        
X 12/03/2014 2:10:53 PM ->        
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap)       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.PropertyCollection.GetProperty(String name)       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.get_StringComparer()       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)       
X 12/03/2014 2:10:53 PM ->    at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.Contains(ObjectKeyBase key)       
X 12/03/2014 2:10:53 PM ->    at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.FindDatabase(Int32 DatabasePK)       
X 12/03/2014 2:10:53 PM ->    at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.EnsureDatabases()       
X 12/03/2014 2:10:53 PM ->    at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployMetaDataThread()       
X 12/03/2014 2:10:53 PM ->  
Post #32770
Add to Twitter Add to Facebook
 Posted 12/4/2014 3:26:19 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 12/8/2014 4:29:38 AM
Posts: 80, Visits: 239
FYI - I do not get the error when running the same app on my development workstation.
Post #32773
Add to Twitter Add to Facebook
 Posted 12/4/2014 3:35:04 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 12/8/2014 4:29:38 AM
Posts: 80, Visits: 239
Is the current SQLSMOMergeModulel.msm on StrataFrame's download area compatible with SQL Server 2012?
Post #32774
Add to Twitter Add to Facebook
 Posted 12/4/2014 6:28:14 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 12/8/2014 4:29:38 AM
Posts: 80, Visits: 239
Tried the same install on Win7x64 Pro and am seeing the same SMO error.

I installed the 2012 CLR/SMO packages on the same workstation and am seeing the same error.

I'm kind of dead in the water and unable to deploy a functioning database update utility to my customers at this point.

Does anyone have a basic install package and app that uses MDDeployMain() and works to update SQL Server 2012 SP2 databases?

Mind if I take a copy?
Post #32777
Add to Twitter Add to Facebook
 Posted 12/4/2014 9:01:52 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 11/20/2019 8:57:25 AM
Posts: 6,610, Visits: 6,776
William:

It doesn't look like an SMO issue, but rather something that is going on within your package.  The portion that mentioned "PropertyNameToIDLookupWithException" is what is making me think that something else is going...that exception CAME from SMO.  That being said, here is what I would do.  First, create a simple database and table and package it up.  Attempt to deploy to an environment other than development to prove this point.  Then, start looking over the structures to see if there is something not quite right with one of your primary key fields on your table structures.

I think that it is going to be somewhere in this neighborhood versus the SMO not working.  Did it create anything when you deployed the structures?  Did it at least create the database or did it fail right off of the bat?
Post #32779
Add to Twitter Add to Facebook
 Posted 12/4/2014 9:10:08 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 5/16/2018 3:20:37 AM
Posts: 2,982, Visits: 2,482
You are correct in that it is an issue with SQL Server 2012.  MS changed the engine enough that it will not work with the SMO that is distributed.  That error occurs when the SMO tries to enumerate the databases.  Funny thing is, SQL Server Management Studio also uses SMO, so for a long while, I was not able to connect to any of the SQL Server 2012 databases in our office with my development workstation because I only had SQL Server 2008 R2 Developer and the accompanying Management Studio installed.  I would get the same exact IndexOutOfRange error whenever I tried to connect with the Object Explorer and open the Databases node in the tree.

We have not had the issue with deployment because our updates are almost always done local to the SQL Server.  Our updater is run on the same machine, and if SQL Server 2012 is installed on the same machine where you try to run the DDT, it works properly.  I am not sure if this is because the SMO will use the v11 (2012) SMO objects from the GAC (I doubt it) or if the SQL Native Client needs to be updated on the machine (more likely).  I have not researched the issue beyond knowing that it doesn't work.  I would start by installing the newest SQL Server Native Client or SQL Server Connectivity SDK on the machine you're trying to deploy from.  If you're still stuck after that, let me know, and I will do some more digging.
Post #32781
Add to Twitter Add to Facebook
 Posted 12/4/2014 9:51:59 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 4/9/2021 12:42:36 PM
Posts: 2,436, Visits: 24,184
Hi All,

Ben, now that you mentioned this, I remember, yes there is a version I use for SMO which works fine for me with MS-SQL 2012 - 2014, you can find the link here in this post http://forum.strataframe.net/FindPost32382.aspx

William, download that version and see if that work for you.
Be aware that the files you need from above link are:
  • 1033\x64\SharedManagementObjects.msi
  • 1033\x86\SharedManagementObjects.msi


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)


Edited: 12/4/2014 9:56:01 AM by Edhy Rijo
Post #32786
Add to Twitter Add to Facebook
 Posted 12/4/2014 10:11:08 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 12/8/2014 4:29:38 AM
Posts: 80, Visits: 239
Thanks Ben.

I can confirm that after installing the SQL Server 2012 Express Management Studio (and associated bundled tools), the update tool works. Here's the link to the download page:

http://www.microsoft.com/en-us/download/details.aspx?id=43351

There are a number of files that can be downloaded from that page, but I only grabbed the management studio ones:

SQLManagementStudio_x86_ENU.exe

SQLManagementStudio_x64_ENU.exe

So, I have a work around for now.

Thanks!

Might be good to post that the current SMO on the SF download page is not SQL 2012 compatible and point to this forum link for more info.
Post #32788
Add to Twitter Add to Facebook
 Posted 12/4/2014 10:29:05 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 5/16/2018 3:20:37 AM
Posts: 2,982, Visits: 2,482
William,

I'm glad you found a workaround.  I thought that installing just the management tools and associated connectors would fix it, but I had never confirmed that.  We've always installed full SQL Server 2012 (Standard or Development depending on the machine), so I had never tried it with only installing the management tools.

Edhy,

Thanks for that post.  I remember us running into that problem when trying to get over the x64 stuff, but I didn't remember whether it worked with SQL Server 2012.  I do have a folder on my computer that has the 2008 R2 SMO objects saved off that I have to copy back to the GAC on a computer after installing SQL Server 2012 in order to be able to build the DBEngine from source.  

We used SMO hoping it would simplify things, but every time SQL Server has a new version we run into deployment/compilation problems.  I'm guessing we're going to have the same issues with SQL Server 2014 when it becomes more widespread.

Hrm... Maybe that's why we've avoided SMO for V2...
Post #32789
Add to Twitter Add to Facebook
 Posted 12/5/2014 8:15:44 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 4/9/2021 12:42:36 PM
Posts: 2,436, Visits: 24,184
Hi William,
William Fields (12/4/2014)
I can confirm that after installing the SQL Server 2012 Express Management Studio (and associated bundled tools), the update tool works..


Be aware that for an end user, you don't need to install the SQL Management Studio, that is overkill for any installation, what you need is the SharedManagementObjects.msi as posted in my previous message.
in fact here are the link for SQL 2014 which includes the files you need:

Microsoft® SQL Server® 2014 Feature Pack

http://www.microsoft.com/en-in/download/details.aspx?id=42295

Remember you will need these 2 files for either x64 or x86
  • SharedManagementObjects.msi
  • SQLSysClrTypes.msi
Enjoy!!!!


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)


Edited: 12/5/2014 8:36:17 AM by Edhy Rijo
Post #32790
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.