I am developing a .net web service application that needs to work with bookmarks. I am using the bookmarks console application example as a reference. When I create a new project from folder (MIPSDK\ProtocolSamples\Bookmark), if I add add references to VideoOS.Platform and a few other DLL references, then it runs fine. However, when I create a new .net web service project, and add the same DLL references, I get an error Could not load file or assembly ‘URSserver’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
I tried setting the project to both x86 and x64 bit. The error was the same. I read a post about running CopyExportFiles.bat. I could not find instructions on what to do with this file, so I tried running that file after placing it in the bin folder of my project. That did not resolve the issue either.
The dll files needed are the ones from the CopyExportFiles.
We are speculating that you need these files in the current folder when you execute your service, we have seen issues where the current folder is no longer the expected folder, we suggest that you catch the exception, and when the exception is caught you get the current folder and logs it.
Thank you for the clarification. The files are indeed in the proper location (bin folder). When trying to get it to work, before running CopyExportFiles, with a reference to the DLL in an external folder, I had changed the output type to x64. Now after switching to target ‘any cpu,’ or ‘x86.’ the error is gone.
I had the same problem, and could not find a description of how to actually use the copy file batch scripts. I figured I would help save others from some headache.
How to use Library Initialization Scripts
Navigate your console working directory to the MIP SDK Bin directory:
"cd C:\Program Files\Milestone\MIPSDK\Bin"
From this directory run the copy batch scripts that are relevant to your project; specify you project folder after a space:
.\CopyExportFiles.bat C:\Users\user\Documents\ProjectFolder\bin\Debug
Specify Debug and/or release, depending on what you are using.