Question

Scenario: I have a C# application that uses Click-Once to install(puts an icon on the desktop that points to the application) itself on computers on the network. I have recently been integrating NHibernate into the program and everything runs smooth on my box. Its ready for internal testing and I need to put it on our network share (Same share as production, different folder).

Problem: When I place it on the network share and run it I recieve an error saying the application cannot run in partial trust.

Question: I have googled this to no end and every solution seems to talk about a Web Application experiencing this. Is there anyway I can set the application to run in full trust mode on a network share. Setting the folder/exe to full trust? Is this simply allowing "Full Control" in the security tab of my applications properties?

Here is the error I recieve when running the application alt text

Thanks for any input

Was it helpful?

Solution

You need to set the security policy on the client machine using CasPol.exe or the configuration tool in Administrative Tools.

Alternatively, you can upgrade to .net 4.0, which gets rid of all this.

EDIT: You can also try adding [assembly: AllowPartiallyTrustedCallers]to the referenced assembly.

OTHER TIPS

Putting an Icon on the desktop that points to a network share does not sound like Click-once.

But this 'problem' should be solved from Fx 3.5 SP1 onwards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top