Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...

AspDotNetStorefront
DotFeed

AdnsfBundler.RenderScriptBundle(string, string[])' is obsolete

I am having a bad time upgrading from version 9 to 10 with the guide at: https://help.aspdotnetstorefront.com/manual/1000/default.aspx?pageid=upgrading_a_skin_from_v9_to_v10

I am following it step by step but in the HEAD section I am getting the following code underlined in green:

	@* Bundle and minify jQuery. *@
	@AspDotNetStorefront.Optimization.AdnsfBundler.RenderScriptBundle(
	  bundlePath: "~/scripts/jquery",filePaths: new[]
	  {
		  "~/scripts/jquery.js",
		  "~/scripts/jquery.adnsfalias.js"
	  }
	)

	@* Bundle and minify CSS. *@
	@AspDotNetStorefront.Optimization.AdnsfBundler.RenderStyleBundle(
  bundlePath: Url.SkinUrl("css/bundled"),
  filePaths: new[]
  {
	  Url.AppRelativeSkinUrl("css/bootstrap.css"),
	  Url.AppRelativeSkinUrl("css/font-awesome.css"),
	  Url.AppRelativeSkinUrl("css/base.css"),
	  Url.AppRelativeSkinUrl("css/style.css"),
	  Url.AppRelativeSkinUrl("css/pams_custom.css"),
  }
)

When mouse over it I get the message:

AdnsfBundler.RenderScriptBundle(string, string[])' is obsolete: 'The AdnsfBundler class is obsolete. Use @Html.RenderScriptBundle() from Razor or IBundledResourceProvider.RenderScriptBundle from code.'

I have no idea what to do here...

Any clue, please?

asked Sep 26 in MultiStore by Yan Kleber (1,140 points)

1 Answer

0 votes
 
Best answer

The migration guide was made with version 10/10.1. 10.0.2 did some changes render blocking scripts and shuch other optimizations.

Which makes the newer code from 10.0.15:

@* Bundle and minify jQuery. *@
@Html.RegisterScriptBundle(
	bundleUrl: ScriptBundlePaths.SkinBundle,
	urls: new[]
	{
		ScriptPaths.JQuery,
		ScriptPaths.JQuery.AdnsfAlias,
	})

@* Bundle and minify CSS. *@
@Html.RenderStyleBundle(
	bundlePath: Url.SkinUrl("css/_skin_bundle"),
	filePaths: new[]
	{
		Url.AppRelativeSkinUrl("less/bootstrap.css"),
		Url.AppRelativeSkinUrl("less/themestyles.css"),
		Url.AppRelativeSkinUrl("css/font-awesome.css"),
		Url.AppRelativeSkinUrl("css/base.css"),
		Url.AppRelativeSkinUrl("css/fonts.css"),
		Url.AppRelativeSkinUrl("css/social-icons.css"),
		Url.AppRelativeSkinUrl("css/payment-icons.css"),
		Url.AppRelativeSkinUrl("css/custom.css"),
	})

If possible it may be easier to copy the default skin folder and make modifications from there. That is what we did when converting our skins and it worked out well. Hope that at least helps.

answered Sep 27 by mmcgeachy (4,605 points)
selected Sep 27 by Yan Kleber
Thank you very much!
...