.net

ORM/Persistence layer Advice

Hi all I'm starting a new project and I'm looking around for either a very good ORM or for a non-SQL-based persistence layer. For this project, I really don't care on how the data is persisted, as long as it can be queried and stored with a reasonable speed and most importantly with simple queries. Concurrency should be handled seamlessl...

Why is DateTime a structure in .Net?

Why is DateTime a structure instead of an inheritable class? (I would like to be able to override the ToString() method but I can't.) ...

What is the best way to customize user authorization when basing user privilege on something other than specific accounts/roles?

I'm trying to write an ASP.NET MVC application where user privilege is based upon points rather than by a hard-coded role per se. I've tried researching authorization and membership providers but all the information I find points back to role based authentication which isn't really part of my model. While writing this question I'm wond...

Setting XSL substitution parameters within c# code

Hi, I am trying to set the width variables <WIDTH> and <WIDTH1> within XSL which I am retriveing from the web.config within c# as below: string Width1 = System.Configuration.ConfigurationSettings.AppSettings.Get("Width1"); string Width2 = System.Configuration.ConfigurationSettings.AppSettings.Get("Width2"); cslx.Xslt=@"<?xml vers...

Any alternatives to the .Net 4 Code Contracts static analyser?

It seems that the static analyser for use with the .NET 4.0 Code Contracts is only going to be available for Team Suite editions of Visual Studio - this puts it well outside the budget for my team. Are there any alternatives (open source, free or reasonably priced) which offer similar static analysis for design by contract style code (n...

Using WFS-T in n-tier application

I need to integrate WFS-T (Web Feature Service-Transactional) in my 3-tier .net application. Not sure about the best practice to do such task, so I would appreciate any help... ...

Has anyone used SmartThreadPool of Ami Bar and can share his/her experience with it?

Dear ladies and sirs. I am looking into alternative ThreadPool implementations and have found the SmartThreadPool implementation by Ami Bar. It looks very interesting, so my question is whether anyone has actually used it and if so - please share the experience. Thanks. P.S. Our thread usage matches the one described as optimal by Am...

Mono source code walkthrough / tutorial

I checked out the Mono source code, and searched all files for some of my favorite .NET classes with no results. I'm pretty lost and I want to know: In which language Mono is written? Where are, in all those folders, the source files with the equivalent .NET classes implementations? It's easier to build it in Windows or Linux? ...

System.ArgumentNullException in System.Threading.Monitor.Enter

I've got a code like this: Some of our clients receiving "System.ArgumentNullException in System.Threading.Monitor.Enter" in the following code block: Public Class CheckStuff Private Shared SLock As New Object Public Sub GetIt() Synclock SLock DoSomething() End Synclock End Sub End Cl...

How do I theme windows like Google Chrome, with WPF?

You know how Chrome windows are super custom looking and what not, they have a custom title bar that has custom looking minimize/maximize/close buttons. How would I do this with WPF? ...

How to set default input value in .Net Console App?

How can you set a default input value in a .net console app? Here is some make-believe code: Console.Write("Enter weekly cost: "); string input = Console.ReadLine("135"); // 135 is the default. The user can change or press enter to accept decimal weeklyCost = decimal.Parse(input); Of course, I don't expect it to be this simple. I am ...

How-to store a questionary in database

How-to store a questionary in database and maintain it using Enity Framework and ASP.NET ? I have couple of question with certain numbers of answers.This questions are part of an users registration formular. Something like: Aaaaaaaa? Checkbox1 - bbbbbbb Checkbox2 - ccccccc Checkbox3 - ddddddd Checkbox4 - eeeeeee and more questions.....

How can I attach a custom membership provider in my ASP.NET MVC application?

How do I tie up my custom membership provider with my ASP.NET MVC [Authorize()] attribute? I've blasted through a number of tutorials for how to create a custom membership provider but all the information I've found about how to hook it up to an application seems to revolve around regular ASP.NET WebForms applications which seem to be a...

How do EventArgs Cancel work in the FormClosing Event?

How does the e.Cancel event work in the FormClosing event on a WinForm? I know you set it to True to cancel the closing, but at what point does the form process this? Is there a secondary action taken by the property? How could I implement a similar action in a custom control? (C# or VB) Note: I've looked for about 30 minutes now and ...

Parse nested groups

I have a string with nested groups like this ('blabla' is some text within the string that must be ignored) string Stream1 = @"group ""Main"" bla bla group ""Sub1"" -- block-group var1 var2 ...

Is there any free mocking framework that can mock static methods and sealed classes?

Typemock can do this but it is $799USD and that is a lot to pay for two features. Please no conversations about avoiding using static and sealed things or encapsulating them. When using a large 3rd party API it is not possible and/or practical. Thanks ...

Installing Loadrunner

Well, it figures that Loadrunner is not easy to install. Apprently, we need: ➤ .NET Framework 3.5 ➤ Microsoft Data Access Components (MDAC) 2.8 SP1 (or later) ➤ Microsoft Windows Installer 3.1 ➤ Microsoft Core XML Services (MSXML) 6.0 ➤ Microsoft Visual C++ 2005 Redistributable Package (x86) ➤ Microsoft Visual C++ 2008 Redistributable ...

How to programmatically rename an Outlook 2007 item attachment?

How do i programmatically change the filename of an Outlook item attachment. Ideally I'd like it to be something like this: Outlook.DocumentItem d; foreach (object ob in oFolder.Items) { d=(Outlook.DocumentItem)ob; d.Attachments[1].FileName = "xyz.pdf"; } Please ignore assumption about there being an attachment, Im only interested...

What .NET control do i want to use?

What .NET control do i should i use to display this to the user? I have 2 types of elements, a package and item. The data an item contains is id, size and status. The package can have several items (but no packages as its not a tree). It holds status and count. I can think of a 3rd column for this. I will need to right click each item o...

How to change the security level of a local assembly to internet or customized permission set?

I built a assembly which is a class library, for example lib.dll . And I also have a application to access this lib, for example test.exe. I changed the security permission for the test.exe to "intranet". At the same time, I want to change lib.dll to "Internet" like this: (Because I want to do some testing for security.) CasPol.exe -m ...