Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I would thank first to help me for my earlier issues with CLR Trigger,now it got deployed and am trying to start test,it throws error when am insert or update the record and it terminates.

Error:

Msg 6522, Level 16, State 1, Procedure WCFTrigger, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate 'WCFTrigger':
System.TypeInitializationException: The type initializer for 'Triggers' threw an exception. ---> System.Configuration.ConfigurationErrorsException: The type 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' registered for extension 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior' could not be loaded. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 185)
System.Configuration.ConfigurationErrorsException:
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfi...
The statement has been terminated.



The trigger created in my table :
SQL
CREATE TRIGGER [WCFTrigger] ON [dbo].[tbCR]  AFTER  INSERT, UPDATE AS 
EXTERNAL NAME [ServiceClient].[Triggers].[Trigger1]
GO
EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFile', @value=N'WCFTrigger.cs' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tbCR', @level2type=N'TRIGGER', @level2name=N'WCFTrigger'

GO
EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFileLine', @value=N'55' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tbCR', @level2type=N'TRIGGER', @level2name=N'WCFTrigger'



Please some one throw me a light what am missing here.Am running on VS 2010 but target Frame work is 3.0.

Thanks in Advance
Posted
Updated 18-Jan-12 13:37pm
v2

1 solution

look man try to run this script in your Database

CSS
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO



it is to enable th CLR sometimes it gives like these errors but take care if you may go to cloud in your application...you cant use clr in cloud windows azure take care about that
regards
 
Share this answer
 
Comments
shan1395 19-Jan-12 5:23am    
Thanks youssef_123, before i was create an assembly, already enabled CLR and the rest you mentioned but some how it was throwing error,so i deleted all the assemblies and change the machine.config and re created it.This time it created assembly with out hassle anyway thanks for your help.Am using CLR in my WCF.
Member 8087944 6-Jul-12 17:29pm    
Dear shan1395

I have the following error while running assemblies from SQL Server 2008. Please guide me. what to change in machine.config? please clarify. Thanks in advance.

Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "CityTemperature":
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 127.0.0.1:80
System.Net.Sockets.SocketException:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
System.Net.WebException:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at WeatherConsumer.WeatherReference.WeatherService.GetTemperatureForCity(String city)
.


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