2011-10-21 13 views
0

.net4.0でWebサービスを作成しました。 ODP.NET4によってoracle-databaseに接続します。私はODAC112021Xcopy_X64を使い、odp4とasp4をインストールしました。このサービスは開発環境でうまく動作します。ODP.NET 64bitを使用した.NET Webサービス

しかし、同じマシン上で実行されているIISにそれを公開した後、私は次の例外を取得:

 
System.ServiceModel.FaultException`1 was unhandled 
    Message=Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
    Source=mscorlib 
    StackTrace: 
    Server stack trace: 
     at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) 
     at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
    Exception rethrown at [0] 

私は64ビットodp.netを使用し、私は、Windows Server 2008 R2 64ビット上で実行されているとして64ビットに切り替えていますVisual Studio。

誰かが私に行方不明または間違っていることを教えてもらえますか?

また、ORACLE.DATACCESS.dllをbinフォルダにコピーしようとしました。事前

答えて

0

おかげで、私は問題を再作成することはできませんので、これは暗闇の中でのショットですが、IISで実行するときに、あなたがある特定のフレームワーク(ここであること4.0)のための信頼レベルことを確認する必要がありますusingは適切なdllとファイルにアクセスできます。

アンインストール/ ODPのビットを再インストールするか、または は直接4 \ OraProvCfg.exe

\ 11.2.0 \ client_1 \ odp.net \ binに\ %のORA_HOMEの\製品で「オラクル許可のソフトウェアを呼びます

%ora_home \ product \ 11.2.0 \ client_1 \ odp.net \ doc \ readme.txt (ここでは私があなたにとって興味深いと思われるものを紹介しています)

============================== 
ORACLEPERMISSION RELATED NOTES 
============================== 

1. Configuring OraclePermission for Web Applications in high or medium trust 

For Web Applications operating under high or medium trust, OraclePermission 
needs to be configured in the appropriate "web_<trust level>.config" file so 
that the application does not encounter any security errors. This 
configuration can be done through the OracProvCfg tool. OraProvCfg.exe will 
make the appropriate entries in both web_hightrust.config as well as 
web_mediumtrust.config associated with the specified .NET framework version. 

Given below is an example on the usage of OraProvCfg tool for configuring 
OraclePermission in a .NET 2.0 web application: 

    OraProvCfg.exe /action:config /product:odp /component:oraclepermission 
        /frameworkversion:v4.0.30319 
        /providerpath:<Oracle.DataAccess.dll full path> 

On running the above command, The following entry will be made in 
"web_hightrust.config" and "web_mediumtrust.config" under ASP.NET permissionset 

<IPermission class="Oracle.DataAccess.Client.OraclePermission, Oracle.DataAccess, Version=4.112.2.50, Culture=neutral, PublicKeyToken=89b483f429c47342" version="1" Unrestricted="true" /> 

OraProvCfg can also be used to remove these entries from these config files 
when they need to be removed. 

    OraProvCfg.exe /action:unconfig /product:odp /component:oraclepermission 
        /frameworkversion:v4.0.30319 
        /providerpath:<Oracle.DataAccess.dll full path> 


2. Configuring OraclePermission For Windows Applications in partial trust 

For Windows applications operating in a partial trust environment, the 
OraclePermission entry should be specified under the appropriate permission 
set in security.config file. (Security.config is available in 
%windir%\Microsoft.NET\Framework\{version}\CONFIG). The example below 
specifies the OraclePermission entry that would be required for a .NET 2.0 
Windows application 

<IPermission class="Oracle.DataAccess.Client.OraclePermission, Oracle.DataAccess, Version=4.112.2.50, Culture=neutral, PublicKeyToken=89b483f429c47342" version="1" Unrestricted="true" /> 

は、具体的には、「(をこれらの設定ファイルをチェックアウトweb_hightrust.config「と」web_mediumtrust.config「)と同様のエントリの検索

<IPermission class="Oracle.DataAccess.Client.OraclePermission, 
Oracle.DataAccess, Version=4.112.2.50, Culture=neutral, 
PublicKeyToken=89b483f429c47342" version="1" Unrestricted="true" /> 

(このReadmeにはEFのためのベータ3からですので、私はバージョン番号が異なることが期待される)

O場合にも(それが思考のこのラインに似て表示されます)このフォーラムで https://forums.oracle.com/forums/thread.jspa?threadID=575320

HTH

0

チェックを見ることができますコンパイラマシンのDACターゲットプラットフォーム(32/64ビット)は、Webサービスを配置するプロダクションサーバーと同じです。

関連する問題