[SOLVED] error generating migration.cs on new module/content part

Topics: Customizing Orchard, Writing modules
Dec 11, 2011 at 3:45 PM

I'm following a couple guides on creating my own module:

http://docs.orchardproject.net/Documentation/Creating-a-module-with-a-simple-text-editor

http://docs.orchardproject.net/Documentation/Writing-a-content-part

I'm getting to the point were I have the following:

using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;

namespace PicasaGallery.Models
{
    class PicasaGalleryRecord : ContentPartRecord
    {
        public virtual int Width { get; set; }
        public virtual int Height { get; set; }
        public virtual string FeedUrl { get; set; }
    }

    class PicasaGalleryPart : ContentPart<PicasaGalleryRecord>
    {
        [Required]
        public int Width
        {
            get { return Record.Width; }
            set { Record.Width = value; }
        }

        [Required]
        public int Height
        {
            get { return Record.Height; }
            set { Record.Height = value; }
        }

        [Required]
        public string FeedUrl
        {
            get { return Record.FeedUrl; }
            set { Record.FeedUrl = value; }
        }
    }
}

and now I want to generate the migration.cs but when I do I get the following error:

"Creating Data Migration for PicasaGallery
An unexpected error occured while trying to refresh the Visual Studio solution.
Please reload it.
Data migration created successfully in Module PicasaGallery"

when I unload and reload the project I see the file but it's missing data I would expect:

using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;

namespace PicasaGallery {
    public class Migrations : DataMigrationImpl {

        public int Create() {


            return 1;
        }
    }
}

I am using source control (TFS) but the project file is checked out.  I've tried generating without vs 2010 open and the result is the same.

 

Any ideas?

Dec 11, 2011 at 3:51 PM

[SOLVED] the issue was that the classes in the Models folder were not public....

 

Still getting the "unable to reload project" but the code is showing up: