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
1
vote
1 answer

Check for full trust

How do I check if my code is running in full trust mode? I have seen several suggestions to check for specific permissions using SecurityManager.IsGranted() method, but I specifically want to check for full trust because no specific permission in…
Tomasz Grobelny
  • 2,666
  • 3
  • 33
  • 43
1
vote
2 answers

Entity Framework in Partial trust environment

I know that Entity Framework supports Partial trust, I personally blogged about that It was working fine, I tested it and it was fine. Now if you download the samples attached to my post about the subject, it doesn't run under default partial trust…
Muhammad Soliman
  • 1,176
  • 1
  • 7
  • 12
1
vote
1 answer

Delphi 5 Unknown Publisher Version Info

I build a number of executable applications in Delphi 5 which talk to databases over a network. On my Windows 7 PC and other PCs they run without any warning but on some client PCs it gives an 'unknown publisher' warning which doesn't look…
notidaho
  • 588
  • 8
  • 28
1
vote
3 answers

Calling Marshal.GetHRForException in a partial trust environment (SecurityPermission)

I have some IO code that reads a stream within a try..catch. It catches IOException and calls System.Runtime.InteropServices.Marshal.GetHRForException() within the catch, in an attempt to take different actions based on the HResult. Something like…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
0
votes
1 answer

XBAP - Can I grant full trust only for specific methods?

I'm considering using XBAP for an intranet application and I'd like to avoid setting the entire application to Full Trust. Essentially, I have a few method calls that I'll need to make that will require Full Trust (e.g. DriveInfo.GetDrives), but I…
0
votes
1 answer

NGen for partial trust application

I have a .Net 4.0 application that I need to improve the performance of code running in a partial trust environment. Specifically, I would like to eliminate the need to JIT at runtime. Normally this is accomplished using NGEN…
Matt Ruwe
  • 3,386
  • 6
  • 39
  • 77
0
votes
1 answer

Can I use SQL Server CE in a medium trust environment by just deploying the DLLs

I've written an ASP.NET 4.0 application that is using a SQL Server CE 4.0 database. This is all working on my development environment using Medium Trust (same trust config as the hoster). On this machine, I've gone through the install process…
0
votes
2 answers

Collections in DataContracts in partial trust scenarios

I've been pretty confused on one point in design of DataContracts for serialization. Say I have an object (e.g. a Customer) and it exposes a collection property (e.g. an AddressCollection named Addresses). Framework design guidelines dictate that I…
dks1983
  • 165
  • 2
  • 8
0
votes
1 answer

partial trust application woes

I am using Visual Studio 2015 WPF application, C#. I have an program I just sent to my Beta testers. The one using Windows 10 had big heartburn over my using "full trust". He needed to change registry values to allow it to install, then he…
Howard
  • 19
  • 1
  • 6
0
votes
1 answer

Why does ILMerge delete security-related attributes?

At some time, ILMerge was changed so that it now deletes security-related attributes. Questions: Why is this functionality implemented? And/or can it (safely) be removed from a private build of the tool (used to create a published assembly)? The…
ChrisW
  • 54,973
  • 13
  • 116
  • 224
0
votes
0 answers

The IXmlSerializable type 'System.Xml.Linq.XElement' cannot be deserialized in partial trust

I am facing an issue while calling wcf service. Error : The IXmlSerializable type 'System.Xml.Linq.XElement' cannot be deserialized in partial trust because it does not have a public parameterless constructor. My website (asp.net) and wcf service…
Vijay Sutaria
  • 132
  • 1
  • 11
0
votes
1 answer

does elevated trust in silverlight4 also gives elevation in MAC OS

Silverlight4 provides an option to run at elevated trust http://www.silverlightshow.net/items/Silverlight-4-elevated-permissions.aspx Does anyone know if it also provides certain degree of elevation on MAC OS X?
JewelThief
  • 611
  • 2
  • 10
  • 25
0
votes
1 answer

Running a .net exe from a network share runs in partial trust when the access to root-shared is not granted to user

I have a situation where there is common shared network path let's say "\10.x.x.x\CommonShare". Only administrator has got permission on this path. Now inside the commonshare we create user-specific folders where that particular user will have full…
0
votes
1 answer

Allow users to run partial trust XBAP or BROSER WPF without touching internet explorer properties

I have just developed a xbap app which is hosted in an IIS server. Working fine in server and in the developers machines but when users access to it, the message "this application type has been disabled" appears. They only have to enable "XAML" for…
0
votes
0 answers

Reload root web.config without restaring IIS

My app is being moved from a server running IIS6 to a server running IIS7.5. The new server defaults to Medium Trust. As this is a shared server and I am consuming some third-party assemblies, I don't want to ask to run my app under Full Trust. I…
Emyr
  • 2,351
  • 18
  • 38