473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Strong Name Verification Failed

Kal
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
..
Sep 2 '06 #1
13 5449
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" <ka*@newsgroup.nospamwrote in message
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
.


Sep 3 '06 #2
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.

Sep 4 '06 #3
Is it possible you are using delay signing and have disabled checking for
this assembly? Unlikely (especially at the server), but...?
Sep 4 '06 #4
Kal
When strong signing did not produce a better result, I disabled signing. No
options are checked. It is not needed on this project, so delay signing
seems pretty unlikely.

"Marc Gravell" <ma**********@gmail.comwrote in message
news:OM**************@TK2MSFTNGP03.phx.gbl...
Is it possible you are using delay signing and have disabled checking for
this assembly? Unlikely (especially at the server), but...?

Sep 7 '06 #5
Kal
Walter, thanks for your help.
The second machine has a copy of VS 2005 installed so I copied the project
there and it ran fine from within the IDE. Then I copied the two functioning
files to an execution directory where the gave the error.

I fooled with it quite a bit, including setting up an installation project,
which installed and worked on the development server. For one reason or
another I deleted that development project, recompiled, and copied the files
to the execution directory on the same machine. From that point things seem
to work there.

This morning I copied a set of files from development server to production
server where the problem originated, and they still do not work there. It is
clearly something on that server that is causing the problem.

All of these files are without strong name signing, although for a brief
period I tried it with signing.

On the production server the only thing that uses (would use) dotnet 2.0 is
this application. I believe the server has not been rebooted since the
install just prior to this series of tests; neither did it prompt to
restart. I will wait to reboot until it is essential as it is a production
machine.

I did do an extremely test project on the production server, again without
signing, and it ran fine.

Kal
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:9P*************@TK2MSFTNGXA01.phx.gbl...
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.

Sep 7 '06 #6
Hi Kal,

Thank you for your update.

To be honest, I'm not quite clear about the current status of this issue. I
must be taking too little sleep recently, :)

From your description, it seems to me that this is an environment specific
issue which only exists on your production server, right? If this is the
case, then reboot or even reinstall the .NET Framework would be a much
simpler way to try first, given that we've done some troubleshooting and it
doesn't work.

How long do you need to update here the progress? Normally we need to
update in at most two business days, so if you need more time to follow up,
please let me know. Thank you.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 8 '06 #7
Kal
Walter,
Too little sleep, is it? Maybe that is why it is confusing me too.

We will reboot in the next day or two. Reinstalling seems like a real
stretch since I installed .Net 2.0 about 5 minutes before this started to
happen.

What I am really looking for is ideas as to what kinds of thing could cause
this type of problem. But lets wait until after I can reboot and see if that
makes things work.
Kal

"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:KU*************@TK2MSFTNGXA01.phx.gbl...
Hi Kal,

Thank you for your update.

To be honest, I'm not quite clear about the current status of this issue.
I
must be taking too little sleep recently, :)

From your description, it seems to me that this is an environment specific
issue which only exists on your production server, right? If this is the
case, then reboot or even reinstall the .NET Framework would be a much
simpler way to try first, given that we've done some troubleshooting and
it
doesn't work.

How long do you need to update here the progress? Normally we need to
update in at most two business days, so if you need more time to follow
up,
please let me know. Thank you.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 12 '06 #8
Thanks Kal for your update.

I'll do a summary here to get a clearer picture of this issue:

1) For your production server, even without signing, an assembly built with
VS2005 will failed to pass verification.
2) The VS2005 project contains some files copied from VS2003 project; if
you build a new simple VS2005 project, it works fine.

If I'm missing something here, please feel free to tell me.

If it's not about signing, then the verification is occurred when JIT
compiler compiling MSIL to native code.

======
#Compiling MSIL to Native Code
http://msdn2.microsoft.com/en-us/library/ht8ecch6.aspx
As part of compiling MSIL to native code, code must pass a verification
process unless an administrator has established a security policy that
allows code to bypass verification. Verification examines MSIL and metadata
to find out whether the code is tyep safe, which means that it only
accesses the memory locations it is authorized to access.
======

You can verify your code by using PEVerify:

======
#PEVerify Tool (Peverify.exe)
http://msdn2.microsoft.com/en-us/library/62bwd2yd.aspx
The PEVerify tool helps determine whether MSIL code and associated metadata
meet type safetype requiretments.
======

Please tell me the result of PEVerify.exe. Also, is it possible to create a
small reproducible project and send it to me so that I can test it? Thank
you.

