.net

Parsing FxCop logfile - how would you do it?

I'm currently writing a tool that parses the FxCop logfile on a large codebase. My goal is to provide graphical information about the most common warnings, sorted by namespace (subsystems of the application). See example graphic. This can then be used to start a discussion about which FxCop rules we care about and what actions should b...

Run with administrative permission issue

Hello everyone, I am using Windows Vista and I find something strange, I programatically invoke IE to open IE to access some local html page, the current user belongs to administrator group; I programatically invoke IE with RunAs parameter, and let IE to access access some local html page, the current user belongs to administrator g...

RESTful API vs Web Service API

I am looking at doing a small web application for learning purposes, using .NET. My conundrum is whether I should be exposing application logic to other sites and applications via a REST API, or a set of Web Services. I am familiar with web services, but have not worked with REST. I understand the concepts of REST, I just have no pract...

Why does XmlSerializer requires the classes of the serialized object declared as public?

It's totally well known that in order to be able to serialize your objects using XmlSerializer you have to declare their classes as public -otherwise you get an InvalidOperationException. The question here is why? I Googled and I found out that XmlSerializer actually generates and compiles a brand new assembly and then uses this assembly...

memory allocation of value types and reference types in .net framework

Is there an advanced article which I can read that can explain how memory is allocated for different types (value and reference) in .net framework. for example we know that value types are allocated space on a stack, but how is that managed? Also how are reference types managed in a heap and where are the actual values stored. (Referen...

.NET OCRing an Image

I'm trying to use MODI to OCR a window's program. It works fine for screenshots I grab programmatically using win32 interop like this: public string SaveScreenShotToFile() { RECT rc; GetWindowRect(_hWnd, out rc); int width = rc.right - rc.left; int height = rc.bottom - rc.top; Bitmap bmp = new Bitmap(width, height)...

70-536 exam, same for 2.0 and 3.5

Hi, I have recently booked the 70-536 Application Development Foundation exam. On the above link it says that "If you are a .NET 2.0 developer, you do not need to learn .NET 3.5 to pass Exam 70-536; conversely, if you are a .NET 3.5 developer, you do not need to review .NET 2.0 to pass the exam.". How does this work? Do...

WCF Gotcha's for the ASP.Net 2.0 developer

Hello, Im currently looking into WCF as an upgrade option and need to consider everything this may intail in terms of a .Net 2.0 development and setup. things that come to mind .Net 3.0 to be installed (does 3.5 project act any differently) what would the effects be on our app servers (which use asmx files to publish services) are th...

How to list available instances of SQL Servers using SMO in C#?

Hi Can anybody explain me what I wrong I am doing in the following piece of code: DataTable dt=SmoApplication.EnumAvailableSqlServer(true); Server sr = new Server("Test"); foreach(DataBase db in sr.DataBases) { Console.WriteLine(db["name"]); } It gives an exception in sr.Databases that can not be connected. ...

Announcments Control in WPF

What is the recommended way to implement an announcments (or news) control in WPF? Thanks. ...

Does enumerating a BitArray cause lots of boxing/unboxing?

System.BitArray only implements the non-generic IEnumerable, which returns an Object for the IEnumerator.Current property. Does running a foreach over a BitArray - eg foreach (bool b in bitArray) { // ... } box and unbox each and every bit value? Looking at the bitarray enumerator in reflector, it looks like it does a fresh bitma...

open source .Net wiki?

Hello everyone, Could anyone recommend me a good open source .Net based wiki project? Better with successful deployment and user experience, and have a good community to support. :-) Thanks! regards, George ...

Checking if an object is a number in C#

I'd like to check if an object is a number so that .ToString() would result in a string containing digits and +,-,. Is it possible by simple type checking in .net (like: if (p is Number))? Or Should I convert to string, then try parsing to double? Update:' To clarify my object is int, uint, float, double, and so on it isn't a string. ...

Does a .net bool[] use one bit or one byte per item?

In .net, does a bool[] use one bit or one byte per array item? ie, does it automatically pack the bool values? I know a single bool uses 1 byte, but maybe the CLR has a special case for bool[]... ...

.NET Localization: Manual Translation or Character Encoding

I am working on a project that requires localization of all user-facing text in the database. Thus, for a business object there are usually three tables involved: EntityBase - Holds core attributes EntityLocalized - Holds localizable attributes and related culture Cultures - Holds list of acceptable cultures I use a view for every en...

Best 'connection' between MyUserControl.List<NestedControl> and MyUserControl.Panel.Controls

Actually i wrote a UserControl which acts as a container for other (let's call it) NestedUserControls. I implemented a programmatically way to add such NestedUserControls to my UserControl (through an App(string name) function). But what i actually more like would be some kind of List as a public property for my UserControl. But the pr...

Calculating the Present Value

Present Value is the value on a given date of a future payment or series of future payments, discounted to reflect the time value of money and other factors such as investment risk. And yes, I know it's formula so don't need that. But I am wondering if this method is already predefined within the .NET libraries. I can't find it. (And I...

.Net Application performance monitoring tool

is there any .Net Application performance monitoring tool? I've an application in C#.net stand alone application. I've to look at the performance of that application. Performance in the sense memory,CPU usage and loading etc... ...

Using an attribute to throw an exception in .NET

Hello, Is it possible to use some kind of attribute to throw an exception. This is what I mean. Instead of doing this: public int Age { get { return this.age; } set { this.age = value; NotifyPropertyChanged("Age"); if (value < 18) { throw new Exception("age < 18"); } } } D...

Are there frameworks or customizable tools to make a visual editor for my .NET app?

Hi I have an application, which performs some custom data gathering, transformation and reporting. Currently, the only way to set up and configure all the steps is to fill some large and cumbersome WinForms screens. What I'd like to do is to make a lightweight and user-friendly visual editor, where "blocks" will show data sources, data...