How would you implement a cache class that supports timeouts using the new Concurrent Collections of .Net 4?
The cache class will be typically holding hundreds of thousands of entries. A very large part of the cache may expire simultaneously.
Unlike a typical web cache, which may shrink due to memory pressure, this class should only a...
With that I mean similar to the Linq join, group, distinct, etc. only working on sequences of values, not collections.
The difference between a sequence and a collection is that a sequence might be infinite in length, whereas a collection is finite.
Let me give you an example:
var c1 = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var c2 =...
Hello. I am connecting to a Microsoft Active Directory server in a DMZ from my .net application (asp.net VB .net 4.0). I need to create a new "inetorgperson" in an orgunit called "SingleCustomerAccount".
I have had to use the System.DirectoryServices.Protocols namespace for all the work, because the ADSI classes (System.DirectoryServic...
Entity framework maps DB types to .NET types, for instance SQL Server's BigInt is mapped to .NET's long.
Is it possible to create a new type and have a store type (such as BigInt or VarChar) mapped to it? If so, how?
FYI, my goal is to change the way the .NET scalar writes its value to the query, and specifically the way its default v...
I newly converted my solution to .NET Framework 4.0
After it I got very wired error. Each first load after building my app I get filenotfound exception. here it is:
Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the fi...
I'm trying to deploy a desktop application written on WPF 4.0 that uses SQLite through Entity Framework. So i've changed .config file (absolute path to db -> relative) and copied database file itself to app's directory. It seems to be working fine, but on other PC it's throwing an error during runtime. Supplying System.Data.SQLite.dll an...
Let's say I have a method public void Foo(string bar) that the caller should not call with a null value of bar. Let's say I also have a method, call it private void FooImpl(string bar), that does the actual work of Foo. It's, of course, FooImpl that really requires non-nullness of bar, even though Foo is the public interface. And lets sa...
I have a route defined last in my ASP.Net MVC 2 app that will map old urls that are no longer used to the appropriate new urls to be redirected to. This route returns the action and controller that is responsible for actually performing the redirect and it also returns a url to the controller action which is the url to redirect to. Since...
Hello,
I've encountered a strange problem. I've installed "Visual Studio 2010 ultimate". While installing it showed that it sucessfully installed .NET 4.0. While installing some other softwares. They complain that .NET 2.0 is missing and asking me to install it.
How is it possible? .NET 4.0 must include .NET 2.0 right?
EDIT:
Now, I'm...
Hi,
can someone confirm that microsoft changed path length related behaviour of some classe from System.IO in .NET 4.0? For example the code below runs fine on .NET 3.5 but on 4.0 throws a PathTooLongException for me.
const string prefix = "C:\\";
const string suffix = ".txt";
var sb = new StringBuilder();
sb.Append(prefix);
for (var ...
Hi All,
Some quick details:
I'm running ASP.NET 4.0.30319.0 on IIS6. I've been hosting a website that contains a ReportViewer for quite some time now (~3 years). In April, I upgraded to the 4.0 runtime, and things ran smoothly for a couple of months.
Now, I'm suddenly starting to see quite a Session Timeout exceptions occur on the pag...
I'm trying to use this sample code from Microsoft to determine what encoder options are available for the JPEG encoder. (The real problem I'm trying to solve is to see if I can set the Chroma subsampling parameters explicitly)
http://msdn.microsoft.com/en-us/library/bb882589.aspx
private void GetSupportedParameters(PaintEventArgs e)
{
...
I have a NativeActivity derived activity that I wrote that is to use bookmarks as a trigger for a pick branch. Using something I found on MSDN I tried writing this to trigger the branch. The branch contains activities that fire service callbacks to remote clients via send activities. If I set a delay for the trigger, callbacks fire to th...
Hi Everyone,
I've been working on an ASP.NET MVC 2 (.NET 4.0, Visual Studio 2010) application for a while and have decided that I would like to deploy it as an Azure application.
After installing the latest (June 2010) Azure tools (through Visual Studio itself) I've added a blank CloudService to my solution. Whenever I try to add a "We...
I have a WPF Datagrid (.NET 4.0) with a list of viewmodel bind to ItemsSource.
The viewmodel exposes the model entity that is builded from a base ancestor class that implements IEditableObject interface.
Every time I edit a cell of a datagrid row the beginedit method of entity is called; I would a different behaviour: call the BeginEdi...
Hello.
I have a server/client application developed in Delphi 2006. The client is Win32 and the Server is a .net 1.1 webservice.
We are in the process of updateing this project, but it has to be done in small steps. I started with the server and created a WCF project in VS2010(C# .net 4.0). The first step is to get the server running i...
I have compared the performance of system.runtime.caching in .NET 4.0 and the Enterprise Library Caching Block and to my surprise it performs terribly in comparison when fetching large data collections from cache items.
Enterprise Library fetches 100 objects in about 0,15ms, 10000 objects in about 0,25ms. This is fast, and natural for a...
Is there T4 templates available for generating c# classes from xsd?
...
Hey all,
I'm, currently working my first project in .NET 4.0 and it requires several thousand string comparisons (I'm searching directories and sometimes entire drives for certain files). For the most part, the strings are quite short because I'm only looking at file paths so I have just made use of String.Contains() to see if the file...
I'm having a problem where my main application window keeps the focus after a non-modal window is initiated from it. It seems at first glance that it might be the hollow windows issue with WPF (we use transparent backgrounds), but the window doesn't even have focus at all (this.IsFocused STAYS false).
As soon as you click on the window...