Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Angelo 111 posts 260 karma points
    May 11, 2022 @ 15:46
    Angelo
    0

    VIew compoent outside main umbraco project

    Hi there :) ... Any one knows how to create a view outside the main umbraco project that works like an external component or package ?

    i tried this in the startup class inside configure services ... but it never finds the default.cshtml view ! :( ... (the view in the compoent project is already as embeded resource )

    services.AddMvc();
    var assembly = typeof(MyViewComponent).GetTypeInfo().Assembly;
    
    var embeddedFileProvider = new EmbeddedFileProvider(
                assembly,
                    "My.ViewComponents"
                );
    
                services.Configure<MvcRazorRuntimeCompilationOptions>(options =>
                {
                    options.FileProviders.Add(embeddedFileProvider);
                }); 
    

    One thing that i would like to acheive also its to create all the startup parameters inside the IComposer class to avoid any kind of configuration for the user of the package/component

    thank you :)

    Angelo

Please Sign in or register to post replies

Write your reply to:

Draft