Rappol

Hi there,

I've made a Console Application in C# with VS2005 and putted it on a shared folder in my network (the EXE is called from a Job in SqlServer2000).

After a little struggle to make it work due to permissions...(i used the caspol utility to add a subgroup under the 1.2. Zone - Intranet, and added a strongname to the EXE with fulltrust - i hope im not saying any weird stuff, my english is not my natual language Big Smile )

Now the ugly stuff... my EXE uses 2 DLL which are in the same shared folder, using the [DllImport("libdsh_1MD.dll")] ... and i always get this error:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

What kind of error is this How do i avoid it

Does someone know how to help me





Re: Visual C# General Error in accessing DLL: "Attempted to read or write protected memory."

Peter Ritchie

If you're PInvoking methods in one of those DLLs it's likely that you haven't defined the DllImport attributes correctly.

Can you verify this works on a local drive/folder to confirm it's not a permissions problem






Re: Visual C# General Error in accessing DLL: "Attempted to read or write protected memory."

Rappol

thanks Peter for a quick anwser,

yes, in my local drive/folder it works perfectly.






Re: Visual C# General Error in accessing DLL: "Attempted to read or write protected memory."

Peter Ritchie

Rappol wrote:

thanks Peter for a quick anwser,

yes, in my local drive/folder it works perfectly.

If it works locally and the remote location has full trust then you shouldn't have a problem. Based on the information so far, it sounds like the code does not have full trust.




Re: Visual C# General Error in accessing DLL: "Attempted to read or write protected memory."

Rappol

what code the code in the DLL whats the best option to make it 'safe'