I have developed a .NET 2.0 extension that acts as a plug in to a 3rd party application. Everything runs fine when run on anything but Citrix. When run over Citrix as a published application the extension crashes randomly which also crashes the 3rd party application.
I have opened up a dump file and have found an exception message that gets reported:
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
I've not had much luck with google. The application does use threading which I suspect where the above occurs, but where exactly is a mystery. If I run the extension locally on the citrix server (ie not as a published app.) then it works fine.
I'm not expecting an answer here (be great if someone did!) due to the general nature of the issue but if anyone could point me in a direction of helping to nail the issue or describing the error message I would be much appreciative.
Thanks,
Rob
The nature of the error message makes it unlikely to be a problem with the .NET 2.0 code. That is because .NET does not allow you to even attempt to read/write memory that it is not suppose to.
- Check to see if you have any
unsafe
code in your extension. Code of this nature may be able to skirt the verification checks the CLR would normally perform. - Check to see if the code your extension uses any unmanaged code (COM or P/Invoke). The error may be generated there.
- It is possible that there is a bug in the .NET CLR that causes problems when run in Citrix environment.
The first thing I would do is analyze that dump file to see which module the fault occurred in. You can download the Windows Debugging Tools to assist with this effort.
I don't know if this will help.
I got the identical message when opening a project using Schneider Unity Pro. After a tedius and lengthy process of elimination, the problem was isolated to the “Do not keep history of recently opened documents” policy being enabled.
来源:https://stackoverflow.com/questions/3352518/the-thread-tried-to-read-from-or-write-to-a-virtual-address-for-which-it-does-no