By the way, if this issue is urgent and critical for your business, due to
the nature of such problem, I suggest you contact PSS for further
assistance which will provide some thorough throubleshooting like dump
analyze or live debugging.

For PSS support or a local on site, you can also try contacting the global
support center through the following link:

http://support.microsoft.com/gp/assistsupport

They will provide you the detailed info on how to contact the local
developer support center.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 13 '06 #9
Kal
Walter,
Thanks for your help. This item is not critical because the VS2003 code
still works. I do plan to make some changes that will possibly be 2.0
specific, so want to get this working, but it is not a top priority.

Since last I wrote I have restarted the server with no improvement, and also
reinstalled dotnet 2.0.

On the compile machine:
Microsoft (R) .NET Framework PE Verifier. Version 2.0.50727.42
All Classes and Methods in rssDailyGen.exe Verified.
And on the problem server:
D:\Program Files\ECBridge\RSSCreate\RssDailyGen>peverify RssDailyGen.exe /md
/il /clock

Microsoft (R) .NET Framework PE Verifier. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

All Classes and Methods in RssDailyGen.exe Verified.
Timing: Total run 218 msec
MD Val.cycle 31 msec
MD Val.pure 16 msec
IL Ver.cycle 187 msec
IL Ver.pure 171 msec

So that does not seem to be the problem.

I am beginning to think it may not be the VS2003 code because there is
nothing very complex nor sophisticated there. I extract some records from a
SQL 2000 database, and for each record do some verification and edititng and
then write an RSS 2.0 XML file with each record becoming a node via
XmlTextWriter. The connection string is in the config file and various other
parameters are in a second xml file that gets called from the command line.
These configuration files are specific to the installation rather than to
the exe, so they are not changed when I copy in a new version exe and dll.

Kal
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:Ed**************@TK2MSFTNGXA01.phx.gbl...
Thanks Kal for your update.

I'll do a summary here to get a clearer picture of this issue:

1) For your production server, even without signing, an assembly built
with
VS2005 will failed to pass verification.
2) The VS2005 project contains some files copied from VS2003 project; if
you build a new simple VS2005 project, it works fine.

If I'm missing something here, please feel free to tell me.

If it's not about signing, then the verification is occurred when JIT
compiler compiling MSIL to native code.

======
#Compiling MSIL to Native Code
http://msdn2.microsoft.com/en-us/library/ht8ecch6.aspx
As part of compiling MSIL to native code, code must pass a verification
process unless an administrator has established a security policy that
allows code to bypass verification. Verification examines MSIL and
metadata
to find out whether the code is tyep safe, which means that it only
accesses the memory locations it is authorized to access.
======

You can verify your code by using PEVerify:

======
#PEVerify Tool (Peverify.exe)
http://msdn2.microsoft.com/en-us/library/62bwd2yd.aspx
The PEVerify tool helps determine whether MSIL code and associated
metadata
meet type safetype requiretments.
======

Please tell me the result of PEVerify.exe. Also, is it possible to create
a
small reproducible project and send it to me so that I can test it? Thank
you.

By the way, if this issue is urgent and critical for your business, due to
the nature of such problem, I suggest you contact PSS for further
assistance which will provide some thorough throubleshooting like dump
analyze or live debugging.

For PSS support or a local on site, you can also try contacting the global
support center through the following link:

http://support.microsoft.com/gp/assistsupport

They will provide you the detailed info on how to contact the local
developer support center.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 16 '06 #10
Hi Kal,

Thanks for the update. I'm sorry I cannot provide more support here in
Newsgroup Support. However, if you're interested, you may try to use WinDbg
to debug the application on your production server.

1. Download Debugging Tools For Windows from
http://www.microsoft.com/whdc/devtoo...g/default.mspx, install it
on your production server
2. Compile your application with debug information; copy the .exe and .pdb
file to your production server
3. Start WinDbg, select menu "File/Open Executable..." and load your .exe
4. At the prompt of WinDbg, type ".load
C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\ \SOS.dll" to load an
extension which enables you to debug .NET application in WinDbg efficiently
5. Type "g" in WinDbg to continue your application, when it failed, type
command "!clrstack" to view the stack.

#WinDbg / SOS Cheat Sheet
http://geekswithblogs.net/.netonmymi.../14/72262.aspx

