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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Full Trust WPF XBAP Cannot Write To EventLog

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :WPF

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

View Complete Post

More Related Resource Links

HTTP POST in WPF/XBAP with partial trust

Hi, Is it possible to do a HTTP POST in XAML browser app with partial trust? I've tried to search for a solution, but I can't find any. I want to send a HTTP POST request to a website, within the same domain, that return a downloadable report (in a new window, _blank). I've earlier used hyperlink with GET parameters, but I have to use POST due to large amount parameter data. Is this possible? Edit: I'm using .Net Framework 3.5

Publishing xbap with partial trust, using WCF service for data backend, getting System.Net.WebPermis


It looks like these are very picky when it comes to how and where everything is setup. I've only got this to work when launching from visual studio. If I publish, I keep getting the System.Net.WebPermission exception. I am using .Net 4.0


IIS 7.5 (on my local machine)
Default Website
  --- QuoteTest (Application, ASP.net hosted website)
             ---Xbap(Was virtual directory, turned it into an application)

I'm thinking it's some magical order of settings in the publish tab that I need to do right.

  • Should I use localhost or my ip in the publishing location?
  • For the WCF service, is publishing to a File System Acceptable?
  • Any other security settings that I should set/be aware of?

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 in .Net 4 Component Hosted in IE


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

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

Write Custom WebParts for SharePoint 2007

The popularity of SharePoint Portal Server 2003 led Microsoft to tightly integrate the next SharePoint version, Microsoft Office SharePoint Server (MOSS) 2007, with its ASP.NET 2.0 WebPart framework. This tight integration enables the ASP.NET and SharePoint developer to do a number of things that previously weren't possible

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.

Serial Port Communication Read and Write using C#.net

In this simple article you will learn that how you can Open and read COM port data using System.IO.Ports Namespace.
Simply just create New Project of windows application in C#.

Import ServiceProcess APIs
using System.IO.Ports

Imports System.IO.Ports

Write Parsing functions which parse port data according to attached device

XBAP Security


We have a small XBAP file upload app that we are having trouble deploying. We were getting security errors when we were pushing this application that we don't get when running in our development environments on our machines. We gave the XBAP app full permissions and still got errors. Then we created a personal certificate and were able to get this to work. But that means we have to load a client side certificate for each and every machine that wants to run this which is ridiculous. Does anyone have a solution for this?

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

How to write SQL Datasource programatically in VB


Can someone pls help me to rewrite this programatically!


<asp:SqlDataSource ID="DS" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="SELECT * FROM [Products] WHERE ([ProductID] = @QSID)">
                    <asp:QueryStringParameter DefaultValue="" Name="QSID" QueryStringField="ID"
                        Type="Int32" />


Thank You in advance!


How to write xml file?


I am having a three text box. I want to write the fields given in text boxes to xml file and the xml file should be open as save dialog box for the user to download the xml file. I want without saving the xml file in the physical path of the server 
Any idea let me know?


I am having a three text box. I want to write the fields given in text boxes to xml file and the xml file should be open as save dialog box for the user to

How to write in .dbf file with c#


Hi all

can anybody help me to solve my problem : writing in .dbf  , as following is my code with this error :

[ ERROR [07002] [Microsoft][ODBC dBase Driver] Too few parameters. Expected 3 ]


SqlConnection cn = new SqlConnection("Data Source=(local);Initial Catalog=test;Integrated Security=True");
        SqlDataAdapter da = new SqlDataAdapter("select * from test", cn);
        DataSet ds = new DataSet();
        da.Fill(ds, "test");
        string odbccon = "Dsn=TEST.DBF;dbq=E:\\FOX;defaultdir=E:\\FOX;driverid=533;fil=dBase 5.0;maxbuffersize=2048;pagetimeout=5";

        OdbcConnection connection = new OdbcConnection(odbccon);
        OdbcCommand createCommand = connection.CreateCommand();

        createCommand.CommandText = "CREATE TABLE test (ID int, name varchar(50),last_name varchar(50))";

Willing to Write Urdu in my text box


 hi want to write urdu in text box of my application if anyone has the solution how to do this kindly let me know

Crystal Report gives System.AccessViolationException: Attempted to read or write protected memory. T


when a crystal report for same id is opened again at same time or refreshed then it gives the

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Stack Trace is :-

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetConnectionInfos(ConnectionInfos ConnectionInfos) +0
CrystalDecisions.CrystalReports.Engine.Table.ApplyLogOnInfo(TableLogOnInfo logonInfo) +362
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetTableLogon(Tables tables, String user, String password, String server, String database, Boolean ignoreCase) +258
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) +204

{ End Bracket }: Engineers Who Write


Writing is good exercise for developers and software engineers. Richard Ward explains how writing can help you focus your thoughts and communicate more precisely.

Richard Ward

MSDN Magazine November 2008

Write On!: Create Web Apps You Can Draw On with Silverlight 2


We build a Silverlight 2.0 application using the InkPresenter to let users annotate a pre-defined collection of images, perform handwriting recognition, and save the annotations and recognized text into a server-side database.

Julia Lerman

MSDN Magazine August 2008

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