Why are C# 4 optional parameters defined on interface not enforced on implementing class?

I noticed that with the optional parameters in C# 4 if you specify an optional parameter on an interface you don,t have to make that parameter optional on any implementing class: public interface MyInterface { void TestMethod(bool flag = false); } public class MyClass : MyInterface { public void TestMethod(bool flag) { Console.WriteLine(flag); } } … Read more

What is the difference between task and thread?

In C# 4.0, we have Task in the System.Threading.Tasks namespace. What is the true difference between Thread and Task. I did some sample program(help taken from MSDN) for my own sake of learning with Parallel.Invoke Parallel.For Parallel.ForEach but have many doubts as the idea is not so clear. I have initially searched in Stackoverflow for … Read more

Interop type cannot be embedded

I am creating a web application on the .NET 4.0 framework (beta2) in C#. When I try to use a assembly called “ActiveHomeScriptLib”, I get the following error: Interop type ‘ActiveHomeScriptLib.ActiveHomeClass’ cannot be embedded. Use the applicable interface instead. When I change the framework to version 3.5, I don’t have any errors. What is an … Read more