Using Logging from Microsoft Application Block with WPF - wpf

I have a WPF application and I want to use the Microsoft Application Block for logging (MIcrosoft.Practices.EnterpriseLibrary.Logging)
How can I configure it in order to work?

It depends where and how you want to persist the log data.
Download the enterprise lib 4.1 from
http://msdn.microsoft.com/en-us/library/dd203099.aspx
There is quick start for logging. The app.config within the sample is what you are after.
You shouldn't have to make much change from it in order to make your WPF logging works.

FYI there's nothing special about using EntLib with a WPF application versus a WinForms or server application (assuming you're not launching forms for visual tracing).

MSDN has a document on this that should answer you question:
Integrating the Logging Application Block with WCF Applications
http://msdn.microsoft.com/en-us/library/ff648685.aspx

Related

Create a .dll from a Silverlight Web Application

I programmed a Virtual Keyboard (On Screen Keyboard) as a Silverlight Web Application, now I want to use this Keyboard in an other Silverlight Application (call the Keyboard when clicking a Textbox). I thought I could create a .dll and use this in my other Application.
So is it possible to create a .dll File from a Silverlight Web Application?
Thank you for reading,
Knut Hansen
You simply need to convert it into a Silverlight Class Library. There are some things to look out for, but it isn't too hard.
It is one of the options when you create a new project in Visual Studio.
See Microsoft's documentation for more info:
http://msdn.microsoft.com/en-us/library/cc838164(v=vs.95).aspx#silverlight_class_library_project
also you can think of a web service, in this way your application can be used by anyone else, of course you can specify users of your app. I think web services are more recent and using them is more future-oriented, give it a go!

Enterprise Library Logging and click once applications

We have a WPF application that logs exceptions (currently to a file) using Enterprise Library.
We are now planning to distribute this application using click once. If I have understood it correctly a click once application has limited access to the local harddisk.
So question is which location can Entlib write log entries to? Is there any special configuration required?
ClickOnce Apps support the concepts of Isolated Storage and Data Directory. See this SO Post and the MSDN. The log4net example in the SO post should guide you into the right direction.

Silverlight 4 with SQLite or alternative

I am making a Silverlight app and what I considered something straight-forward really isn't.
I am in need to create a application where a local database is stored on the web server where the Silverlight application can connect to and whenever a user goes on the application will allow sql queries to be carried out. Main use is Registration, login and event registration.
I have tried the Community SQLite: http://code.google.com/p/csharp-sqlite/
But had trouble getting it to work with Silverlight, my guess is due to poor documentation. I already have made a project containing a lot of work so I just want to implement my SQLite code into that.
Can anyone help
Thanks.
If you want your Silverlight application to have a LOCAL storage database, check out Sterling.
If you want your Silverlight application to query a centralized, server-side database, then you need to expose your database via WCF. RIA services is probably the easiest implementation.

Silverlight SQL Deployment

I'm about to write an application in either Adobe Air or Silverlight, to run standalone, offline, on the desktop. It's a simple enough application that allows the user to enter text data and will then print formatted documents based on that information. The obvious place to store all this relational data is in a database. I believe Air comes with SQLite out of the box, so no problems there, but from what I can tell Silverlight doesn't. How does Silverlight handle installing an out of browser application that needs to access a local database? Does the user have to install SQL/SQLite first and then Silverlight, or is there some way that Silverlight can deploy that side of things itself?
Thanks
I don't know much about Air, But Silverlight has IsolatedStorage for saving data on client-end and it has its own constrains. But if you want to have an application that can access local database why don't you try WPF(XBAP)?
This link can be helpful regarding SQLLite and Silverlight using IsolatedStorage.
http://forums.silverlight.net/forums/p/118411/267135.aspx
Regards.
I'm fairly certain silverlight isn't intended for... whatever it is you're trying to do.

WPF C# System.Deployment Problem

I'm developing an XBAP application in C# and want to be able to use the System.Deployment object methods. In the object browser, I'm able to see all the object, when I try and access these methods via the code, it will not work and states that the methods are not in the name space.
Any suggestions?
Not sure if this is your issue but are your XBAP running in "full trust mode" or not?
By default, XBAPs are sandboxed...
Here is a article on how to make your XBAP full trust
More information
Windows Presentation Foundation Security Sandbox

Resources