voonna
voonna

Reputation: 811

Activation error occured while trying to get instance of type

i have a bunch of view which are associated to the viewmodels and getting hte similar error for all the views and viewmodels. here is the code:

I have the following code:

    public static IReportViewModel GetViewModel(Type view)
    {
        try
        {
            return s_Locator.GetInstance(view, view.FullName) as IReportViewModel; <!-- I get the exception here-->
        }
        catch (Exception e)
        {
            MessageBox.Show(e.Message);
        }             
    }

The complete exception is here:

Activation error occured while trying to get instance of type AnnotetedReportViewModel, key "InsurableRisk.Reporting.ViewModels.Application.AnnotetedReportViewModel"

Can anyone explain or suggest what could have caused the exception?

Regards, Sagar

Upvotes: 0

Views: 2419

Answers (1)

joezen777
joezen777

Reputation: 446

Is the spelling correct? I noticed that Annotated is spelled AnnotetedReportViewModel. Also, is the assembly loaded into the project or does it exist in the bin folder?

Upvotes: 1

Related Questions