Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Saturday, February 12, 2011

The type or namespace '' does not exist in the class or namespace '' (are you missing an assembly reference?)

There are a number of reasons when one gets the error from the title. Searching the web for this error, there are a lot articles where some solutions are provided.
This morning I also got this error but none of the solutions that I've found were the right one.
It looks like one of the projects that my main application was referring, was build on .NET 4.0 and the main application was build on .NET 4.0 client profile. Setting both projects to use the same framework, fixed the issue.

Thursday, September 17, 2009

Optional keyword in C#

Hi there...

Wouldn't be nice if C# had a optional keyword for the methods/properties in an interface?

interface IMyInterface
{
optional void OptionalMethod();

void NotOptionalMethod();
}

public class MyClass1 : IMyInterface
{
public void NotOptionalMethod()
{
//implement the method...
}
}

public class MyClass2 : IMyInterface
{
public void NotOptionalMethod()
{
//implement the method...
}

public void OptionalMethod()
{
//implement the method...
}
}
I’ve created a thread where you can comment on this.