Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting build errors with new Option page model #279

Closed
ErikEJ opened this issue Jan 24, 2022 · 1 comment
Closed

Getting build errors with new Option page model #279

ErikEJ opened this issue Jan 24, 2022 · 1 comment

Comments

@ErikEJ
Copy link

ErikEJ commented Jan 24, 2022

I am trying to use this in an exsting extension, but getting build errors - what am I doing wrong?

CreatePkgDef : error : ArgumentException: The page class EFCorePowerTools.AdvancedOptions must derive from DialogPage.
   at Microsoft.VisualStudio.Shell.ProvideOptionDialogPageAttribute..ctor(Type pageType, String pageNameResourceId)
   at Microsoft.VisualStudio.Shell.ProvideOptionPageAttribute..ctor(Type pageType, String categoryName, String pageName, Int16 categoryResourceID, Int16 pageNameResourceID, Boolean supportsAutomation, String[] keywords)
   at Microsoft.VisualStudio.Shell.ProvideOptionPageAttribute..ctor(Type pageType, String categoryName, String pageName, Int16 categoryResourceID, Int16 pageNameResourceID, Boolean supportsAutomation)
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at Microsoft.VisualStudio.Tools.CreatePkgDef.ProcessAssembly(String fileName, Hive hive, PkgDefContext context, Boolean register, RegistrationMode mode)
   at Microsoft.VisualStudio.Tools.CreatePkgDef.DoCreatePkgDef(InputArguments inputArguments)
   at Microsoft.VisualStudio.Tools.CreatePkgDef.Main(String[] arguments)	EFCorePowerTools			
internal class OptionsProvider
    {
        [ComVisible(true)]
        public class AdvancedOptions : BaseOptionPage<EFCorePowerTools.AdvancedOptions> { }
    }

    public class AdvancedOptions : BaseOptionModel<AdvancedOptions>, IRatingConfig
    {

@ErikEJ
Copy link
Author

ErikEJ commented Jan 24, 2022

I had this:

    [ProvideOptionPage(typeof(AdvancedOptions), "EF Core Power Tools", "General", 100, 101, true)]
    [ProvideProfile(typeof(AdvancedOptions), "EF Core Power Tools", "General", 100, 101, true)]

Should have:

    [ProvideOptionPage(typeof(OptionsProvider.AdvancedOptions), "EF Core Power Tools", "General", 100, 101, true)]
    [ProvideProfile(typeof(OptionsProvider.AdvancedOptions), "EF Core Power Tools", "General", 100, 101, true)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant