Questions tagged [partial-trust]

Partial trust is a .NET security model in which application code executes with reduced permissions as a measure of protecting the local system from malicious use.

Partial trust is part of Microsoft's Code Access Security (CAS) model introduced with .NET 2.0.

Examples of partial trust: If you run a .NET application that resides on a network share, or you download an application via a web browser, the application will run with reduced permissions. The app will not be allowed direct access to the local file system or system registry, and will not be able to make certain kinds of network connections. The intent of partial trust is to reduce the risk of potentially malicious code downloaded from network locations from damaging or stealing information on the local machine.

With the release of .NET 4.0, portions of CAS have been deprecated or are no longer implemented, including the RequestOptional and LinkDemand SecurityActions, among others. http://msdn.microsoft.com/en-us/library/system.security.permissions.securityaction.aspx

46 questions
2
votes
1 answer

How to save a picture from a partial trust XBAP app?

I have an XBAP app, which shows some pictures, and my users would like to save some of them to disk. But my XBAP app runs in the partial trust mode, so it can't initiate SaveFileDialog, not to mention it can't access the File System. What's would be…
Massimiliano
  • 16,770
  • 10
  • 69
  • 112
2
votes
1 answer

WIF 4.5 and partial-trust environments

Is WIF 4.5 supported in a partial-trust environment? I have a WCF service that uses it and when deployed to a medium-trust environment the following error is occurring: An error occurred creating the configuration section handler for…
user1804020
  • 79
  • 1
  • 3
2
votes
1 answer

Is it possible to run a stand-alone WPF application (non XBAP) in Partial Trust?

I thought if I do not use anything beyond simple graphic in a window, I would be able to run a stand-alone WPF application in Partial Trust (at least on Intranet). But unfortunately, even simplest Hello World application fails to load the main…
Sergey Aldoukhov
  • 22,316
  • 18
  • 72
  • 99
2
votes
1 answer

Is System.Web.Caching.Cache expected to work in sandbox?

I'm trying to run a piece of code in a sandbox. It failed and the problem comes from the part of the code where cache is used. Case where it works as expected: public void Demo() { // Verify that the code is running in a sandbox: the next line…
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
1
vote
1 answer

Partial/Full Trust mode verification in Asp .Net 4.0

I found the similar question on Msdn's forum but without answer (you can check it here) .Net 4.0 came with obsolete method IsUnderHighTrust = SecurityManager.IsGranted( new AspNetHostingPermission( AspNetHostingPermissionLevel.Unrestricted )…
Cheburek
  • 2,103
  • 21
  • 32
1
vote
1 answer

How can I flash the taskbar from a partial trusted .NET application?

I'd like to flash the taskbar (as described here for example), but I can't P/Invoke FlashWindowEx (or anything else, for that matter) in the security context my application is running in. Is there another way to get the taskbar to flash? If not,…
Brann
  • 31,689
  • 32
  • 113
  • 162
1
vote
0 answers

Fail to new an instance of gRPC.Core.Channel when code run in Partial Trust

Grpc.Core.Channel is used call service. When code run in Partial Trust environment, an error below would pop up. "Inheritance security rules violated by Type:'Grpc.Core.internal.SafeHandleZeroIsInvalid' Derived types must either match the security…
Ethan
  • 11
  • 1
1
vote
1 answer

Alternative ways to restricting certain functions being called?

I recently learned that AppDomain is not fully supported in .NET Core, and they have no plans so far of implementing full support. What I am trying to do is to make a program that can run a plugin, but I don't want that plugin to be able to access…
Mathias Lykkegaard Lorenzen
  • 15,031
  • 23
  • 100
  • 187
1
vote
1 answer

Partial Trust JavaScript Object Access in XBAP via HostScript: SecurityException in Callbacks

I've encountered a problem with the XBAP Script Interop feature that was added in WPF 4. It involves a combination of the following: Accessing members of a script object from .NET Running .NET code in a callback invoked from JavaScript Running in…
Ian Griffiths
  • 14,302
  • 2
  • 64
  • 88
1
vote
2 answers

ASP.NET MVC 2, Ninject and partial trust hosting

I'm reading a book about ASP.NET MVC 2, and when I read about how it uses reflection to figure out parameters or how to use Ninject in order to introduce a loosely coupled model I wonder... will this work in a partial trust environment? I remember,…
vtortola
  • 34,709
  • 29
  • 161
  • 263
1
vote
1 answer

Compiling Castle.ActiveRecord to allow partial trust?

How can I build Castle.Core, Castle.ActiveRecord and NHibernate to allow partial trust? There are plenty of resources on the web showing how this can be done, however every site I found says to use nant build…
Mike
  • 4,257
  • 3
  • 33
  • 47
1
vote
1 answer

WPF Web (xbap) using WCF Service throws System.Net.webPermission exception

I have an xbap application running with partial trust on my local machine's IIS 7.5. I published the WCF service to the same directery as the xbap. After jumping through some hoops I could get it working through Visual Studio for debugging perposes,…
isorfir
  • 771
  • 2
  • 8
  • 19
1
vote
2 answers

Cannot Apply System.Web.Extensions to PartialTrustVisibleAssemblies List

In the web.config of webforms .net 4.5 application I set the following: because this is a Microsoft work around to overcome an bug in the asp.net Report Viewer which causes large reports to take much…
gemini6609
  • 332
  • 3
  • 7
  • 21
1
vote
1 answer

Running a web client inside a WPF wrapper

We have a browser-based client that talks to our cloud-based service. The client does fairly vanilla things, such as handling user input, and displaying data from the server in HighStock (a browser-based js charting app). A potential customer wants…
PaeneInsula
  • 2,010
  • 3
  • 31
  • 57
1
vote
1 answer

Identify if ClickOnce application is running in partial-trust mode (.NET)

Is there any way of identifying (at run time) if my application is running in partial-trust mode or not? I'm considering deploying two versions of my ClickOnce application - one full trust and the other partial trust and there are some things I want…
Tom Morgan
  • 2,355
  • 18
  • 29