.net

Deadlock help needed please

I have a peculiar situation. I have tables that are constantly accessed by different parts of our code and thousands of clients and so we employed the use of transactions when doing simple updates and inserts on our tables. Problem is we keep getting deadlock errors. Anyone have any idea how I can alleviate this problem? ...

ASP.NET MVC 3 Futures Library - Post New or Undocumented Feature Discoveries Here Please!

Possible Duplicate: Actually, a more specific version of below post, as mods declared below post as vague and general, yet this specific version is apparently a dupe? Asp.Net MVC 3.0 Futures - Please post your feature discoveries here? Basically trying to figure out the usage of the new features in the MVC 3 Beta Futures that ...

Specifying a pronunciation of a word in Microsoft Speech API

Hi, I'm working on a small application in C# which performs speech recognition using Microsoft Speech API. I need to add some non-english words to grammar, whose pronunciation don't obey english pronunciation rules. Is it possible specify their pronunciation using International Phonetic Alphabet ? If yes, which methods should be...

Unhandled FileLoadException that I think I'm handling

I have a thread that get I initialize like this: Utility.Log("1"); myThread = new Thread(new ThreadStart(delegate { Utility.Log("2"); and then the rest of the thread's execution. The weird thing is, despite that whole thing being wrapped in a try/catch, I'm only seeing a 1 in my log file (no 2), and I'm getting an unhandled Syste...

C# Excel - How to copy the rows filtered by the AutoFilter() method

Hi I've been using the AutoFilter() method with no problem so far. but i wasnt able to mark or get the range of the filtered rows, to count/copy/delete them. I've seen many posts on this issue with VBA, but non for C#. After filtering, i tried to get the range by any of those lines range = ws.UsedRange.CurrentRegion.SpecialCells(Exce...

Make .NET snipping tool compatible with multiple monitors

An alternative snipping tool solution was provided in this posting: http://stackoverflow.com/questions/3123776/net-equivalent-of-snipping-tool Now it's necessary to make it work for selected screens (on multi-monitor systems). The code has been modified accordingly: Public Class SnippingTool Private Shared _Screen As Screen ...

Question about Entity Framework and Transactions

public void SomeMethod1() { using (TemplateEntities ctx = new TemplateEntities()) { //do something in this ctx } } public void SomeMethod2() { using (TemplateEntities ctx = new TemplateEntities()) { //do so...

QA Build Automation Mechanism for .NET Project on SVN

Hello, We are working on .NET Windows Application. We were using TFS from the beginning. Now, after Assembla - an agile wiki project management and collabration tool that provides a repository for source control which is on SVN we are moving from TFS to SVN. We didn't bother when we started how would we provide (weekly) builds to our Q...

Methodologies used to speed up the process of creating and coding subforms

My question is how programmers create, code, and organize subforms in general. By subforms, I mean those groups of controls that make up one UI experience. I'm looking for hints to help me better organize my form codes and to speed up the process of creating such forms. I swear to God, it takes way too long. I've identified three broad...

Building objects at runtime

I have a number of objects that I need to create and add to an array. However the code below seems dirty and difficult to maintain in the long run. What I'm thinking is, I should store the Name and Value properties in a table and build each comCommand object at runtime. However, I'm not exactly sure what the best method to about doing t...

How do I add the css class attribute to a textbox in razor?

I have tried: @Html.TextBoxFor(m => m.UserName, new {@class='textbox'}) which isn't working. ...

Debug .NET Socket callbacks

I use the async BeginReceive method of System.Net.Sockets.Socket. This requires a callback to an OnReceive function. However, nothing bugging in this section seems to be taken in charge by the debugger. So if anything goes wrong (uncatched exception), the app just crashes. Any idea how to fix that? ...

Protobuf.net "The type cannot be changed once a serializer has been generated"

I have some fairly simple code using Protobuf.net, which is throwing a very odd exception. In MetaType.cs on line 167 it throws a InvalidOperationException "The type cannot be changed once a serializer has been generated". What does this mean and how do I fix it? My code looks like this: This method starts off all the serialising: whi...

C# Run From Bytes

I am working on making my client open another program by downloading the bytes and using reflection to open it. I have currently got this working on a C# Console Application, but when I try and do it on a Windows Form Application I get this error. "Exception has been thrown by the target of an invocation." Here is the code using Syste...

How can I get a collection of the assemblies in my .NET solution?

Hi, For a .NET solution, is there a way to get all the .dll files for each project in the solution? For example, if I make an empty .NET solution (this is Visual Studio 2010 btw), and add 3 projects called "a", "b" and "c", and build each, providing me with dll's a.dll, b.dll, and c.dll, is there any code sample in either C# or Powershe...

Is Dictionary<TKey, TValue> adding empty elements in the backing storage?

I am looking into the code behind Dictionary<TKey, TValue>. What is interesting is in the private Insert method, there is a bucket that appears to be holding empty slots in a pre-sized array. Inside the Insert method, the code checks to see if the bucket has any elements left and will resize if necessary. The number of elements added is ...

ORM or straight SQL?

Possible Duplicate: Using an ORM or plain SQL? Would you elect to use an ORM or some kind of home spun DAL? And why? The advantages of an ORM seem obvious - better structure / organization, better language fit etc. But I worry about performance issues. Anyone have war stories to share? Any insights on not so obvious risks or ...

Visual Studio Code Analysis - Issue explanation Help not available

Previously, when running a Code Analysis on my project, I thought the context men used to show a link to a MS web page that explains the issue in more detail. I don't see that now and I am not sure if I am doing something differently or if I am confusing this tool with another. Does anyone know if this type of information is normally av...

Default IMarshal implementation?

I am trying to implement registry-free COM explicilty in my code (can't use registry-free COM via an app manifest since that only works on the exe level): I create a static class that loads the COM dll, calls DllGetClassObject, then IClassFactory::CreateInstance(). Works just fine to a point. Implementation details are at http://www.dim...

list Mocking Books

Hi guys can anyone list if any books are available on mocking? for .NET Currently i am reading ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution by Emad Ibrahim it's good book but you get lost with just code snippets. It would have been great if at the end of each chapter he had some artifacts ...