.net

Could I return a FileStream as a generic interface to a file?

I'm writing a class interface that needs to return references to binary files. Typically I would provide a reference to a file as a file path. However, I'm considering storing some of the files (such as a small thumbnail) in a database directly rather then on a file system. In this case I don't want to add the extra step of reading the t...

Where should I store my application data?

I have an application that needs to store data. Currently, I am using the built-in Application Settings to do it, but it only gives me two choices: application and user scopes. Ideally, I want a "local" scope that allows the application to run under another user and still find its data rather than recreate it for that user. The applic...

Why should my small .NET development company upgrade to from Team Foundation Server 2008 to 2010?

The company for which I work has an MSDN license and upgrading to TFS 2010 from 2008 is not an expensive option. However, neither my colleagues or me have been able to find any features that make this something we feel we need. Is anyone experienced with TFS 2010 enough to convince me that my company needs this? To clarify: we have n...

Robust Large File Transfer with WCF

I want to transfer big files (1GB) over unreliable transport channels. When connection is interrupted, I don't want start file transfering from the begining. I can partially store it in a temp table and store last readed position, so when connection is reestablished I can request continue uploading of file from this position. Is there a...

What is the definition of a UI thread? Is there only one UI thread in a .NET application?

What is a UI thread? Is there only one UI thread in a .NET application? ...

End of Page Detection using TWAIN

I am coding a scanning application and I need to have end of page detection so I don't scan past where the document ends, does anyone what settings to use to turn this feature on for TWAIN drivers? code samples in vb.net or C# would be great :) ...

Active Directoy LDAP - Lock User Account

What is the prefered way to lock an Active Directory account? int val = (int)directoryentry.Properties["userAccountControl"].Value; directoryentry.Properties["userAccountControl"].Value = val | 0x0010; vs. directoryentry.InvokeSet("IsAccountLocked", true); Is there a better way? ...

Serialize into an XML Fragment - not XML Document

How do I serialize an XML-serializable object to an XML fragment (no XML declaration nor namespace references in the root element)? ...

.NET framework execution aborted while executing CLR stored procedure?

I constructed a stored procedure that does the equivalent of FOR XML AUTO in SQL Server 2008. Now that I'm testing it, it gives me a really unhelpful error message. What does this error mean? Msg 10329, Level 16, State 49, Procedure ForXML, Line 0 .NET Framework execution was aborted. System.Threading.ThreadAbortException: Thread was...

What open source document-oriented database system is most mature for Windows usage?

After using relational databases as back-end storage all my Windows programming life (currently .NET), I want to experiment with a document-oriented database by this Wikipedia definition; it can be standalone or layered over an existing non-commercial database system. What open source document-oriented database solution would you recomm...

Does HttpWebRequest automatically take care of certificate validation?

I'm using an HttpWebRequest object to access a web service via an HTTP POST. Part of the requirement is that I: Verify that the URL in the certificate matches the URL I'm posting to Verify that the certificate is valid and trusted Verify that the certificate has not expired Does HttpWebRequest automatically handle that for me? I'd as...

How to Zip one IEnumerable with itself

I am implementing some math algorithms based on lists of points, like Distance, Area, Centroid, etc. Just like in this post: http://stackoverflow.com/questions/2227828/find-the-distance-required-to-navigate-a-list-of-points-using-linq That post describes how to calculate the total distance of a sequence of points (taken in order) by es...

XNA.Texture2D to System.Drawing.Bitmap

I need load XNA.Texture2D to PictureBox. i've tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 but it doesn't work. Any suggestions? ...

How to Return A File and a strongly Typed data at the same time?

Hi I am using asp.net mvc 1.0 and I want to return a XML file but I also want to return a strongly typed data back so I can update some fields. Like the XML file will contain users who failed to be inserted into the database. So I want that to appear as a dialog save box what asp.net mvc return file() would do. However I also want to ...

Are there any major problems with using .NET One-Click deployment?

I'm deploying an app to an unknown number of clients. It'll be 5-10 to start, couple dozen eventually. I'm thinking of making a different web folder for each client, so I can control updates and roll them out in a gradual manner. Are there any major known issues with One-Click deployment? Am I going to commit suicide shortly after go...

Request for the permission of type 'System.Web.AspNetHostingPermission' failed when compiling web site on a Network Share or Intranet Project

I have been using Windows 7 for a while but have not had to work with a particular legacy intranet application since my upgrade. Unfortunately, this application is setup as an ASP.NET Website project hosted on an intranet server. When I have the website open in Visual Studio 2008 and try to debug it, I receive the following compiler erro...

Is there a public implemention of LZSS compression in C# or that can be used in C#?

I'm looking for LZSS for decoding some packets from a game engine. If anyone could point me to a library I would be extremely happy. Thanks! ...

How to encode custom HTTP headers in C#

Is there a class similar to HttpUtility to encode the content of a custom header? Ideally I would like to keep the content readable. ...

Memory leak with WPF & ItemsControl (VB.NET)

I have an ItemsControl that uses a DataTemplate to display properties in my customClass that implements INotifyPropertyChanged... Pretty straightforward... Some items in the DataTemplate use CommandBindings (such as buttons), and a few have some code-behind (yuck). When I empty the ItemsControl and set all instances of customClass =...

How to bundle extension methods requiring configuration in a library

Hi, I would like to develop a library that I can re-use to add various methods involved in navigating/searching through a graph (nodes/relationships, or if you like vertexs/edges). The generic requirements would be: There are existing classes in the main project that already implement the equivalent of the graph class (which contains...