Tuesday 29 January 2008

Type conflicts with the imported type

Partial classes were introduced in .NET 2.0 enabling you to create classes spread over several source code files. What’s not immediately clear is that you only do this with source code files. You cannot add to a partial class that’s already built in a distinct assembly. If you try to do this, you’ll get something similar to the following error:

The type 'namespace.class' in 'C:\MyFolder\Class1.cs' conflicts with the imported type 'namespace.class' in 'assemblyfilename.dll'.

No comments: