.net

User32 API calls in .NET

I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to handle this for me. Ho...

How do I obtain a list of the application domains my application has created?

I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID. After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable. Purely from a san...

What functional differences exist between WPF and WinForms WebBrowser control?

WPF WebBrowser control looks great but knowledge accumlated over time about WinForms WebBrowser is substantial and it's hard to ignore work like csExWB. It would be nice to know what functional shortcomings or advantages exists in .NET 3.5's WPF WebBrowser control over WinForms WebBrowser control. In particular, is it possible to build c...

Binding Gtk# NodeView to a IList?

I've got a data object with a component in it that is an System.Collections.Generic.IList, and I'd like to reflect changes to that list into a Gtk# NodeView, so that when an item is added to the list, the NodeView will get a new item added to it. How would I listen for changes to an IList? I have considered wrapping the IList with a ...

AG_E_PARSER_BAD_PROPERTY_VALUE for StaticResource in Silverlight

I'm storing all localizable strings in a ResourceDictionary (in App.xaml) and assign those via the StaticResource markup extension to TextBlock.Text, Button.Content etc. In Beta 2 and RC0, sometimes parsing the XAML in InitializeComponent() will fail with an AG_E_PARSER_BAD_PROPERTY_VALUE on the line and position where I set the attribu...

How can I find the method that called the current method?

When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something like Assembly.GetCa...

Why does FileSystemWatcher create multiple change events when I copy a file to the directory

I've written a small test application using the .Net FileSystemWatcher to keep an eye on a directory. When I copy a large-ish (a few Mb) file into that directory I get the following events listed (see screenshot - and ignore the Delete event to begin with). I get a created event (as expected), but then two changed events (about 0.7 se...

Is it possible to generate a database from the Entity Data Model (edmx) file?

In Linq to SQL it is possible to generate the database from the dbml file. Is it possible to generate a database from the Entity Data Model ? I wish to accomplish the same thing using the edmx file. ...

Slow SoapHttpClientProtocol constructor

I'm doing some experiments with Microsoft Dynamics CRM. You interact with it through web services and I have added a Web Reference my project. The web service interface is very rich, and the generated "Reference.cs" is some 90k loc. I'm using the web reference in a console application. I often change something, recompile and run. Compi...

How to get notified when a drive letter becomes available

Is it possible to get notified (without polling, but via an event) when a drive letter becomes accessible. For example if you have an external hard drive that always appears as drive F - is it possible to have an event raised when that is connected and F becomes accessible? ...

C#/.NET Lexer Generators

I'm looking for a decent lexical scanner generator for C#/.NET -- something that supports Unicode character categories, and generates somewhat readable & efficient code. Anyone know of one? EDIT: I need support for Unicode categories, not just Unicode characters. There are currently 1421 characters in just the Lu (Letter, Uppercase)...

Why does System.Net.Mail fail where System.Web.Mail works.

I can get both System.Net.Mail and System.Web.Mail to work with GMail, but I can't get them both to work with smtp.att.yahoo.com. I get the SMTP settings from my own Web.config keys. These settings work when I send using System.Web.Mail, but fail with System.Net.Mail. <add key="SmtpServer" value="smtp.att.yahoo.com"/> <add key="Smt...

Why is obj folder generated for?

The default output path for any project is Visual studio is bin/Debug, but I have noticed that obj folder is also generated which again contains dlls and pdbs. Can someone tell me why is this folder generated ...

How do you do ALSA in Mono?

Does anyone know how to access ALSA (low-level audio API) in Linux using Mono? NOTE: I'm hoping to access ALSA using PInvoke. ...

Tracing versus Logging and how does log4net fit in?

I am wondering about what the difference between logging and tracing is. Is the difference basically that tracing is more detailed log giving developers a tool to debug applications at runtime? I have been experimenting with log4net and doing logging. Now I am wondering if I should be doing tracing as well and if I could/should use log...

.NET Table Adapters: Get vs. Fill?

I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data. Can anyone provide guidance as to the implications and gotchas of each method? In what situations is it p...

How do I store an XML value in my .NET App.Config file

I am trying to store an xml value in my app.config file. The app.config does not like this and I cannot use the <![CDATA[ construct to ignore the XML'ness of my value. Is there a way to do it? Value example:<FieldRef Name='LinkfileName' Nullable='True'/><FieldRef Name='Web' Nullable='True'/> ...

WCF DataContracts

I have a WCF service hosted for internal clients - we have control of all the clients. We will therefore be using a data contracts library to negate the need for proxy generation. I would like to use some readonly properties and have some datacontracts without default constructors. Thanks for your help... ...

Good dynamic programming language for .net recommendation

Well, after a long time writing .net programs in C# I started to feel angry and frustrated about all that syntactic trash that comes with statically typed languages. Now I want to change to dynamically typed languages, that takes advantage of CLI. So I searched a bit around and I didn't like of what I saw. I first looked for IronPython. ...

Is there a way I can tell whether an SMTP server is expecting a client to connect using "implicit" SSL versus "explicit" SSL?

SSL can either be "explicit" or "implicit" as explained by this link: http://help.globalscape.com/help/secureserver2/Explicit_versus_implicit_SS.htm System.Net.Mail only support "explicit" SSL, as explained here: http://blogs.msdn.com/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx So, I'm...