.net-4.0

Can .NET 4.0 code interoperate with .NET 2.0 code?

Are there compatibility barriers with a .NET 4.0 assembly calling code in a .NET 2.0 assembly? And vice versa? More specifically, I'm investigating an upgrade to Visual Studio 2010 when using a third party application based on .NET 2.0. The application is extensible by hooks that reference my custom code. And vice versa, my code will...

SQLite NHibernate configuration with .Net 4.0 and vs 2010

UPDATE In the last update I could use SQLite for unit testing but not in an application run. That problem has now been resolved by modifying config to allow [loading from a remote assembly](http://msdn.microsoft.com/en-us/library/dd409252(VS.100.aspx) <runtime> <loadFromRemoteSources enabled="true"/> </runtime> in addition to ena...

.Net 4.0, named and optional parameters, and WCF

so .Net 4 added named and optional params which are pretty sweet..I don't need to make as many 1 line overload methods. Will that work over WCF? ...

Simple Windows.Forms binding is failing using framework 4.0.

This works under the .net framework 3.5 client. This fails under the .net framework 4.0 client. Was I doing something that was illegal under 3.5 but just happened to work, or is this a bug? Note that in my project 'PropInt' does not raise change events so using ctx[obj1.PropObj2, "PropInt"] is not an option. public class Obj1 { ...

How come .net 4.0 and .net 2.0 CLR's can exist in a same machine

I have a basic doubt that, How can we have both CLR's on a same machine. If this is possible, When I refer few dll's of 4.0 and setting application pool to 2.0 why Cant I run the website(I am getting errors).When we refer the dll's from web.config it means it searches for GAC when that particular 4.0 dll is available in GAC Why dont it l...

How to define using statements in web.config?

I'm using MySql in my asp.net project. But I don't want to type every "using MySql.Data.MySqlClient;" statement in every aspx.cs/aspx.vb file. How can I define this lines in web.config file? I've defined some namespaces like below but this only works for aspx pages: <?xml version="1.0"?> <configuration> <system.web> <compil...

What happens when .NET 4.0 references a .NET 2.0 assembly?

What exactly does the .NET 4.0 runtime do if a .NET 4.0 executable contains a reference to a .NET 2.0 assembly? Is the .NET 2.0 assembly run with the .NET 4.0 runtime (in other words, .NET 4.0 must be 100% API-compatible to .NET 2.0) or does the process somehow host the .NET 2.0 runtime and some magic happens to make the .NET 2.0 types ...

Can't get the new 2009 XAML primitives working, why?

What I'd like to use: 2009 XAML primitives How it would be nice to use them: <sapv:ExpressionTextBox xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ExpressionType="x:String" /> What actually happens: "Type reference cannot find the public type named String" The examples I see don't have updated namespaces. I ...

NUnit-console 2.5.4 not capable of running multiple assemblies?

I am having problems running tests with the command line NUnit test runner. I am using version 2.5.4 with .NET 4 on an x64 machine. Using the following line results in a failure "Could not load file or assembly 'bar' or one of its dependencies. The system cannot find the file specified." nunit-console-x86 foo.dll bar.dll /framework=4....

Why does mage not generate a compatibleFrameworks attribute

We are using mage to generate our applications manifests as part of our build process. Upon upgrading to .Net 4 we now find it generates an invalid manifest. The reason is there is no compatibleFrameworks attribute being set in the application manifest which we generate every build. Is there anyway we can make Mage add this element of ...

C# 4.0 .net 4 and WPF UI update

Hello , I'm trying to build an app to work with twitter like site , and the problem I'm trying to solve is - How am i going to update the UI with a background worker and only add show the latest posts(tweets if you will ) on top of the wrap panel without removing the ones that already exist? in my previous attempt i have done this b...

Multilingual spellcheck on WPF richtextbox

I need to turn spellcheck on for a richtextbox, and set the language to one the user has picked from a drop down. For now, I'm just testing it by building the richtextbox in xaml and providing a language to the xaml language attribute. I've read two different resources and one says I need to set the language attribute, and the other ...

What NEW features has WCF in .NET Framework 4 vs .NET Framework 3.5?

What NEW features has WCF in .NET Framework 4 vs .NET Framework 3.5? What Is new, what was fixed (in general - I do not want to get into bug fixed numbers=)? ...

WCF is throwing UnauthorizedAccessExceptyion after upgrade to .NET 4.0

I have a pretty simple client-server ASP.NET app; communication is via WCF service. All worked perferctly inVS 2008, now I upgraded to VS2010 and every time the client code is trying to instantiate a channel to the server: new ChannelFactory<IMemberService>("Members.MemberService").CreateChannel(); it throws an UnauthorizedAccessExcep...

.NET 4 RTM MetadataType attribute ignored when using Validator

I am using VS 2010 RTM and trying to perform some basic validation on a simple type using MetadataTypeAttribute. When I put the validation attribute on the main class, everything works. However, when I put it on the metadata class, it seems to be ignored. I must be missing something trivial, but I've been stuck on this for a while now. ...

[OutputCache] for a function in .net 4

Hi, I read at Scottgu blog about using OutputCache for a function but this didn't worked for me. How can I use [OutputCache(Duration=60)] for a function and can I add VaryByParam in this statement? Which namespace is required? ...

Entity Framework Complex Type vs Creating new Entity

Hi, I'm reading about the Entity Framework 4.0 and I was wondering why should I create a complex type and not a new Entity (Table) and a relation between them? Thanks, Ronny ...

Why does trying to unit test with two .NET 4.0 assemblies under NUnit 2.5.4 fail?

I have an MSBuild script that uses NUnit to run tests in two assemblies. These were on .NET Framework 3.5 and it worked perfectly for a long time. The command line was: (actual paths & names simplified) nunit-console tests1\bin\debug\tests1.dll tests2\bin\debug\tests2.dll I've upgraded to VS2010 and have now made the two test assembl...

.NET 4 Router: Can we filter binary incoming data from HTTP/TCP stream?

So I want to have have some service with url example.com:4773/routerService . I am gouing to have some wary simple client which will take some address and start streaming data to it, binary data like mp3 or pcm stream so no serialisation no special mesages just star streaming pure stream to URL. So my client will go to URL like examp...

.NET 4.0 has a new GAC, why?

%windir%\Microsoft.NET\assembly\ is the new GAC, does it mean now we have to manage two GACs, one for .NET 2.0-3.5 apps and the other for .NET 4.0 apps? The question is, why? ...