Security Features and the Visual Basic .NET Developer


If you’re developing applications or components that are intended to be run from environments such as a local network environment (intranet) or the Internet, you might find that your application doesn’t run as expected in those environments. For example, certain Visual Basic .NET statements might lead to security exceptions that immediately halt execution of your application. This chapter shows how you can work with the .NET code-access security system to create an application that is both safe and functional.

Note

If you’re creating a system component on the order of the .NET system libraries—such as the Microsoft.VisualBasic, System.Web, and System.Windows.Forms components, which are globally registered on the system—you’ll need to apply more advanced code- access security techniques to make your global system component both accessible and safe to all untrusted callers. These techniques— such as applying the AllowPartiallyTrustedCallers attribute, supplying custom evidence, and knowing when to properly use Demand, LinkDemand, and Assert—are beyond the scope of this chapter, not to mention the scope of this book. If you head down the path of applying the AllowPartiallyTrustedCallers attribute, for example, you are effectively telling the code-access security system you will be responsible for protecting all code within your application. Before you decide to take on this added responsibility, you might want to reconsider whether you need a system component in the first place. In most cases, it’s simpler to create a non-system component—the type of class library components Visual Basic .NET creates by default—and distribute the component with each application, which the Visual Basic .NET Deployment Wizard will handle for you automatically. This chapter focuses on ways you can work within the context of the code- access security system provided by Visual Basic .NET to make your ordinary, non-system components and applications perform their intended actions safely.




Security for Microsoft Visual Basic  .NET
Security for Microsoft Visual Basic .NET
ISBN: 735619190
EAN: N/A
Year: 2003
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net