Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:21:26+00:00 2026-05-29T10:21:26+00:00

I created a small extension for the EF designer that adds a new property

  • 0

I created a small extension for the EF designer that adds a new property to the property window. I did this using a vsix project (new project -> c# -> extensibility -> vsix project). When I hit F5 the experimental VS instance starts up. I create a new project, add an entity data model and add an entity. However, my break points never get hit and I don’t see the property. Any ideas as to what I might be doing wrong?

public class AggregateRootValue
{
    internal static XName AggregateRootElementName = XName.Get("AggregateRoot", "http://efex");

    private readonly XElement _property;
    private readonly PropertyExtensionContext _context;

    public AggregateRootValue(XElement parent, PropertyExtensionContext context)
    {
        _property = parent;
        _context = context;
    }

    [DisplayName("Aggregate Root")]
    [Description("Determines if an entity is an Aggregate Root")]
    [Category("Extensions")]
    [DefaultValue(true)]
    public string AggregateRoot 
    {
        get 
        {
            XElement child = _property.Element(AggregateRootElementName);
            return (child == null) ? bool.TrueString : child.Value;
        }
        set 
        {
            using (EntityDesignerChangeScope scope = _context.CreateChangeScope("Set AggregateRoot"))
            {
                var element = _property.Element(AggregateRootElementName);
                if (element == null)
                    _property.Add(new XElement(AggregateRootElementName, value));
                else
                    element.SetValue(value);
                scope.Complete();
            }
        }
    }
}

[Export(typeof(IEntityDesignerExtendedProperty))]
[EntityDesignerExtendedProperty(EntityDesignerSelection.ConceptualModelEntityType)]
public class AggregateRootFactory : IEntityDesignerExtendedProperty
{
    public object CreateProperty(XElement element, PropertyExtensionContext context)
    {
        var edmXName = XName.Get("Key", "http://schemas.microsoft.com/ado/2008/09/edm");
        var keys = element.Parent.Element(edmXName).Elements().Select(e => e.Attribute("Name").Value);

        if (keys.Contains(element.Attribute("Name").Value))
            return new AggregateRootValue(element, context);

        return null;
    }
}

EDIT: I put the code on Github: https://github.com/devlife/Sandbox

EDIT: After Adding the MEF component to the manifest as suggested, the extension still never loads. Here is a picture of the manifest:

VSIX Manifest

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:21:27+00:00Added an answer on May 29, 2026 at 10:21 am

    So the answer, as it turns out, is in how I setup my project. I put both classes inside the project which produces the VSIX file. By simply moving those classes into another project and setting that project as the MEF Component in the manifest (and thus copying the assembly) it worked like a charm!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a small flash CS4 project that has a few custom components
I've created a small python script to toggle between two files I'm using for
I have created a small parser in c using flex and bison. The parser
I'm new to extension development, maybe someone has a small example ready for my
I created a small function that simply writes text to a file, but I
I'm new to WPF, and created a 1st simplistic WPF application that I want
I have created a small daemon (basically a console application that hides the console
We wrote a small Windows class library that implements extension methods for some standard
I've created small database under SQL Server 2008 . Now i wanted to move
I created a small WPF desktop application. I am thinking about how to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.