Hello again,
We have been testing our deployment package using a clean Windows 7 operating system. No software is installed except for what is installed when the OS is installed. When we installed our project onto this machine we noticed a strange error which was happening when we attempted to call the following function: MsSqlServer2008FeatureLayer.FeatureSource.GetColumns. The really funny thing is that it does not fail when the 'Table' property of the MsSqlServer2008FeatureLayer is a plain table, but only when you are trying to open data from a view. The view can be something as simple as "SELECT * FROM Table".
Here is the the error with the stack trace:
I find it interesting that it seems to be trying to load Microsoft.SqlServer.Types.dll v 10.0.0.0. I repeat, the error does not happen if you are opening a regular table, only a view. Here's another hint. I loaded SQL Server Express 2008R2 onto the test machine and the error went away. I then uninstalled SQL Server Express and the error came back. I have written a small project with and install package that demonstrates the error, it's too big to attach but if you want it let me know and I will email it to you.
Exception Message:
Could not load file or assembly 'Microsoft.SqlServer.Types,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
or one of its dependencies. The located assembly's manifest definition
does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
Exception Target Site: GetTypeByName
---- Stack Trace ----
System.RuntimeTypeHandle.GetTypeByName(name As String, throwOnError As Boolean, ignoreCase As Boolean, reflectionOnly As Boolean, stackMark As StackCrawlMarkHandle, loadTypeFromPartialName As Boolean, type As ObjectHandleOnStack)
GeoSuite.exe: N 00000
System.RuntimeTypeHandle.GetTypeByName(name As String, throwOnError As Boolean, ignoreCase As Boolean, reflectionOnly As Boolean, stackMark As StackCrawlMark&, loadTypeFromPartialName As Boolean)
GeoSuite.exe: N 00314
System.Type.GetType(typeName As String, throwOnError As Boolean)
GeoSuite.exe: N 00089
System.Data.SqlClient.SqlConnection.CheckGetExtendedUDTInfo(metaData As SqlMetaDataPriv, fThrow As Boolean)
GeoSuite.exe: N 00047
System.Data.SqlClient.SqlDataReader.GetFieldTypeInternal(metaData As _SqlMetaData)
GeoSuite.exe: N 6306756
System.Data.SqlClient.SqlDataReader.GetFieldType(i As Int32)
GeoSuite.exe: N 00155
System.Data.ProviderBase.SchemaMapping.SetupSchemaWithoutKeyInfo(mappingAction As MissingMappingAction, schemaAction As MissingSchemaAction, gettingData As Boolean, parentChapterColumn As DataColumn, chapterValue As Object)
GeoSuite.exe: N 6260166
System.Data.ProviderBase.SchemaMapping..ctor(adapter As DataAdapter, dataset As DataSet, datatable As DataTable, dataReader As DataReaderContainer, keyInfo As Boolean, schemaType As SchemaType, sourceTableName As String, gettingData As Boolean, parentChapterColumn As DataColumn, parentChapterValue As Object)
GeoSuite.exe: N 00414
System.Data.Common.DataAdapter.FillMappingInternal(dataset As DataSet, datatable As DataTable, srcTable As String, dataReader As DataReaderContainer, schemaCount As Int32, parentChapterColumn As DataColumn, parentChapterValue As Object)
GeoSuite.exe: N 00174
System.Data.Common.DataAdapter.FillMapping(dataset As DataSet, datatable As DataTable, srcTable As String, dataReader As DataReaderContainer, schemaCount As Int32, parentChapterColumn As DataColumn, parentChapterValue As Object)
GeoSuite.exe: N 00185
System.Data.Common.DataAdapter.FillFromReader(dataset As DataSet, datatable As DataTable, srcTable As String, dataReader As DataReaderContainer, startRecord As Int32, maxRecords As Int32, parentChapterColumn As DataColumn, parentChapterValue As Object)
GeoSuite.exe: N 00161
System.Data.Common.DataAdapter.Fill(dataTables As DataTable[], dataReader As IDataReader, startRecord As Int32, maxRecords As Int32)
GeoSuite.exe: N 00609
System.Data.Common.DbDataAdapter.FillInternal(dataset As DataSet, datatables As DataTable[], startRecord As Int32, maxRecords As Int32, srcTable As String, command As IDbCommand, behavior As CommandBehavior)
GeoSuite.exe: N 00371
System.Data.Common.DbDataAdapter.Fill(dataTables As DataTable[], startRecord As Int32, maxRecords As Int32, command As IDbCommand, behavior As CommandBehavior)
GeoSuite.exe: N 00504
System.Data.Common.DbDataAdapter.Fill(dataTable As DataTable)
GeoSuite.exe: N 00324
ThinkGeo.MapSuite.Core.MsSql2008FeatureSource.GetColumnsCore()
GeoSuite.exe: N 00784
ThinkGeo.MapSuite.Core.FeatureSource.GetColumns()
GeoSuite.exe: N 00057
MapUtilities.CustomSQLFeatureLayer.FindDisplayField()
CustomSQLFeatureLayer.vb: line 0295, col 07, IL 0034
MapUtilities.FeatureSelection.FindFeaturesInSelectableLayers(oFeatureLayers As GeoCollection`1, oSelectionRect As RectangleShape, oMap As CustomWinformsMap, oSelectedFeature As Feature&)
FeatureSelection.vb: line 0367, col 22, IL 0118
MapUtilities.FeatureSelection.DoSelection(oMap As CustomWinformsMap, oTrackSelectionShape As BaseShape&, eSelectionType As EnumMapTool, bShowNodes As Boolean, bControlKeyDown As Boolean)
FeatureSelection.vb: line 0174, col 13, IL 0121
GeoSuite.frmMain.TrackOverlayTrackEnded(sender As Object, e As TrackEndedTrackInteractiveOverlayEventArgs)
frmMain.vb: line 1791, col 16, IL 0178
ThinkGeo.MapSuite.DesktopEdition.TrackInteractiveOverlay.JBg=()
GeoSuite.exe: N 00560
ThinkGeo.MapSuite.DesktopEdition.TrackInteractiveOverlay.MouseUpCore(interactionArguments As InteractionArguments)
GeoSuite.exe: N 00160
ThinkGeo.MapSuite.DesktopEdition.TrackInteractiveOverlay.MouseClickCore(interactionArguments As InteractionArguments)
GeoSuite.exe: N 00169
ThinkGeo.MapSuite.DesktopEdition.WinformsMap.ERY=(EhY= As InteractionArguments)
GeoSuite.exe: N 00255
8BM=.axU=.lhU=(lxU= As Object, mBU= As EventArgs)
GeoSuite.exe: N 00132
System.Windows.Forms.TimerNativeWindow.WndProc(m As Message&)
GeoSuite.exe: N 00073
System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr)
GeoSuite.exe: N 00364
I get this error with both the Production and Development build.
Thanks!
Steve