我開發了一個小型C#應用程序,使我可以使用配置爲服務引用的Bing地理編碼服務對地址表進行地理編碼。我有裝配加載,但是當我嘗試通過存儲過程來調用它,我收到以下錯誤:SQL 2008 CLR和Bing地圖
A .NET Framework error occurred during execution of user-defined routine or aggregate "Geocoder":
System.InvalidOperationException: Could not find endpoint element with name 'BasicHttpBinding_IGeocodeService' and contract 'BingMapsGeo.IGeocodeService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
System.InvalidOperationException:
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor(String endpointConfigurationName)
at Geocoder.BingMapsGeo.GeocodeServiceClient..ctor(String endpointConfigurationName)
at Geocoder.UserDefinedFunctions.geocode(SqlString AddressLine, SqlString City, SqlString State, SqlString Zip)
我相當肯定實際的C#程序集是正確的,但我覺得我失去了一些東西與問候實際的Web服務。
我一直在尋找解決方案,但還沒有找到一個似乎工作。
我使用最新的修補程序和.NET版本在Server 2008R2上運行SQL 2008R2。
任何想法將是最受歡迎的。
在文檔中它說在sqlservr.exe.config裏面的配置是不受支持的? System.Configuration是一個受支持的程序集,所以不支持使用配置的是什麼? – 2011-05-28 00:40:03
@Jonathan:AFAIK在文檔中沒有提到'sqlservr.exe.config'破解並且使用它依賴於無證行爲。依靠它的應用程序會中斷SQLCLR的數據庫遏制(代碼在故障切換後或恢復後將不起作用)。 – 2011-05-28 00:52:16
文檔中沒有關於您可以使用SQLCLR做的許多事情,並不意味着它們是黑客或不受支持的。網上的書沒有包括2008年的擴展事件是第一次RTM,這並沒有使他們不受支持,並且有很多關於它們的東西,但仍然只在我的博客文章中,就像SQLCLR中的東西是隻在非MS博客文章中。 – 2011-05-28 03:50:48