#Production Debugging for .NET Framework Applications
http://msdn.microsoft.com/library/de...us/dnbda/html/
DBGrm.asp

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 18 '06 #11
Kal
Walter,
I did those steps, but have not yet installed the symbol files for
Windows/.net. WinDbg did not give a stack list due to no symbol files found.
Was it looking for my pdb files or the downloaded symbol files? My pdb files
are in the executable directory.

I did see a couple of first level and one second level exceptions.

What will I be looking for in that stack list that might be the key?
Kal
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:Gg*************@TK2MSFTNGXA01.phx.gbl...
Hi Kal,

Thanks for the update. I'm sorry I cannot provide more support here in
Newsgroup Support. However, if you're interested, you may try to use
WinDbg
to debug the application on your production server.

1. Download Debugging Tools For Windows from
http://www.microsoft.com/whdc/devtoo...g/default.mspx, install it
on your production server
2. Compile your application with debug information; copy the .exe and .pdb
file to your production server
3. Start WinDbg, select menu "File/Open Executable..." and load your .exe
4. At the prompt of WinDbg, type ".load
C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\ \SOS.dll" to load an
extension which enables you to debug .NET application in WinDbg
efficiently
5. Type "g" in WinDbg to continue your application, when it failed, type
command "!clrstack" to view the stack.

#WinDbg / SOS Cheat Sheet
http://geekswithblogs.net/.netonmymi.../14/72262.aspx

#Production Debugging for .NET Framework Applications
http://msdn.microsoft.com/library/de...us/dnbda/html/
DBGrm.asp

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 20 '06 #12
Hi Kal,

Your pdb file should be ok if it's in the same directory as your executable.

You need to setup WinDbg to use Microsoft Symbol Server as described at
http://www.microsoft.com/whdc/devtoo...ebugstart.mspx

As a second thought, in this case, since it's not your .NET application
throws exception, we actually don't need to use the SOS extension for
WinDbg as I described.

After you setup the symbol, load your application:
1) Type 'g' to run the application
2) When it is stopped since exception is thrown, type 'k' to get the stack
trace.

After you get the stack trace, you may post it here or send it to me.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 20 '06 #13
Kal
Walter,
Thanks for your help. WinDbg provided the clue, which once noted made the
solution obvious.

The exe.config file had an artifact, namely:
<startup>
<supportedRuntime version="v1.1.4322" />
</startup>

When replaced by the correct information it runs just fine.
Kal
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:A4**************@TK2MSFTNGXA01.phx.gbl...
Hi Kal,

Your pdb file should be ok if it's in the same directory as your
executable.

You need to setup WinDbg to use Microsoft Symbol Server as described at
http://www.microsoft.com/whdc/devtoo...ebugstart.mspx

As a second thought, in this case, since it's not your .NET application
throws exception, we actually don't need to use the SOS extension for
WinDbg as I described.

After you setup the symbol, load your application:
1) Type 'g' to run the application
2) When it is stopped since exception is thrown, type 'k' to get the stack
trace.

After you get the stack trace, you may post it here or send it to me.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 20 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Abhishek Shrivastava | last post by:
Hi, I have Windows 2000 Server with all updates, installed VisualStudio.NET 2003 Enterprise Developer Edition. It installed OK but if I try to add New Item with Data Form Wizard for a windows...
3
by: Tony Jones | last post by:
I have a third party assembly that I need to strong name because the C# project I'm referencing it in will be strong named. Every time I compile my project I'm getting "Assembly generation failed...
1
by: Kevin | last post by:
Hi all, I have a VB.NET application distributed to all employees in our company, and only one person's PC is having problems with it. After a restart of her computer, the next time she runs my...
4
by: Reinhold Schalk | last post by:
Hello, somewhere i've read that using strong names does assure two things: 1. Assure that the content of the assembly is not modified (that's ok in my opinion) 2. Assure that the assembly is...
2
by: laimis | last post by:
Hey, So I get the idea of signing the assembly as to prevent any tempering with it (besides the added ability to install it into the GAC). I did a lit exercise myself there I signed the app,...
3
by: Richard | last post by:
Hi, We would like our application to be signed and have a strong name. However our application references a 3rd party .dll that does not have a strong name and so when we compile we get the...
0
by: wan | last post by:
Hi, Any idea of why a proper running Application in VS 2003 , could not run after converted to VS 2005 with the error "Could not load file or assembly , . Strong name validation failed".... The...
8
by: per9000 | last post by:
Dear readers, I have some problems with strong keys. What I want to do is basically this. A - create an application (f.x. strongHello.dll) with a strong key. B - import the functions of this...
1
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.