I'm trying to make some sense out of an application Ive been handed in order to track down the source of an error. Theres a bit of code (simplified here) which creates four threads which in turn populate list views on the main form. Each method gets data from the database and retrieves graphics from a resource dll in order to directly po...
Hi all!
We need to be able to simultanously maintain a set of different versions of our system. I assume this is best done using branching.
We currently use TFS2008 for source control, work items and automatic builds.
What is the best version control solution for this task?
Our organization is in the process of merging to TFS2010.
Wil...
I'm implementing a custom ASP.NET MVC controller factory.
I wonder when the ReleaseController method is called? Is it the same time as EndRequest?
...
I recently had an issue after upgrading my .net framework to 4.0 from 3.5:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Net.Base64Stream.EncodeBytes(Byte[] buffer, Int32 offset, Int32 count, Boolean dontDeferFinalBytes, Boolean shouldAp...
I need to write a regex that matches strings like "abc", "ab", "ac", "bc", "a", "b", "c". Order is important and it shouldn't match multiple appearances of the same part.
a?b?c? almost does the trick. Except it matches empty strings too. Is there any way to prevent it from matching empty strings or maybe a different way to write a regex...
I'm relatively new to .Net 4 and I am creating my FIRST WPF application using a MDB as a backend datasource.
I designed my UI. I have a TextField (called Name), a Combobox (called Division) and a DataGrid (called dataGrid1).
The only problem I'm having is figuring out how to link my DataGrid to display data from the DataSource. and loa...
I am trying to figure out how to monitor more than one table with a SqlDependency. All the examples I have found are for one table.
I have multiple classes that represent a monitor for a specific table. Each time a change event is raised I stop the dependency and start a new one but that unhooks the other monitors. How do I get it to...
Hi,
in my application there is a print form. When you click the print button, the windows print dialog appears, showing the printed page.
When it's finished the print form is closed (this is still ok) but my application is set to the background on the z-order (this is not ok) and another application window is set to the foreground.
I c...
OK, I admit it this code will just look weird to you, and that's because it is weird. This is just code to reproduce the behavior, not code I want to use.
class Program
{
static void Main(string[] args)
{
try
{
Activator.CreateInstance(typeof(Func<int>), new object[] { new object(), IntPtr.Zero });
...
I know that if I have a block of code I don't want compiled when in release mode I can wrap that code block in:
#if DEBUG
while(true)
{ Console.WriteLine("StackOverflow rules"); }
#endif
This will keep this code block from compiling in any mode other than DEBUG.
I know there is an attribute that can be placed on an entire method t...
I'm trying to deploy ASP.NET MVC 2 project (VS2010) to Win Server 2008 R2
It works perfectly on dev machine. But strange error occurs at Server 2008 R2:
When .ascx file has header that uses generic type:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>" %>
Server reports Could not ...
Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed?
Or in other words does the .Net Framwork 4.0 Installer include the .Net Framework 3.5?
...
Hi
Our company uses some third party vendors to write some of our external facing web sites, however with one vendor we keep experiencing over inflated charges for simple changes and it has been decided to bring the product in-house.
I have been tasked to provide a list of deliverables/checkpoints that would form a part of the agreeme...
I have a Dictionary<string,int> and I simply want to decrement the value in my dictionary by one.
I have this but not sure if its best practice.
foreach (KeyValuePair<string, int> i in EPCs)
{
EPCs[i.Key] = i.Value - 1;
}
UPDATE: The reason I am trying to decrement the value is becase the value is a index number relating to a posi...
I have a third party library installed, but the accompanying namespace isn't found.
The type or namespace name 'Maverick' could not be found (are you missing a using directive or an assembly reference?)
Fair enough, VS 2010 can't find it. But where does my system look for third party libraries? Can I modify the list of locations?
...
This must be a dumb question, but I cannot figure it out. I also cannot use the designer because coders before me managed to throw GUI and logic all in one, so now it is confused. I've got to do it the old school way.
I have a Form which can be closed in 3 ways: Close button, File / Close menu, and the X icon. I want them all to do the ...
Is there an API in .NET (C#) for using USB HID (Human Interface) devices?
...
I'm having this issue with a live app.
(Unfortunately this is post-mortem debugging - I only have this stack trace. I've never seen this personally, nor am I able to reproduce).
I get this Exception:
message=Cannot access a disposed object.
Object name: 'Button'.
exceptionMessage=Cannot access a disposed object.
Object name: 'Button'....
I understand the need for a function like DB_Get_Cached("sql string") that hashes the SQL in order to perform a lookup in memcached for the existence of the data.
function DB_Get_Cached(string SQL)
data = memcache_get_data(md5(SQL))
if (!data)
return DB_Get(SQL)
end if
end function
What is a good method to expand this to handle ...
Hi,
I'm parsing the App.config file of a project. This config file has been loaded from a caller project. Inside the called project, I have something like:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("app.config");
// Some parsing...
Unfortunately the app.config file is not correctly located. Apparently the Load meth...