L'ho trovato dopo molte ricerche e ho dedicato molto tempo a questo in VS 2014
- Crea
Database ProjectChiamato "CLR_Test" - Crea
LibraryPer il client WCF "CLR_Service_Client" -
Aggiungi
Serivce Refrencedel servizio wcf a "CLR_Test", quindi aggiungi il riferimento di "CLR_Service_Client" a "CLR_Test"
4. Devi modificare l'opzione DB per poter eseguire assembly non sicuri con il codice seguenteALTER DATABASE SaleAutomation SET TRUSTWORTHY ON RECONFIGURE -
In "CLR_Test"
Project PropertiesnelSQLCLRset di schedePermission levelaUnsafe(esiste un altro modo in cui dopo la pubblicazione del progetto ne cambi il livello dalla gestione del server sql e un altro modo è aggiungere il livello di autorizzazione allo script di pubblicazione puoi usarli ciascuno,
ma devi notare che se usi daproject propertiessolo il progetto "CLR_Test" crea automaticamenteUnsafee devi usare altri modi per impostare "CLR_Service_Client"Unsafe)

6.Esegui questo script per aggiungere Sqlserver per poter eseguire il servizio wcf
CREATE ASSEMBLY
SMDiagnostics from
'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\SMDiagnostics.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY
[System.Web] from
'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Web.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY
[System.Messaging] from
'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY
[System.IdentityModel] from
'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY
[System.IdentityModel.Selectors] from
'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.Selectors.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY -- this will add service modal
[Microsoft.Transactions.Bridge] from
'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\Microsoft.Transactions.Bridge.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY -- this will add service modal
[System.Runtime.Serialization] from
'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.Runtime.Serialization.dll'
with permission_set = UNSAFE
GO
CREATE ASSEMBLY -- this will add service modal
[System.ServiceModel] from
'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.ServiceModel.dll'
with permission_set = UNSAFE
GO
- ora pubblichi il tuo progetto ed esegui la stored procedure e divertiti.