I have an application that has a UI layer, wcf layer that interacts with the database layer. They are all in the same solution but seperate projects within the solution. Each is setup to target x86.
My issue is i continually get the error:
Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.
There are 2 ways I can make this go away.
Create a new wcf project, copy in my code and create a reference in the UI layer. It then begins to work.
Skip referencing the wcf layer and reference the database layter instead. 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:
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. 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.
Anyone know what I am doing wrong or how to get this to publish correctly?
Thanks for the help.
Ensure that your reference to the Oracle dll in properties is set to copy local.
Related
(First things first, I'm kind of new on this type of programming)
I'm trying to make a windows form application where i request data from a PLC so it can be stored in a access database. This application is going to be running on a different computer.
On the solution i created and besides my project I'm using an existing project that works "like" the communication between the app and the PLC, it is called LibplctagWrapper (on my main project I create a reference to this last one)
(https://www.mesta-automation.com/how-to-communicate-to-an-allen-bradley-plc-with-c-and-libplctag-ethernet-ip-library/),
and it works on my PC, but every time y copy the Bin folder to the new computer, then run the app, it opens, but a warning popup messages appears. Saying: Unable to load DLL "plctag.dll": The specified module could not be found. (Exception from HRESULT: 0x8007007E).
The LibplctagWrapper is in another directory than my Solution and Main Project so I moved it to C: so the direction will be the same on the new computer. But it doesn't work.(copy the LibplctagWrapper in C: of the new pc as well)
Moved the entire solution/main project to C: as well... the same result.
Instead of just the bin folder i copied the entire project folder... im thinking the problem goes with the fact that the LibplctagWrapper is not in the same direction? but I don't know how to place it in the same direction... I search on visual studio but I never saw the option to move it.
Unable to load DLL "plctag.dll": The specified module could not be found. (Exception from HRESULT: 0x8007007E).
This error message is quite generic, missing dependencies can cause it as well as the mentioned module not being present at all. Check the Dependency Walker ( http://www.dependencywalker.com/) to discover required C++ runtimes or something alike. Remember to take x86/x64 into consideration.
#JavierMata - I think you have probably resolved this issue, but for others encountering something similar you can use the recently released official wrappers which can be downloaded via nuget. Github link: https://github.com/libplctag/libplctag.NET
The libplctag.NativeImport package handles loading the appropriate C runtime so you don't have to.
Does anyone have any tips on how I might track down the root cause of this error:
The type name or alias FooController could not be resolved
I have an ASP.net MVC web application using Unity. My application runs fine locally. However, when I publish the site to a remote server, I get the error above.
I tried on two different remote servers and got the same error. However, when I published the site to a different directory on my local dev box, it works just fine. So, I copied the local working copy to the remote server(s). I get the same exact error. I re-arranged the order of the controllers in the Unity config file and the error will always show the first controller in the file. That is, if I move the type registration for BarController above FooController, the error will show:
The type name or alias BarController could not be resolved
So it appears that anytime a controller is encountered in the Unity configuration file, it fails, but only on the remote servers. It problem doesn't seam to be tied to a specified controller.
Therefore, it seams the problem is environmental. Perhaps the remote servers are missing something in the GAC, that I have on my local dev box. I ran though the references and didn't see anything new added since our last release, but I could be missing something.
Does anyone have any tips on how I can track down the root cause of this problem? The error message doesn't tell me much. I need to know why the FooController could not be resolved.
I solved the problem. I setup a development environment on one of the remote servers. I noticed a problem with one of the references in the web project. The MVC assembly needed to be fixed. So I removed and re-added it. Worked like a charm.
Looking at the change this made, here's what I saw:
The code on the left is my local dev box. It was referencing version 3.0.0.1 and the code on the right is after I fixed the reference on the remote server. It is referencing version 3.0.0.0.
It seams my local dev box had some strange version of ASP.net MVC installed. So I uninstalled it, and reinstalled from the latest published version and republished the code from the local dev build and it worked fine.
After look into this even further, this appears to be the root cause of the problem to begin with:
Windows update caused MVC3 and MVC4 stop working
I have a particular web application. Half the time when I run it, I get the following error:
"ErrorCode": "FileNotFoundException",
"Message": "Could not load file or assembly 'MyNotReallyMissingAssembly, Version=1.0.0.0, Culture=en-us, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I have narrowed it down a bit. If I either manually delete the Temporary Asp.Net files that correspond to this site, or changing a dll name and then change it back, or deploying a newly built dlls. Then it will work fine - until I change the web.config or run iisreset. Once that happens, I get nothing but the error mentioned above until a new build is deployed, or I clear out the Temporary Asp.Net files again.
I mention that this is a ServiceStack web service if it helps. I suspect that it doesn't matter though.
I know changing dlls, changing the web.config, recycling the app pool, and probably a few other things cause the web site to recompile, However, what I didn't know is that changing the dlls seems to do something quite different than simply changing the web.config or forcing an app pool recycle.
I looked around for this issue but couldn't find anything except this: http://support.microsoft.com/default.aspx?scid=kb;EN-US;823196. So I made a new .net 4.0 app pool and changed its identity to NetworkService and made sure the NetworkService user had full access to C:\Windows\Temp. (Note: the server is a Windows 2008 server). The problem still occurs.
Q: What am I doing wrong? What can I do to make sure that my app will continue working through application pool restart/recycle events, and web.config changes?
I am in charge of a desktop WPF application, using a few web services (via Service References of the project).
Due to a Cannot execute a program. The command being executed was \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe\" /noconfig /fullpaths #"C:\Documents and Settings\admin\Ustawienia lokalne\Temp\btucqeci.cmdline" error on a client's machine (which I understand is caused by csc trying to compile objects for the webservice request on the fly, and failing due to insufficient permissions), I hoped I could use a solution that I came across somewhere and enable the Generate serialization assembly option in the Build / Properties tab of my project.
It won't build, though - I keep on getting a compile error Could not find file 'E:\xxxx\xxxx\obj\Debug\xxxx.XmlSerializers.dll. Well I know it's not there, creating this DLL is precisely what I'm trying to achieve.
All the code for communicating with web-services is auto-generated and I haven't modified it at all.
I tried using sgen to achieve the same result "manually", but with no luck: I'm getting Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Could you point me in right direction? If additional information is needed, I will supply it. It's the first time I ran into this type of issue, so I'm a bit in the dark.
By the way, I have a (remote) access to the client's computer, but I failed to resolve the problem by resetting permissions. They run the program on an admin account and permissions do not seem to restricted in any way (based on what I googled up, including this question, I suspected the infamous IIS lockdown effect).
I'm able to run an asp.net application using a console host to host my services. This works fine.
When I install the services to a server and then attempt to access them with my application, I get an error when running my search function (it's a search application) I used to be doing it using a stored procedure that is dynamically created which was using Microsoft.SqlServer.Management.Sdk.Sfc.dll to create a sql server object and create a stored procedure. Now I'm doing it without a stored procedure and so I no longer need this reference. However, when I try to run my search function with the services installed on the server, it keeps failing because it can't find this file. I've emptied all my bin and obj directories, cleaned the services solution and the asp.net application solution, but it keeps looking for this reference.
I even searched my computer for this file and it was only found in its original location (C:\Program Files\MicrosoftSqlServer\100\SDK\Assemblies). I don't know what else to do to tell my program I no longer care about this reference.
Please help if you can! Thanks very much in advance.
The assembly may still be referenced in your web.config file.
Did you remove the reference to that DLL in your References?