partial-trust

How can I use the system.net section of my app.config in a partial trust environment?

I've a WCF application deployed using clickonce. It connects to my server using https, and everything works fine I use the default proxy when needed thanks to the following code: <configSections> <sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyTok...

How can I access my assembly version number in a partial trust environment (no FileIOPermission)

I'm trying to access the Version number of my assembly at runtime. The code I'm using for that requires a FileIOPermission, which I don't want to grant (I'm in the Internet Zone) this.GetType().Assembly.GetName().Version; Is there another way to access the version number which doesn't require elevation? ...

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, what are my options for getting the user's attention? ...

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 should not expose a public mutator for the property, i.e., the collection property shoul...

How to detect which assemblies require the Partially Trusted Callers Attribute?

I have downloaded a web project from CodePlex and am getting the following error in Application_Start: System.Security.SecurityException: That assembly does not allow partially trusted callers. This project references several other assemblies from other open source projects. My theory is that one of these do not have the AllowP...

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 this: try { stream.Read(...); } catch (IOException ioexc1) { uint hr = (uint) Mar...

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 anymore!!! When I dug into System.Data.Entity assembly using reflector on the position ...

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 window and crashes if run with partial trust. Anybody can shed some light on why this happens...

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 the Stack Overflow recommended way to save a pic to disk in this case? ...

Assembly demands unrestricted permissions... why?

Running permcalc on my assembly and its dependencies gives me the following for many methods: <Method Sig="instance class MembershipUser GetUser(string , bool )"> <Demand> <PermissionSet version="1" class="System.Security.PermissionSet" Unrestricted="true" /> </Demand> </Method> Most of the methods are, like the example ab...

Grant FullTrust in trusted assembly called by partial trust assembly

Hi Stackoverflowers :) imagine the following environment: an XBAP application running in partial trust mode (default behaviour; requiring Full Trust is not an option - but before you ask, if full trust is given to the XBAP, everything works as expected) is referencing a locally installed assembly, which is located in the GAC. To achieve...

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 to do differently depending on the deployment mode (such as caching downloaded images on ...

Assembly does not allow partially trusted caller

How do I change my library to allow partially trusted callers? I get the following error: Server Error in '/' Application. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator o...

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, but I can't seem to get it to work on an IIS server after it's published. I'm running o...

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? ...