@alper Thanks, for pointing this out. I did not think of that. But even with this 'fix' it still does not work. Could you confirm this is an issue in the 2.7.0 ?
After upgrading form version 2.3 to 2.7, we encounter a problem in the BundleContributer. The below code worked with 2.3 but does not work with 2.7. Goal is to delete the jquery from the global script bundle and add it ourselves at the top of the page.
// delete jquery from the standard global scripts (will be added later by the Telerik Layout hook at the top of the page)
Configure<AbpBundlingOptions>(options =>
{
options
.ScriptBundles
.Configure(StandardBundles.Scripts.Global, bundle => {
bundle.AddContributors(typeof(Support.RemoveJqueryScriptContributor));
});
});
// Adds Telerik javascripts at the top of the page
Configure<AbpLayoutHookOptions>(options =>
{
options.Add(
LayoutHooks.Body.First,
typeof(TelerikControlsScriptsLayoutHook)
);
});
Implementation of the RemoveJqueryScriptContributor
public class RemoveJqueryScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.RemoveAll(x => x.StartsWith("/libs/jquery/jquery.js", StringComparison.InvariantCultureIgnoreCase));
}
}
In the actual page the the jquery is included (once at the top and once at the bottom). Setting a breakpoint on the RemoveAll however shows the jquery is removed from the context.Files. I would expect only one instance of jquery at the top of the page. Any ideas ?
Solved the issue. I created the database using the Package Manager Console. This however, does not seed the database. This was cuasing the null ref exception when starting the application.
Do not use PMC and always use the DbMigrator because that project also seeds the database.
My suggestion would be to remove the PMC method from the documentation.