惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - Aricc

如何在已有内网网络中增加项目专用域名解析服务器(DNS) Windows使用命令行查看cpu的温度 屌丝公司:设置服务器的时区、时间及时间同步 从QNAP威联通NAS的Container Station中的容器中复制文件到本地Window电脑 sourcetree外部差异/合并工具设置 树莓派插入U盘自动拷贝系统日志到U盘或通过U盘升级程序 树莓派开通VPN服务端时IPTable设置 - Aricc 动态调用WebService的代理类 为Owin项目增加WebApi 如何一步一步新建一个Owin项目 WebApi Owin OAuth Sql Server查看死锁及堵塞脚本 路由表脚本 配电管家 数据绑定时(<%#Eval)单引号双引号嵌套问题 About SSDT BI 在Win8中用批处理创建Oracle数据库时报“Unable to open file” 收藏网址 TX-2B/RX-2B射频发送/接收电路
SQL SERVER 2005 CLR存储过程调用WCF,64位操作系统。
Aricc · 2012-02-17 · via 博客园 - Aricc

前几天写过一篇Blog,试验也成功了,其中有一台也是64位的操作系统。但是这几天在另外一台服务器上部署时就是不行,部署没有问题,在执行的时候报错:

消息 6522,级别 16,状态 1,过程 QueryPseudoCode,第 0
在执行用户定义例程或聚合 'QueryPseudoCode' 期间出现 .NET Framework 错误:
System.TypeInitializationException: The type initializer for 'StoreProc.WCF_Query' threw an exception. ---> System.IO.FileLoadException: 未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。主机存储区中的程序集与 GAC 中的程序集具有不同的签名。 (异常来自 HRESULT:0x80131050)
System.IO.FileLoadException:
at StoreProc.WCF_Query..cctor()
System.TypeInitializationException:
at StoreProc.WCF_Query.QueryPseudoCode(Byte queryType, String queryCode, String& queryResult)

后来找到另外一个版本的。好像是行了,为什么行了就不知道了。
 

EXEC sp_configure 'clr enabled', 1;
RECONFIGURE WITH OVERRIDE;
GO
ALTER DATABASE [master] SET Trustworthy ON 

               
 CREATE ASSEMBLY  
 [System.Web] from 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Web.dll' 
 with permission_set = UNSAFE --Fails if not 64 on 64 bit machines 
 GO  
 
 
 CREATE ASSEMBLY 
 SMDiagnostics from 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\SMDiagnostics.dll' 
 with permission_set = UNSAFE 
 GO  
 
 
 CREATE ASSEMBLY  
 [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   
 [System.IdentityModel] from 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll' 
 with permission_set = UNSAFE 
 GO 
 
 
 
 CREATE ASSEMBLY        
 [System.IdentityModel.Selectors] from 'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.Selectors.dll'      
 with permission_set = UNSAFE      
 GO            
 
 
 CREATE ASSEMBLY       
 [System.Messaging] from      'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Messaging.dll'      
 with permission_set = UNSAFE      
 GO            
 
 
 CREATE ASSEMBLY      
 [Microsoft.Transactions.Bridge] from      'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\Microsoft.Transactions.Bridge.dll'      
 with permission_set = UNSAFE      
 GO 
 
 
 
 
 
 
 ------------------------------
 
 
use master 


CREATE ASSEMBLY 
StoreProc from
'D:\StoreProcedure.dll'
with permission_set = UNSAFE 
  
GO 
  
-------------------------------------------------------------- 
 
CREATE PROCEDURE [dbo].[QueryPseudoCode]
(
	@queryType tinyint,
	@queryCode nvarchar(255),
	@queryResult nvarchar(255) out
)
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [StoreProc].[StoreProc.WCF_Query].[QueryPseudoCode]
GO
--------------------------------------------------------------

CREATE PROCEDURE [dbo].[QueryUserPosition]
(
	@numType tinyint,
	@num nvarchar(255)
)
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [StoreProc].[StoreProc.WCF_Query].[QueryUserPosition]
GO



/*


DROP PROCEDURE QueryPseudoCode
DROP PROCEDURE QueryUserPosition
DROP ASSEMBLY StoreProc

DROP ASSEMBLY [Microsoft.Transactions.Bridge]
DROP ASSEMBLY [System.IdentityModel.Selectors]
DROP ASSEMBLY [System.IdentityModel]
DROP ASSEMBLY [System.Web]
DROP ASSEMBLY [System.Messaging]
DROP ASSEMBLY [System.Runtime.Serialization]
DROP ASSEMBLY [SMDiagnostics]


*/

 在提示machine.config异常时,把下面所示的两行注释掉就OK了:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config
        <commonBehaviors>
<endpointBehaviors>
<!--<Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>-->
</endpointBehaviors>
<serviceBehaviors>
<!--<Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>-->
</serviceBehaviors>
</commonBehaviors>