FileNotFoundException when porting from Dev 2003 to Dev 2005

G

Guest

Hello,

I developed an application using Remoting in Dev 2003 using the security
sample code from Microsoft samples to add SSPI functionality and secure my
messages.

When the .NET framework 2.0 was released I have learned that now securing
Remoting application is built in and has no memory leeks, therefore I port my
application to dev 2005.

My application is client C# WinForm application which use remote object
hosted on windows service on the remote machine. The remote object use
unmanaged DLLs which expose "C" calling conventions.

Since I port it when ever I run the application and get to this line:
Application.Run(new Form1());

I always recieve FileNotFoundException. I heard that the C runtime for .NET
2.0 is defferent from v1.1.

How can I solve this problem ??

Thanks,

Barak
 
B

Beppe

Hi Barak,
I have the same exact your error.
.... it seems that we are alone in the world
Beppe
 
G

Guest

Hello,

No we are not... I have the answer - The fileNotFoundexception regards your
assembly:
So you have signed before the manifest was embedded. This invalidated the
previous signature, making your assembly invalid.
If you instead use the Project -> Properties -> Configuration Properties ->
Linker ->Advanced ->Key File to enter the key file information your project
should build. And hopefully it can be loaded successfully later on.
The linker switch is new, and is what you can use to get the signing to
happen after manifest embedding.
Alternatively you could use a postbuild action "sn -R" to sign your assembly.

Hope this helped you.

Barak
 
B

Beppe

Hi Barak,

after solved fileNotFoundexception I'm encoutering a lot of problems in
porting into .NET 2.0 the Microsoft samples code to add SSPI
functionalities.
What is your experience? I do not find anything on the net.

For example now I'm stopped on an
exception "SecuritySinkMessageHeaderException" on

string securitySinkMessageHeader =
(string)headers[SecuritySinkMessageHeaderName];

What I'm missing?

My code is:
public static MessageEnvelope GetMessageFromHeader(ITransportHeaders
headers)
{
string securitySinkMessageHeader =
(string)headers[SecuritySinkMessageHeaderName];

if (securitySinkMessageHeader == null)
throw new SecuritySinkMessageHeaderException();
MessageEnvelope messageEnvelope =
MessageEnvelope.StringToMessageEnvelope(securitySinkMessageHeader);
headers[SecuritySinkMessageHeaderName] = null;

return messageEnvelope;
}

Any idea?
Thanks a lot, Beppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top