Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I select : This is a full trust application

I am developing app in Visual studio 2010, my app is constantly connected to the internet. Should I activate This is a full trust application in Security tab?

If yes what does it exactly means? I was reading msdn docs but I can't understand it. I need something in short lines of when to use this feature.

like image 319
user123_456 Avatar asked Jun 19 '12 13:06

user123_456


People also ask

What is a full trust application?

Full trust means that your application needs all rights that the . NET framework provides. As a developer, you declare which trust level your application needs in order to be able to run, this is known as "code access security".

How do I create a trusted app?

Step 1: Generate and upload your application to your account's App Store. Generate an apk of your project from Android Studio. Upload it to your account's app store. When you add a new app to app store it will generate a certificate of your application if your choose “trusted app” checkbox.

How do I make a program trusted in Windows 10?

Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection. Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions. Select Add an exclusion, and then select from files, folders, file types, or process.

How do you make an app a trusted app in Windows?

Open the Settings apps by clicking the Start button and choose Settings or using the keyboard shortcut Windows Key + I. Choose Privacy and then select the Other Devices tab on the left. Scroll down to the bottom of this page and you'll see the Use trusted devices header.


1 Answers

Don't worry, it doesn't influence the security of your internet connection, but it influences how the .NET framework treats your application. So - yes you can activate it without danger, but if possible you should declare in your code which level of access your application needs to refine security. To explain the details:

Full trust means that your application needs all rights that the .NET framework provides. As a developer, you declare which trust level your application needs in order to be able to run, this is known as "code access security". Code access security means that you're telling the compiler via attributes which kind of operation your code needs in order to succeed.

The .NET framework in turn estimates how much trust the application should be granted: For example, if you deploy your application to a remote computer, which is accessible via a network share outside of your intranet*), then the .NET Framework gives it less than "Full trust". This is known as an "evidence based" security model, which is implemented through so-called managed code.

Managed code means that your .NET application is compiled into MSIL (Microsoft's Intermediate Language) by the "Roslyn"-Compiler and then "just in time" (i.e. just when you execute it, unless you choose to create native code explicitly via NGEN before execution) into CPU-specific machine language by the "RyuJIT"-Compiler. This allows to establish an additional abstraction layer, which in turn enables the .NET Framework to control what your code does and to allow it or - if not - to throw an security exception.

All the code you write for the .NET framework in one of the languages C# or VB.NET is per default managed code. However, there are (very rare) situations where you want to embed unmanaged code - also known as "unsafe code" (in .NET terminology) as well. One way is to create an "unsafe" section in your code (which I only mention here for completeness - i.e. in case you might have come accross with it in source code).

As I mentioned before, you specify what the code does via attributes, but you can also change the rules that apply on your local computer to change this behaviour through the .NET security settings. Usually it is a good idea to specify as precisely as possible which rights your application needs, and to be as restrictive as possible.

If you're interested, you can find more here: Exploring the .NET Framework Security Model

*) Thank you for your hint, Damien! Indeed, earlier versions of the framework gave ressources on the network (network shares) less trust, with .NET 4 desktop and local intranet connections have full trust.

like image 63
Matt Avatar answered Oct 20 '22 17:10

Matt