.net

Localizing enum descriptions attributes

What is the best way to localize enumeration descriptions in .net? (See Adding descriptions to enumeration constants for enum description example) Ideally I would like something that uses ResourceManager and resource files so it fits in with how other areas of the app are localized. ...

.NET Library for merging files

Hi all, Do You know any .net library that can be used for comparing and especially merging of two files (like .pst) - would be the best if open-source or inexpensive. ...

.NET class library licencing idea - madness?

Hi I'm currently developing a .NET library (not a control), and considering how to provide a combined "development" and freely run-time deployable licencing scheme to work with it. I'm thinking for developer licencing, some kind of node-locked will be just fine (file and/or server/web service), but I want to allow developers to freely d...

Are there compelling reasons AGAINST using the C# keyword "as"?

I find that using the following: TreeViewItem i = sender as TreeViewItem; if(i != null){ ... } is easier to write and understand than: if(sender.GetType() == typeof(TreeViewItem)){ TreeViewItem i = (TreeViewItem)sender; ... } Are there compelling reasons not to use the first construct? ...

Associating logging from two or more processes

I have two processes that I have up and running and I am doing logging from. One is a client the other is a webservice. I want to setup a central log system where I can track logs and interactions between processes -- for instance I want to be able to associate calls made from the client to the webservice when I look at the logs. I guess...

IMAP folder path encoding (IMAP UTF-7) for .NET?

The IMAP specification (RFC 2060, 5.1.3. Mailbox International Naming Convention) describes how to handle non-ASCII characters in folder names. It defines a modified UTF-7 encoding: By convention, international mailbox names are specified using a modified version of the UTF-7 encoding described in [UTF-7]. The purpose of thes...

.Net Control to do Google Chrome Docking

I like the way that Google Chrome allows you to grab tabs out of a window to create additional windows. Does any one know if there is way to do this style of docking and undocking in my .Net application? Or better yet does any one know if there is a .Net component that can provide this type of functionality? ...

Good 'XML with .Net' reference or Book

Greetings! This is quite a newbie question but forgive me. Can anyone recommend a good place, either site or book, to get up to speed on the XML Frameworks with .Net. I think I have the basics down but I have the feeling it's not as elegant as it could be. For example: When to use XMLDocument or XMLReader for finding elements How c...

InvalidArgument on outputfile in deflate stream

I want to deflate a file using deflate stream. Below is the code I am using. using (oZipper = new DeflateStream(outputFile, CompressionMode.Compress)) Where oZipper is a filestream. When I step into the line of code above (using (oZipper...), an exception is thrown: Base stream is not writeable, InvalidArgumentException. Parameter: ...

Converting VB6 PropertyBag in .NET

For certain file operations we use VB6's PropertyBag object to convert various items to a bytearray via the Content property. We then save the bytearray as part of a binary file. Later when we load the file we read back the file, read in the bytearray and reconstitute the item by using the propertybag's readproperty. We use this a lot to...

Converting UTF-8 to ASCII in VB.NET

I am writing a console application, which reads emails from different email boxes and processes through them. Emails are received from various automated systems. The email messages are logged and/or sent forward. The problem is that some emails are encoded in UTF-8 and transfer-encoded in quoted-printable which messes up special charact...

How can I share Linq to Entities datacontracts between WCF and Silverlight

0 vote down star 1 I want to be able to share my datacontracts (classes generated in the linq to entities designer are decorated with the [DataContract] attribute. I'm trying to use the architecture as detailed here: http://www.netfxharmonics.com/2008/11/Understanding-WCF-Services-in-Silverlight-2 and trying to reference my interfaces...

Loading Iron Ruby DSL files on demand

Hi, Currently I have an application that stores metadata information written in a boo internal DSL. I store the metadata in seperate .boo files that I load if and when I need them like this: IConfigReader reader = factory.Create(BUILD_FILE_NAME); I would like to take advantage of Iron Ruby's or indeed Ruby's meta programming by conve...

Can I change the value of Environment.NewLine?

I'm working with a library that uses Environment.NewLine as it's newline char when writing a file. I need it to write Unix formatted files, and as such would like to change the newline char. Can I change the value of Environment.NewLine? Any other ideas (aside from converting the file post creation)? ...

Using C# to get a list of ACLs for Servers and mapped drives

The production change implementers for our IT group have been tasked with reviewing the security for all of the various objects in our group, primarily to make sure that people who have left our employ or have transferred to other groups no longer have access to our server shares, web directories, sql databases, etc etc. We recently comp...

ASP.NET 2.0 & Web.config: Is this correct <appSettings/>?

I'm looking in Web.Config to add a simple (from a book) amendment - <configuration> <appSettings> <add key="SupportEmail" value="[email protected]" />. </appSettings> </configuration> However in the web.config I see there is only the following sign/bracket/block(?): <appSettings/> I can't find the opening . And isn't that an i...

Best practice when returning an array of values (.NET)

Usually my methods are as the following: public List<int> Method1(int input) { var output = new List<int>(); //add some items to output return output; } But FxCop advises another IList implementation instead of List, but I can't remember which. The alternatives include returning it as an IList, ICollection or IEnumerable f...

How do I investigate my java-based web service from .NET?

I have publicised a Java method as a Web Service and I use the Web Service Explorer in Eclipse to invoke it and it works as expected. See http://soa2world.blogspot.com/2008/05/soap-client-eclipse-web-service.html for screen shots (not taken by me). To ensure that this will also work against clients written in .NET I'd like to repeat th...

In C#, how to check if a TCP port is available?

In C# to use a TcpClient or generally to connect to a socket how can I first check if a certain port is free on my machine? more info: This is the code I use: TcpClient c; //I want to check here if port is free. c = new TcpClient(ip, port); ...

Why is ReflectionOnlyAssemblyResolve not executed when trying to Assembly.ReflectionOnlyLoad?

I'm trying to load a few modules via hooking into the AppDomain.AssemblyResolve and AppDomain.ReflectionOnlyAssemblyResolve events. While I got the former to work, I fail miserably on the latter. I've boiled my problem down to this little program: public static class AssemblyLoader { static void Main(string[] args) { App...