.net-4.0

WPF ListBox/View Data Binding weird result

I have this problem when i try to synchronize a observable list with listbox/view it displays the first item X times (x total amount of records in the list) but it doesn't change the variable's here is the XAML <ListBox x:Name="PostListView" BorderThickness="0" MinHeight="300" Background="{x:N...

Strange thing about .NET 4.0 filesystem enumeration functionality

I just read a page of "Whats new .NET Framework 4.0". I have trouble understanding the last paragraph: To remove open handles on enumerated directories or files Create a custom method (or function in Visual Basic) to contain your enumeration code. Apply the MethodImplAttribute attribute with the NoInlining option to the...

404.2 Error after installing .net 4.0

I have a project which I have upgraded to .Net 4.0, but when I try to access it, I retrieve the following error: HTTP Error 404.2 - Not Found The page you requested could not be displayed because of the settings for the list of ISAPI and CGI restrictions on web server. ErrorCode: 0x800704ec Handler PageHandlerFactory-ISAPI-4.0_32bit D...

Date format broken in .net 4.0 for uk format

I'm in the process of converting a couple of sites up to .net 4.0 and I seem to have a problem with regionalisaion of dates. This code: Date.Today.AddDays((Date.Today.DayOfWeek - 1) * -1).ToString() In .net 3.5 produces: '19/04/2010 00:00:00' but as soon as I change the app pool to 4.0 it produces: '4/19/2010 12:00:00 AM' Where can...

.NET Framework 4.0 and drawing on Aero Glass issue

In my application I have a form which I tweak by using the DWM API's method DwmExtendFrameIntoClientArea to extend the height of the Aero Glass Title Bar so that part of my form client area is drawn on the Aero frame. To achieve this effect, I also draw a black rectangle on the part of the client area which is 'over' the glass frame so t...

How do I use "Into" LINQ expression in VB.NET?

I'm converting from C# this LINQ expression. However, it does not seem to work. C# return (from w in fishSticks group w by w.FishQty into g orderby g.Key descending select g).First().First(); VB Return (From w In fishSticks Group w By w.FishQty Into g() Order By g.Key Descending Se...

Upgrading App from .NET 3.5 to 4.0, COM fails now

Hello, I have an application that I am upgrading from the .NET 3.5 to the .NET 4.0 framework. It uses a COM library which is referenced. It works no problem in 3.5 but after converting to 4.0 I have issues getting the COM to work. The COM is from a 3rd party so we didn't develop it ourselves. I get the following COM error (generic COM ...

Upgrade to 4.0 Framework, then downgraded, now can't find Linq namespace?

I just upgraded from VS2008 to VS2010. In the process, I allowed it to upgrade my DLL's to 4.0. I've decided that wasn't a good idea and now I've rolled back. It all works fine in VS2010, but when it hits my CI server (CruiseControl.Net), I get an error of: The type or namespace name 'Linq' does not exist in the namespace 'System' (a...

What version of the .NET framework ahould I target?

I'm a desktop C# developer (that is not ASP) and am wondering about version targeting for small personal projects. These are, of course, trying to reach as wide an audience as possible, and so I've been targeting .NET 3.0 (which is the latest version on a Windows Vista system without any service packs) and 2.0 (which is simply the most ...

Does Linq to SQL or Linq to Entities 4.0 support the hierarchyid datatype

Is their a way to use linq to SQL/Entities 4.0 to work with the hierarchy datatype? ...

.Net 4.0, New methods in existing classes

Is there a blog or MSDN article, which lists all the new methods which are added in .Net 4.0 in existing classes? I could not find any. Two which I found on blogs till now: String.IsNullOrWhiteSpace Enum.HasFlag Are there more such methods added which anybody found? If yes, please share. ...

WCF with 3.5 and 4.0 together

Has anyone managed to run wcf successfully in 2.0 integrated mode on IIS7 when .net 4 has been installed? I found that installing .net 4 removed the 2.0 handlers for svc and replaced them with .net 4 versions (this led to a 404.17 error in my v3.5 site), I managed to get my 3.5 site working again by running ServiceModelReg.exe /i from ...

Installing .net 4 project on target server - Error System.BadImageFormatException

I have installed the .net 4 framework on one of my servers. When I run an installation project created in Visual Studio - get the following error: Error 1001 Exception occurred while initializing the installation. System.BadImageFormatException: Could not load file or assembly or one of its dependencies. This assembly is bu...

A .Net4 Gem: The ConcurrentDictionary - Tips & Tricks

Hi guys, I started to use the new ConcurrentDictionary from .Net4 yesterday to implement a simple caching for a threading project. But I'm wondering what I have to take care of/be careful about when using it? What have been your experiences using it? ...

Can I use a TFS 2008 Build Server with .NET 4.0? With VS 2010?

I am thinkin about building my first TFS 2008 Build Server. However, I would like to use it with VS 2010 solutions targeting both .NET 3.5 and 4.0. Will this work and what should I watch out for? ...

What is the scope of StaticResource within a WPF ResourceDictionary?

I have a WPF ResourceDictionary with the following TextBlock: <TextBlock Visibility="{Binding Converter={StaticResource MyBoolProp ResourceKey=BoolToVis}}"> </TextBlock> The ResourceDictionary is included in App.xaml under MergedDictionaries: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionar...

CodeContracts: Possibly calling a method on a null reference

I'm having an argument with the CodeContracts static analysis tool. My code: (ASCII version) The tool tells me that instance.bar may be a null reference. I believe the opposite. Who is right? How can I prove it wrong? ...

can I use .NET Framework 4.0 with VS2008 ?

hello , can I use .net framework 4.0 in VS2008 ? If yes how can I do that? My application uses 2.0 ,Or are there advantages to updating to the latest .NET 4.0 now? And also I came across some new features in framework 4.0 like : Response.RiderectPermanent Response.RiderectToRoute Response.RiderectToRoutePermanent ...

Windows Process Activation Service on Windows Server 2008 R2

Hi, Are there any limitations based on Windows Server 2008 R2 versions for Windows Process Activation Service? (i.e. some features of WAS are unavailable, limitations on number of worker processes, etc.) Thanks a lot! ...

Texture2D.Bounds.Intersect, but the Bounds never move? - XNA, .Net 4.0

Hi all, I am still shiny new to XNA, so please forgive any stupid question and statements in this post (The added issue is that I am using Visual Studio 2010 with .Net 4.0 which also means very few examples exist out on the web - well, none that I could find easily): I have two 2D objects in a "game" that I am using to learn more about ...