[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Trust a managed assembily in .NET 2.0


I have made a managed assembily with .Net 1.1. And I used it in a web page.

On my local machine, I have both .Net framework 1.1 and .Net framework 2.0 installed. And whenever I invoke that assembily, I got a FileIOPermission error in mscorelib.dll

I used the configuration tool in .Net Framework 1.1 to fully trust the assembily, it didn't work.
Then I uninstalled the .Net Framework 2.0, it works.

My questions is:
How to make sure my assembiliy only use .Net framework 1.1 on the client machine?
Or, an answer to the question: How to extend the trust to an assembily in .Net framework 2.0 without installing the SDK is also acceptable.

1 Solution
Actually, the application is supposed to use the Framework it was built on , and
without special configuration (of course if this Framework is installed).

below is a link from msdn how to use configuration file to enforce Framework 1.1 is used,but
in short: create config file named name_of_your_application.exe.config (e.g. if your app is
App.exe -> App.exe.config) that contains:
<?xml version ="1.0"?>
    <supportedRuntime version="v1.1.4322" />

and place it in the directory where the application resides

link: http://msdn2.microsoft.com/en-us/library/9w519wzk.aspx

Or you can use Assembly redirect, as shown here:

Regarding trust settings, well , when both Frameworks are installed, there're 2 MMC entries in
Start -> Administrative Tools , those are ".Net Framework 1.1 Configuration " and
".Net Framework 2.0 Configuration " where you can manage settings for assemblies.

Featured Post

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now