I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new CompositionContainer(catalog.CreateResolver());
This var is available on C# 3.0 where as I am coding in C# 2.0.
What is the alternative of above two statements? How can I make them work in c# 2.0 using VS 2005?
i tried this bt its saying now
Error 1 The type or namespace name ‘AttributedAssemblyPartCatalog’ could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\test\Desktop\MEFDemo\MEFDemo\Program.cs 31 13 MEFDemo
where as i have added referance to SystemComponentModel.Composition
This is the use of type inference in C# 3.0.
When using the keyword
in c# 3.0 the compiler infers the type. See scott guthries explanation
In c# 2.0 you have to declare the type of the variable the same as c# 1.1
e.g.
Making you above code example
HTH