.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Full Trust in .Net 4 Component Hosted in IE

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :.NET Framework

We develop a .Net component that, when hosted in Internet Explorer, requires Full Trust on the client's computer because we use P/Invoke to invoke unmanaged functions.  In earlier versions of .Net (2.0 and 3.5) we required the user to modify their .Net framework security settings to allow our assembly to be loaded and executed. 

To do this, we provided instructions on how to modify the security settings in one of three ways:

  • using the .Net Framework Configuration Tool
  • using caspol.exe utility with this line of code:


          caspole.exe -polchgprompt off -addgroup 1 -site localhost FullTrust

          (where localhost is their actual site name)

  • Using an MSI to configure a site policy
Now, with .Net 4, some of our users (who themselves are developers) want to use our component in .Net 4 targeted applications (on computers that do not have older versions of the framework) but they are reporting that they cannot modify the security settings as they did before.  Obviously this is because of changes to CAS with the release of .Net 4. 

With the new security model, how do we get a .Net 4 assembly to run in Full Trust when it's hosted in Internet Expl

View Complete Post

More Related Resource Links

InfoPath forms and full trust


I am throughly confused on what I need to do.  I created a form that has custom VSTA code to get the currently logged on users name.  On my development machine if I set the form to full trust and add my developer certificate to it, it does not work I get the generic error of form could not be opened.  I've tried clearing the cache and everything else. 

I'm confused as t owhat type of certificate that I need to assign to this form.  If I get a certificate do I install it on my dev box and also on my prod box?  Can someone suggest a good reference site or book that expalains the difference between a digital signature and a certificate and which one do I need for a form that is web browser based that has some code?




Full Trust WPF XBAP Cannot Write To EventLog


Currently I am intentionally making my XBAP throw an error...  I have some exception code in place to display the error dialog and log the details/InnerExcetion to Event Viewer.  On my XP VS2010 developers box this works fine under both Debug and Release.  So I publish the application to the Win 2008 R2 web server.  I launch the application from there on my same box and it still logs the error just fine, no issue.  BUT... if I have any other coworker launch the application from their XP machine, IE just completely locks up, no errors, nothing...

I have pinpointed it to being the EventLog writing that is causing the issue... if i comment out the event log writing, IE doesn't hang.  Here is the exception handling code:

      if (LogException != null)
        Exception exception = LogException;
        while (exception != null)
          EventLog.WriteEntry(Application.Current.MainWindow.Title, exception.Message, EventLogEntryType.Error);
          exception = exception.InnerException;
I was thinking a "full trust" xbap should be able to write to event viewer, and it does o

Farm is unavailable - trust="full" - Forms Authentication



I have a SparePoint 2010 Foundation site which uses forms(claims) authentication. I need to set the trust level to full because of some custom web services I am running in a virtual application. This is done by using:

<trust level="Full" originUrl="" />

In my web.config.

When I do this I get "The farm is unavailable" for my web services (the SharePoint site appears to be operating normally). The exception is at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local() which is why I am inclined to think this is a problem with the forms authentication.

Any thoughts on how to get around this?

Andrew Wiles - www.it-workplace.com - MDX made simple

PDA Keyboard v1.0 Light Edition - Full Screen Keyboard

The default keypad on Windows Mobile is not at all finger friendly, there is no way you can use it with your fingers. I have trouble using the stylus with it too. But there are many freeware option available to make the SIP ( Software Input Panel - check the Glossary ) finger friendly. Some of these are HTC Diamond keyboard, Blimkeys, PocketCM Keyboard and then now we have PDA Keyboard v1.0 Light Edition from pdamedia.biz. When you hit the blue button it goes into fullscreen mode , then you can use both your hands for typing.

Is this load full or matching one only... coz of need to know performance



This my Two Table i have one doubt...

For my first table i have select Top 2 from Employee_info 

and second table itz just selct * from MDEp..

What my doubt is on loading the above report?

Is this load all the record from MDep or just matching one based on Employee_info..?

Error Registering COM+ Component

Hi All,

I am experimenting with using EnterpriseServices. I created a component, created the SNK file, compiled the DLL. In the assemblyinfo.vb file, I added '<Assembly: AssemblyKeyFile("c:\key.snk")> '.
I created a new package in COM+, When I attempt to add the .dll to the package i get:

An error occured while processeing the last operation.
Error Code 80020009 - Exception ocurred.

The eventlog may contain additional troubleshooting information.

Here is the Event log:

Installation of 'TransactionalComponentsCore.dll' into '{6367F5F1-56A7-4223-97AC-51F7DC1D53EB}' failed with an exception:

System.EnterpriseServices.RegistrationException: Could not install type library 'TransactionalComponentsCore.tlb' into application 'TransactionalComponentsCore'.

Server stack trace:
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary_W2K(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallAssembly(RegistrationConfig regConfig, Object obSync)
at System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
at Sys

SAAS: Connect Enterprise Apps with Hosted BizTalk Services


In this article we introduce you to BizTalk Services, new technology that offers the Enterprise Service Bus features of BizTalk Server as a hosted service.

Jon Flanders and Aaron Skonnard

MSDN Magazine June 2008

{ End Bracket }: Election Results Even Voters Can Trust


Surprisingly, cryptography can be applied to the electoral process to allow every individual voter to check the integrity of an election tally. Find out how here.

Josh Benaloh

MSDN Magazine June 2008

Windows with C++: Windows Imaging Component Basics


Windows Imaging Component (WIC) is an extensible framework for encoding, decoding, and manipulating images. See how to use WIC to encode and decode different image formats.

Kenny Kerr

MSDN Magazine April 2008

Toolbox: Code Generation, A Charting Component, and More


Developers have a number of tools at their disposal, but which of these components do you really need to complete your project? Each month we'll analyze the latest software and books to see if they merit inclusion in your toolbox.

Scott Mitchell

MSDN Magazine January 2006

Do You Trust It?: Discover Techniques for Safely Hosting Untrusted Add-Ins with the .NET Framework 2


When you allow your application to run arbitrary code through an add-in, you may expose users to unknown code, running the risk that malicious code will use your application as an entry point into the user's data. There are several techniques you can use to reduce the attack surface of your application, which Shawn Farkas discusses here.

Shawn Farkas

MSDN Magazine November 2005

Cryptography: Employ Strong Encryption in Your Apps with Our CryptoUtility Component


When storing sensitive data, you need to be able to identify threats, determine how these threats interact with each other, and how issues can combine to constitute a vulnerability that will leave your data exposed. With a good understanding of the various cryptographic algorithms, salt, hashes, ACLs, and other available techniques, you'll be in a better position to protect your critical data.

Michael Stuart and J Sawyer

MSDN Magazine November 2004

Set hosted server time according to country.



I have hosted my website , but my vendor's server is lying in canada.But i have used all system.Datetime.Now() for date operations, whereas my clients are from india and it shows me 12 hours difference. How can i map this time zone? I don't want to store the client's machine time but only server end time.

waiting for your prompt reply.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend