.net

Is there any way to provide custom factory for .Net Framework creation Entities from EF4 ?

There are a lot of posts about how cool POCO objects are and how Entity Framework 4 supports them. I decided to try it out with domain driven development oriented architecture and finished with domain entities that has dependencies from services. So far so good. Imagine my Products are POCO objects. When i query for objects like this: ...

multi threaded file processing with .NET

There is a folder that contains 1000 of small text files. I aim to parse and process all of them while more files are being populated in to the folder. My intention is to multithread this operation as the single threaded prototype took 6 minutes to process 1000 files. I like to have reader and writer thread(s) as following : while t...

'abstract class' versus 'normal class' for a reusable library

I'm developing a reusable library and have been creating abstract classes, so the client can then extend from these. QUESTION: Is there any reason in fact I should use an abstract class here as opposed to just a normal class? Note - Have already decided I do not want to use interfaces as I want to include actual default methods in ...

How to assign Value to Key in App.config of C# win app ?

I am using the below string in my code : string AAR_FilePath = "\"C:\\MySQL\\MySQL Server 5.0\\bin\\mysqldump\""; which i dont want to hardcore in my code. So i need to use that in my app.config I tried to give the same value as, <add key="Path_SqlDump" value="\"C:\\MySQL\\MySQL Server 5.0\\bin\\mysqldump\""></add> But the above gi...

Which design pattern to manage windows?

Hello, I am using .NET 2.0 & C# to develop a WinForm Mdi application. It will have a Main Window and a lot of mdi windows. I am thinking I should use which design pattern to manage mdi windows. Because I want only one instance for each window, if window is existed, I will show it on top, & otherwise I will create and show it. Note: a md...

BackgroundWorker acting bizarrely...

Hi guys I'm working on some code that calls a service. This service call could fail and if it does I want the system to try again until it works or too much time has passed. I am wondering where I am going wrong as the following code doesn't seem to be working correctly... It randomly only does one to four loops... protected virtual ...

Parse XML and populate in List Box

I've posted the same question here and I've also got couple of good answers as well. While I was trying the same answers, I was getting compilation errors. Later I got to know that we are using .NET 2.0 and our existing application has no references to LINQ files. After searching in SO, i tried to figured out partly: public partial cla...

Using a Resource as an Attribute to a HTML Element in ASP.net

I would like to have this piece of code in my .aspx file: <input class="ms-ButtonHeightWidth" type="button" name="BtnOK" id="Button2" value="Close" onclick="javascript:HandleOKButtonClick()" accesskey="<%$Resources:wss,okbutton_accesskey%>" /> Unfortunately, ASP.net doesn't seem to like that: An error occurred during the processing ...

Any libraries out there that extend System.Diagnostics.Trace?

Any there any good libraries out there that extend System.Diagnostics.Trace? Some of the features I am looking for. Rolling logs smtp And "Use log4net" is not an answer. The reason being is that i don't want a reference to any third party assemblies. In response to comments: Because using trace does not pollute the business code. I...

Team Foundation Server Work Item customization -- Add a new Text Field

May I know how to add a new custom text field in TFS to show the lastest revision number? Can anyone explain in deatil about Making use of work item’s XML and customize TFS work items. How to create custom window form control to add to work item.And installation of custom control runtime ...

How can I extract System.Net.Mail from Mono and rename the namespaces?

Microsoft's implementation of System.Net.Mail does not provide a robust mailing solution. I would like to use Mono's implementation of System.Net.Mail instead, however that namespace is embedded in the System.dll shipped with Mono, and has exact same namespaces as the original .net framework. What I would like to do is instead extract ...

Microsoft .NET security model

Hi all, I am looking for informations about the security model of Microsoft .NET If you could explain me how it is design, or give me links to understand it, it would be very kind of you ! Thanks. ...

Reuters OpenDACS .Net Framework

Scenario As some of you may have heard, OpenDACS is an open source data-access control system for enforcing data usage permissions. DACS comes integrated with the Reuters platform but you can use OpenDACS for extending third-party software. I'm using IE6, I can't embed these links properly. http://thomsonreuters.com/products_services/...

How to Impersonate a user in managed code?

Given a username and password how do i impersonate that user and run some code as that user. And by managed i mean without pinvokes or dllimports ...

Can I get Active Directory attributes from the WindowsPrincipal?

I would like to get the Employee-ID for the currently logged in user. Is that easily available in some .Net class or do I need to do some sort of LDAP query? Any tips welcome ...

problem to add access to RSA key container

I have two administrator users on my machine. With the first one I am creating a machine level key: aspnet_regiis -pc "NetFrameworkConfigurationKey" -exp and I see it created in "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys". Now I am trying to add access privileges with the second one: "c:\WI...

How to avoid MissingMethodException?

If .NET 3.5 is installed, but not .NET 3.5 SP1, WaitHandle.WaitOne(int) throws a MissingMethodException. I'd like to be notified earlier on if the correct version of the .NET libraries is not available, for example when the application is started. Is this possible? Update: So my question question is twofold: a) How can I determine whi...

i need help with using string template with .net mvc2, where do i get started?

Hi, I'm trying to try out string template with .net mvc, but i can't find any tutorial that is good for newbies and give me a step for step guidance through how to implement string template with c# and .net mvc2... any help is really very very very very ........ very appreciated Lina ...

Why are we getting a WCF "Framing error" on some machines but not others

We have just found we are getting “framing errors” (as reported by the WCF logs) when running our system on some customer test machine. It all works ok on our development machines. We have an abstract base class, with KnownType attributes for all its sub classes. One of it’s subclass is missing it’s DataContract attribute. Howeve...

Application leaking Strings?

My .net application does some heavy string loading/manipulation and unfortunately the memory consumption keeps rising and rising and when looking at it with a profiler I see alot of unreleased string instances. Now at one point of time or another I do need all objects t hat do have these string fields, but once done, I could get rid of e...