.net

.NET Reflector error: No disassembled code

I've been using .NET Reflector for awhile but I've just recently switched machines and I've reinstalled. However, when I try to disassemble code now, the Disassembler window just shows up as blank. Here's a screenshot where I'm trying to disassemble a TimeSpan Member: ...

How do I create a thread that runs all the time in the background in a .net web site?

I intend to build a small web site that will poll a third party web service, say every 15 minutes, store the collected data in a db and display the results via web pages. I want the polling to run 24 hours a day with or without anyone visiting the web site. I know I could create a stand alone application that could run on the server ...

Multicast support in .Net

In order to implement a network application that uses multicasts to send small periodic messages to other processes in the network, what choices do I have with regard to using APIs in the .Net framework? Apart from my obvious current choice, the System.net.sockets API, does WCF provide a simpler approach? Or is WCF purely a point-to-poin...

Possible downside to immediate if operator (?:) in C#?

I seem to recall something about avoiding the Immediate If operator (?:) in C#, but I don't know where I read it and what it was. I think it had to do with the fact that both the true and the false part are executed before deciding on the outcome of the condition. Is this correct? Or is this so in VB.Net? ...

Why are .net configuration settings compiled into assemblies?

I have been trying to read up on how to do configuration properly in .net and have run into something that I find a bit odd and that is that configuration settings are compiled into assemblies through the Settings class. Removing the app.config and running the application does not result in configuration errors as I was expecting but rat...

need wcf and wpf application source code for beginer

Hi, I am beginner for .net 3.5, have to work on app where I need to build desktop version as well as web version for selected modules like reporting. I think WCF will help me out to create a base from where I could call functions in both(desktop as well as web ) Please let me know the any available source code sample projects to go thr...

How to use Nhibernate with variable or dynamic table names like Jan08Tran,Feb08Tran,Mar08Tran

I have legacy database in which transaction tables are stored by monthly names. eg. Jan08Tran Feb08Tran How can I use NHibernate to work with this tables? Read a bit about entity-name property, SubClass etc. But not able to find concrete solution. ...

Java for intermediate .NET Developer

I am a .NET Developer with about 5 years of web development experience using Microsoft technologies starting with classic ASP to ASP .NET 3.5. I do have a little background in Java as well and can write/understand Java code very easily. I am looking for resources (online, books) that are compatible with my .NET experience. I am only int...

Update all WCF Service References in one click (two clicks would be OK too!)

I have multiple projects containing multiple WCF service references. My WCF services are in a state of flux so I frequently have to go around and update all of my service references. Is there a way to achieve this as a single action? ...

How to keep dynamically populated datasets to stay with the program?

I have a winform application that uses some referenced web services to get data. The data returned is an array of objects that I loop through and add to a dataSet. When I call the service, it can often take 2 or 3 minutes to get all the data. If the user exits the program and comes back later, I don't want them to have to re-download ...

Making build process independent of GAC

How can we make our build process (Dev Studio 2005) for a .NET project completely independent of what is installed on the GAC on the particular machine that it is running on. Here's the problem we're trying to solve: Depending on what assemblies happen to have been installed into the GAC, our build process generates different .NET assem...

How to use web.config when unit testing an asp .net application

I am starting out with unit testing, I have a method that uses the web.config for a connection string. I was hoping to be able to use [DeploymentItem("web.config")] to get the web config file, this still leaves me with null reference exceptions (that'd be what I write my next test for). How do I use the config file included with the...

Question about GetHashCode implementation

http://msdn.microsoft.com/en-us/library/system.object.gethashcode(VS.80).aspx says: For the best performance, a hash function must generate a random distribution for all input. Does it have any effect in performance or it's ok to use a function (like return this.Id) that doesn't give a "random distribution" but it doesn't cause mor...

Limit Values for Properties in .NET

I know this may be a noob question, but it's bugging the heck out of me. Let's say I have a user control that I reference in my .aspx page: <uc:somecontrol runat="server" id="uc1" property1="red" /> how do I make it so when in VS05 the intellisense will show options like "red", "green", "blue" for property1? Similar to how when you w...

.Net Webservice Secure

Hey Everyone, Are there any good examples out there of how the following webservice would work? I would like a windows/web client to be able to access a webservice, but the client should pass a username, password, and ip address and the webservice should be able to determine if it is on the list of allowed users or not before taking the...

Copying a List<BaseClass> to List<DerivedClass>

Given the following class definitions: public class BaseClass { public string SomeProp1 { get; set; } } public class DerivedClass : BaseClass { public string SomeProp2 { get; set; } } How can I take a List<BaseClass> and convert it to a List<DerivedClass>? In my real-world scenario BaseClass has a whole bunch of properties t...

Why does the Standard Numeric Format for percentages include a space?

The Back Story I have some decimal values which I am displaying as strings on a web page as part of a larger string. I started off using a http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx]">Standard Numeric Format String to output this. E.g. myDecimal.ToString("P0") The 0 after the P tells it I want no decimal places. This works...

How to retrieve metadata for return values of an sql server stored procedure

I want to analyze an SQL Server stored procedure from .NET code to retrieve metadata for the data/columns it returns (not OUTPUT parameters). Like when you drag/drop a sp on a DataSet i VisualStudio and it automatically generates columns. It could be useful for me for some code generation I'm testing out. The procedures contains simple...

What is the "Weak Event" pattern used in WPF applications?

The WindowsBase DLL defines the IWeakEventListener event with summary: Provides event listening support for classes that expect to receive events through the WeakEvent pattern and a System.Windows.WeakEventManager. This vague description doesn't describe what the 'WeakEvent pattern' actually is. So, what is this pattern, why is it...

Is there a Bayesian filter library for .NET

Is there a Bayesian filter library for .NET? I would like to setup a group of folders and have emails automatically moved to those folders based on what has been previously moved to the folder. If you are familiar with FogBugz auto-sort, that's exactly what I would like to do. ...