Getting 'base type is not CLS-compliant' warnings

Apr 24, 2011 at 9:44 PM

I have a project into which I installed Caliburm.Micro package (using NuGet).

However, any class that's derived from a Caliburn class (e.g. Conductor, Screen, Bootstrapper, etc.) generates a compile warning of '<zzz>: base type 'Caliburn.Micro.<xxx>' is not CLS-compliant

(where zzz is my class and xxx is the Caliburn class being inherited).

Any ideas as to why this is happening?

Tx,

Apr 24, 2011 at 9:52 PM

Just a followup; I've attempted to use the MEF variant of bootstrapping (.e.g bootstrapper<IShell> type code).

During runtime, I get an exception in the GetInstance function, saying it could not locate any instances of the contract for MyApp.IShell.

So somehow, the non-CLS-compliant warnings are a symptom of a larger issue involving MEF, yet I have no idea what is going wrong.

Help???

Coordinator
Apr 24, 2011 at 11:31 PM

I'm not sure these things are related. For starters, please insure that your ShellViewModel has an Export attribute on it so that it is exported as IShell.

Apr 25, 2011 at 10:52 PM
EisenbergEffect wrote:

I'm not sure these things are related. For starters, please insure that your ShellViewModel has an Export attribute on it so that it is exported as IShell.

Yup, I have that. Tx.

Coordinator
Apr 25, 2011 at 11:31 PM

Is it fixed now? If not, can you send it to me? You can send it to robertheisenberg at hotmail dot com

Apr 26, 2011 at 9:19 PM
EisenbergEffect wrote:

Is it fixed now? If not, can you send it to me? You can send it to robertheisenberg at hotmail dot com

No, problem persists.  It's very strange.  If I restart VStudio and rebuild, warnings go a way for a bit.  Then come back on a subsequent compile.

I'll email you the solution.

Tx.

Apr 27, 2011 at 2:33 AM

Rob,

You were right; the two issues are independent.  Turns out the MEF issue was due to me not exporting a required class.  Had to examine the MEF trace output to track that down.

However, the non CLS-compliant warnings are still an issue.  They appear on a build after a clean, or on the first build after a change to exports or imports.  Subsequent builds get rid of the warnings.

Perhaps this is a VS issue?

I sent you the code via email, in any case.

 

Thanks,