I have a small console app that started out in dotnet 1.1 in VS 2003. That
version can be copied to a W2K3 server where it runs fine.
I set up a new project in VS 2005 and copied the code files from 2003 to
2005 where they compile and run, no problem. When I copy the two files (exe
& dll) to the same W2K3 server they fail with the Strong Name Verification
Failed error. After running the console contains: "Unhandled Exception:
System.BadImageFormatException: The format of the file ''x.exe is invalid.
I tried signing the project even though MS recommends against it for simple
code like this, but it gives the same result. I tried a different W2K3
server with the same result.
I ran "sn -v x.exe" on both my XP workstation and on the failing server. In
both cases the response is: Assembly ''x.exe'' is valid. The same with the
dll, which is in the directory with the dll.
Kal
..
解决方案Update,
On one of the W2K3 servers I have VS 2005, so I set up a copy of the project
on that machine. In debug mode under VS the project runs. The exact same
files copied to an execution directory give the same strong name
verification error.
Clearly I am missing something basic here. Anyone know where to point me in
the right direction.
Kal
"Kal"
news:u6**************@TK2MSFTNGP02.phx.gbl...
>I have a small console app that started out in dotnet 1.1 in VS 2003. That
version can be copied to a W2K3 server where it runs fine.
I set up a new project in VS 2005 and copied the code files from 2003 to
2005 where they compile and run, no problem. When I copy the two files
(exe
& dll) to the same W2K3 server they fail with the Strong Name Verification
Failed error. After running the console contains: "Unhandled Exception:
System.BadImageFormatException: The format of the file ''x.exe is invalid.
I tried signing the project even though MS recommends against it for
simple
code like this, but it gives the same result. I tried a different W2K3
server with the same result.
I ran "sn -v x.exe" on both my XP workstation and on the failing server.
In
both cases the response is: Assembly ''x.exe'' is valid. The same with the
dll, which is in the directory with the dll.
Kal
.
Hi Kal,
I was unable to reproduce the issue you described. Here''s my steps to test:
1) Create a simple console project in Visual Studio 2003 using C#, create a
key using "sn -k mykey.snk" and sign the project using this key.
2) Create another console project in Visual Studio 2005, copy the source
file and the key, sign this project using the key.
3) Copy the built assembly to another system which has .NET 2.0 Framework
installed, run it and it works correctly.
Since you''ve mentioned that the issue exists on another system, I think it
should be reproducible using your code. Would you please create a simple
repro project and post it here or send it to me via email? Thank you for
your effort.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Is it possible you are using delay signing and have disabled checking for
this assembly? Unlikely (especially at the server), but...?