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

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

Trust a managed assembily in .NET 2.0

Hi,

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

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.

0
ubiwebdev
Asked:
ubiwebdev
1 Solution
 
yuriskCommented:
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"?>
<configuration>
  <startup>
    <supportedRuntime version="v1.1.4322" />
  </startup>
</configuration>

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:
http://blogs.msdn.com/seshadripv/archive/2006/02/24/538610.aspx

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

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