.net

WPF Application that only has a tray icon

I am a total WPF newbie and wonder if anyone could give me some pointers how to write an application that starts minimized to tray. The idea is that it periodically fetches an RSS Feed and creates a Toaster-Popup when there are new feeds. The Application should still have a Main Window (essentially just a list containing all feed entrie...

Visual Studio Database Edition: What is causing "ModelException: At least one identifier expected."?

We have a database project in Visual Studio 2008 that has been working great. Out of the blue, however, deployment stopped working. This is the error we get: EZTrac.Database.dbschema : Deploy error TSD01234: Microsoft.Data.Schema.SchemaModel.ModelException: At least one identifier expected. We've searched everywhere tryin...

msxml fails to correctly close <link> tags during XSLT transformation

Hi, I'm trying to parse a RSS feed using C#, and I need to transform it with XSLT. Here's a snippet of my XSLT: <xsl:output encoding="UTF-8" method="html" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:apply-templates select="rss/channel/item" /> </xsl:template> <xsl:template match="rss/channel/item"> <item> <li...

Enterprise Platform Statistics

Does anybody know of anywhere where one might discover the relative levels of use of different enterprise platforms? eg. percentage of J2EE vs. Spring vs. .NET vs. the various other (sometimes more obscure) platforms. I have seen lots of comparisons of Java vs. C# and so on, but I am not interested in the Desktop or Web side, I am talki...

Net DateTime.AddMonths(1) doesn't work the same as Javascript d.setMonth(d.getMonth() + 1)

I have client side date validation that requires one particular Date to be one month from a different date so I use d.setMonth(d.getMonth() + 1) and mostly works just fine. For end of month issues as in 1/31/2009, it returns 3/3/2009 and that's great - that's how I'd prefer it handle it. In the code behind, I'm also generating this d...

Unwanted Dependency on .NET Framework

I have moved my Microsoft Visual Studio 6.0/C++/MFC application to Visual Studio 2008 SP1 using the new MFC Feature Pack classes. I explicitly use nothing from the .NET Framework. However, we have trouble installing on a system which does not have .NET Framework 3.5 SP1 installed on it already. Installshield fails to load an applicati...

How to pause Garbage Collection in .NET?

I'm running some performance tests on some .NET code that processes lots of data. I want some tests that ensure the garbage collector isn't influencing my results. How do I temporarily pause the garbage collector? ...

NUnit - Is it possible to check in the TearDown whether the test succeeded?

I would like to have my TearDown method check whether the previous test was a success before it applies some logic. Is there an easy way to do this? ...

.NET Naming Convention for Class definition vs. Form

I have a lot developed in .NET windows forms and they are each named whatever they are with no prefixes. However, I often find myself needing to declare another class that contains the column names that the form uses. For instance, I have a class called Address, which is a form for the maintenance of addresses. However, I also need a cl...

Auto Update Installer for .net

I was thinking of writing a script to check, at login, if the version of out .net program was the same as the one on the server and then install an update, but if there's anything on the net which does such a thing (and has extra bells and whistles) that anyone can recommend, I'd be interested to hear about it. ...

Crystal Reports class conflict in namespace

I have recently created a new crystal report. Things were fine, report looked good, I was previewing it fine, I could run my project and things looked great. I then made a minor formatting change (made the details section slightly larger and added a line across the top) I then previewed the report and noticed that it created a second co...

Application design advice

I’m looking for some advice for an application I currently developing. I’ll try to keep this as brief as possible so if additional info is need just let me know. I’m developing an Winforms based event tracking system using VB.Net (VS 2008 Pro). The application collects data via serial bar code scanners and stores this data within a MS...

MSIL Question (Basic)

Well lets say we have this c# code: public override void Write(XDRDestination destination) { destination.WriteInt(intValue); destination.WriteBool(boolValue); destination.WriteFixedString(str1, 100); destination.WriteVariableString(str2, 100); } IL: .method public hidebysig virtual instance void Write(class [...

How to obtain numeric HTTP status codes in PowerShell

I know of a few good ways to build web clients in PowerShell: the .NET classes System.Net.WebClient and System.Net.HttpWebRequest, or the COM object Msxml2.XMLHTTP. From what I can tell, the only one which gives you access to the numeric status code (e.g. 200, 404), is the last, the COM object. The problem I have is that I don't like t...

Get Application Directory in the Installer Class

How can I get the directory that an application is being installed to from within the custom installer class? What we are trying to solve is the age old problem of *.config files for multiple environments. One idea we were kicking around was having the configs stored on a network share, and the installer would copy over the correct one...

log4net and mailing

I need to modify the existing program that does some error logging by writing to an access file and it actually uses log4net dll (as we found out by checking the dlls via hex editor) so in idea I will need to recompile the tweaked dll with the original that program uses. The need is pretty simple, for some errors that are written to the ...

Is there any way to make Code Contracts work with LINQ?

Code Contracts keep giving me "Possibly calling a method on a null reference" warnings for all of my LINQ statements, and I can't find a way to silence them. For example, the following method generates two such warnings because I'm accessing the "Make" and "Model" properties of the "car" object without first checking for null. publ...

.Net System.OutOfMemoryException filling a datatable

I need to extract data from a .dbf file and transform it into xml. I wrote a routine that does it just fine. However now we are encountering very large .dbf files - like 2GB +. And this code throws an OutOfMemoryException on those files. Public Function GetData() As DataTable Dim dt As New DataTable(Name) Dim sqlcommand As St...

Access .NET generic objects from VBA

My .net code has an object with a number of generic properties. This object is returned to the VBA code. All the non-generic properties are working well, but I also need to access the generic values. Is there a way to do it from VBA? [ClassInterface(ClassInterfaceType.AutoDual)] public class Obj { public string GetProp1() {...} ...

How to write a file format handler

Today i'm cutting video at work (yea me!), and I came across a strange video format, an MOD file format with an companion MOI file. I found this article online from the wiki, and I wanted to write a file format handler, but I'm not sure how to begin. I want to write a file format handler to read the information files, has anyone ever d...