Activities of "rafael.gonzales"

  • ABP Framework version: v7.0.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:

[11:34:29 INF] Route matched with {page = "/SettingManagement/Index", area = "", action = "", controller = ""}. Executing page /SettingManagement/Index [11:34:29 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy [11:34:29 INF] Antiforgery token validation failed. The required antiforgery header value "RequestVerificationToken" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "RequestVerificationToken" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context) [11:34:29 INF] Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter'.

  • Steps to reproduce the issue:"

I deployed a dev version of my ABP project but whenever I try to enter to /SettingManagement in IIS, I get that exception but if I try to open it up while debugging, It works.

How can I solve it?

How can avoid that behavior? I want all the ignored files exist as a single <link rel="stylesheet"> and not be included in the bundled minificated version.

How is the bootstrap-light and bootstrap-dark (included in LeptonX Pro) excluded from minification and bundling? how can i approach something like this?

Also how can i change my own css from dark and light and being changed in the source code also as bootstrap-dark and bootstrap-light?

Thank you so much!

  • ABP Framework version: v7.0.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): No

Hi,

I wanted to add CSS and JS at the last of the tag but i want to exclude some of them from the minification.

What i did.

Created a ScriptContributor AND StyleContributer in DemoMinification.Web\Bundling

DemoScriptContributor.cs

[DependsOn(typeof(JQueryScriptContributor))]
public class DemoScriptContributor : BundleContributor
{
    public const string DemoScript= "/demo/js/init.js";
    public override void ConfigureBundle(BundleConfigurationContext context)
    {
        context.Files.AddIfNotContains(DemoScript);
    }
}


    public override void ConfigureBundle(BundleConfigurationContext context)
    {
        context.Files.AddIfNotContains(DemoScript);
    }
}

**DemoStyleContributor.cs **

    public class DemoStyleContributor : BundleContributor
    {
        public const string DemoStyle = "/demo/css/init.css";
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.AddIfNotContains(DemoStyle);
        }
    }

Created a ViewComponent and a Default.cshtml in DemoMinification.Web\Components\DemoJS

**DemoJsViewComponent **

   public class DemoJsViewComponent : AbpViewComponent
    {
        public IViewComponentResult Invoke()
        {
            return View("/Components/DemoJs/Default.cshtml");
        }
    }

Default.cshtml

@using DemoMinification.Web.Bundling
@*@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling*@

<abp-script type="typeof(DemoScriptContributor)" />

In DemoMinificationWebModule.cs, i added this method to add the CSS Bundle and to add a Hook for the ViewComponent which include the desired JS in the position we want and Populate the MinificationIgnoredFiles List to include those files i want to keep the same (not minified)

The problem is everything is minified and the IgnoredFiles added to the list are not IGNORED from the minification.

What can i do?

I attached a demo solution with the problem.

DemoMinificationWebModule.cs

private void ConfigureDemoBundle()
{
    Configure&lt;AbpBundlingOptions&gt;(options =>
    {
        options
            .StyleBundles
            .Get(StandardBundles.Styles.Global)
            .AddContributors(typeof(DemoStyleContributor));
    });

    Configure&lt;AbpLayoutHookOptions&gt;(options =>
    {
        options.Add(
            LayoutHooks.Head.Last,
            typeof(DemoJsViewComponent)
        );
    });

    Configure&lt;AbpBundlingOptions&gt;(options =>
    {
        options.MinificationIgnoredFiles.Add("/demo/css/init.css");
        options.MinificationIgnoredFiles.Add("/demo/js/init.js");
        options.Mode = BundlingMode.BundleAndMinify;
    });

}

I did have the same exact questions about version selector but i think it's good to have an option to choose just in case you need an older version.

The public website and the CMS Kit, it's kinda related so i guess. you should keep it both in your project even if you don't need it, you can just publish one of them. I faced the same issue when i was trying the Blazor Server Version.

I found the solution. I just answered the same question in another ticket. I will post it here too. It's because there are some missing <Version></Version> tags in the **Volo.Abp.Account.Pro **projects.

Steps to solve

  • Go to Volo.Abp.Account.Pro.Public.Web.csproj
  • Check if this is located in your project definition or add it if it's not there. ** <Version>6.0.2.0</Version>**
  • Recompile
  • Check if all the Volo.Abp.Account.Pro.XXXX projects have the tag <Version></Version> inside of it.

I had the same problem with the version 7.0.1.0. I found a workaround to solve this issue.

  • Go to Volo.Abp.Account.Pro.Public.Web.csproj
  • Check if this is located in your project definition or add it if it's not there. ** <Version>6.0.2.0</Version>**
  • Recompile

Check if all the Volo.Abp.Account.Pro.XXXX projects have the tag <Version></Version> inside of it.

I wanted to report this some weeks ago but i only few support count so i can't take a risk to report some bugs & solutions. I found 2 more related.

It seems to happen to Blazor but it works great with MVC (a note if you decide to switch to another UI)

Showing 111 to 117 of 117 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11