简体   繁体   English

发布WCF服务时出现问题-oracle.dataAccess错误

[英]Issues publishing wcf service - oracle.dataAccess error

I have an application that has a UI layer, wcf layer that interacts with the database layer. 我有一个具有UI层,与数据库层交互的wcf层的应用程序。 They are all in the same solution but seperate projects within the solution. 它们都在同一个解决方案中,但是解决方案中的单独项目。 Each is setup to target x86. 每个都针对x86进行设置。

My issue is i continually get the error: 我的问题是我不断收到错误:

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. 无法加载文件或程序集“ Oracle.DataAccess”或其依赖项之一。 An attempt was made to load a program with an incorrect format. 试图加载格式错误的程序。

There are 2 ways I can make this go away. 我有2种方法可以消除这种情况。

  1. Create a new wcf project, copy in my code and create a reference in the UI layer. 创建一个新的wcf项目,复制我的代码,然后在UI层中创建引用。 It then begins to work. 然后开始工作。

  2. Skip referencing the wcf layer and reference the database layter instead. 跳过引用wcf层,而是引用数据库层。 This is not the way the users want it to work however. 但是,这不是用户希望它工作的方式。

Number 1 will work as long as I do not do the following: 只要我不执行以下操作,号码1就会起作用:

  1. Attempt to publish (Publish to my local machine so the same place development is happening). 尝试进行发布(将其发布到我的本地计算机上,以便在同一地点进行开发)。 When I try and publish the app and the wcf this causes the reference or the service it self i am not sure to completely break. 当我尝试发布应用程序和wcf时,这会导致引用或服务本身无法确定我是否会完全中断。 if i blow the service away and try and create another service reference to it i get this error. 如果我不满意该服务,并尝试为其创建另一个服务引用,则会收到此错误。 The only way I have found to make it go away is to create another project and copy the code as i mention. 我发现要使它消失的唯一方法是创建另一个项目并复制代码(如上所述)。

I think i have everything installed correctly as like i mention, it all seems to work without issue until i publish (only local as i mention at this point.). 我认为我已经像我提到的那样正确安装了所有东西,直到我发布为止,这一切似乎都没有问题(这时我只提到了本地)。 I am a little concerned that when I publish to the server that I am going to have issues like this so only attempting this locally currently. 我有点担心,当我发布到服务器时,我会遇到这样的问题,因此只能在本地尝试。

I should also note that when I am publishing this to my local IIS i am setting the reference app pool to enable 32 bit applications too. 我还应该注意,当我将其发布到本地IIS时,我还将参考应用程序池设置为也启用32位应用程序。

Anyone know what I am doing wrong or how to get this to publish correctly? 有人知道我做错了什么,或者如何使它正确发布?

Thanks for the help. 谢谢您的帮助。

确保对属性中对Oracle dll的引用设置为复制本地。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM