0

I've been trying to create a webService on a .NET platform using Visual Studio's WCF Service Library project template. I noticed that when I tried to use a VO object from another project file within the same solution... programatically, the compiler has no issues and runs fine... but when I call the webService, it will stop the application prematurely.

I've done some google-ing and the closest answer I could find was the possibility that since WCF is run from a separate location, the VO.dll file that I added in as a reference is not available to it.

As a reference to the above statement... please find the enclosed link: http://forums.asp.net/t/712261.aspx

Thanks

  • Is VO.dll a reference or a project in visual studio? If it is a reference, try and mark the dll to copy local. Right click the refence and click properties, set copy local to true. If it is a project make sure your wcf project has a reference to the project. –  Jan 14 '14 at 21:31
  • the VO is a project in VS. I've tried adding the VO project into my wcf project but the problem still exists. – user3195104 Jan 14 '14 at 22:50
  • Have you looked in the bin folder of where you deployed your wcf solution to check if it has vo.dll file? if not, try and copy the .dll file there to see if it solves the problem. This will confirm that is the problem. If it does not work, you probably have a different problem. –  Jan 14 '14 at 22:55
  • Something to try would also be in visual studio go to the debug tab select exceptions from the menu. In the window you get check all the checkboxes under the thrown column then run the project with debugging. This should throw an exception no matter what happens. If this works, could you post the details of the exception you get? –  Jan 14 '14 at 22:57
  • I tried copying the vo.dll file directly into the same directory as the wcfservicehost.exe is... is that what you are referring to? If so, that didn't fix the problem either – user3195104 Jan 14 '14 at 22:58
  • Your comment about the debug tab was like magic to me! Finally I get some kind've exception error message... for the longest time I was shooting in the dark. Should I post the exception message in this post to continue solving it? or should I start a new one?\ – user3195104 Jan 14 '14 at 23:01
  • Post the exception message on this one since they are related. Its a trick i use all the time in case people just wrap everything in a try catch. –  Jan 14 '14 at 23:03
  • The assembly with display name 'StoreServer.VO' failed to load in the 'Load' binding context of the AppDomain with ID 2. The cause of the failure was: System.BadImageFormatException: Could not load file or assembly 'StoreServer.VO, Version=1.0.5123.26036, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. – user3195104 Jan 14 '14 at 23:05
  • Check to make sure both projects are being built for the correct system architecture: http://stackoverflow.com/questions/1648213/could-not-load-file-or-assembly-xxx-or-one-of-its-dependencies-an-attempt-was try the link. –  Jan 14 '14 at 23:07
  • I just checked the configuration manager and made sure all projects are building to x86 but now I am getting an error message when trying to boot up WCF: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Single Store\StoreServer\StoreServer.App.WebService\bin\x86\Debug\StoreServer.App.WebService.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'file:///C:\Single – user3195104 Jan 14 '14 at 23:13
  • Just for a quick test can you try and make them all build for any cpu and see what happens? –  Jan 14 '14 at 23:14
  • Same error still occurs – user3195104 Jan 14 '14 at 23:17
  • Is it possible that you have specific version marked to true and the version that wcf is looking for is wrong? –  Jan 14 '14 at 23:29
  • I'm not sure what you mean... Not sure if this is important too but the exception is being thrown by WCF itself... so a critical error message is shown from WCF – user3195104 Jan 14 '14 at 23:32
  • I honestly dont know at this point without actually looking at the full setup. Try to do a clean and rebuild on the entire solution. Try and delete your .suo files to clear cache completely and try a rebuild again. Try closing and reopening VS. Sorry i couldn't solve your problem. –  Jan 14 '14 at 23:33
  • I attempted what you mentioned. Not to worries bro.. you've done a lot for me already and I appreciate it! – user3195104 Jan 14 '14 at 23:36

0 Answers0