Hi there, I am trying to use a web service reference in a VSTA module on a 64bit machine. Nothing fancy - just signing up to a service. This works fine in 32bit, but on the 64bit machine it won't compile, giving me the "An attempt was made to load an assembly with an incorrect format: C:\...\RevitAPI.dll." message for the revitapi.dll.
any advice would be greatly appreciated. thanks and kind regards,
Gregor
Hi Mostafa,
Yes really old question, But I guess there are a couple of questions you can clarify with us.
What version of Revit are you using? Do you have the correct .Net Framework installed for the DLL you are using?
Which version of Windows? It seems like if you use Revitapi.dll that comes from a 32-bit Revit installation and try to debug with 64 bit will cause this problem. Just like any other DLL's which don't match that criteria.
Check this post, it is not Revit related, but it is to the problem you are getting.
Cheers,
thanks for your response.
I am writting addins for revit 2014--->2016
Windows 8.1 X64
frame work 4.5
server:
Windows 8.1 x64
IIS 8.5.9600.16384
actually it is not about debugging it is about building. i tested the building without a webreference and works fine. but with refrencing a web reference it won't compile.
I have check the post you send but it is not clear how it has been resolved.
Edit:
my be the reason is on adding a web reference it generate a code compatible with .NET Framework 2.0??!!
Hi,
So I did another search and Found one interesting post http://stackoverflow.com/questions/2158106/web-reference-vs-service-reference
might help you out? I see a comment at the end where it says, that it is better to use a service reference since it's newer and will be easier to maintain overtime. maybe something to consider.
Hope it helps, Cheers,