In .NET Core, referred webpack bundles using asp-src-include
. obviously main.js something like main.{hash}.js.
<script type="text/javascript" asp-src-include="~/main*.js"></script>
Worked fine in .NET Core. But in .Net framework 4.5, obviously I can't able to useasp-src-include
. So how to overcome this. src
attribute not working like asp-src-include
<script type="text/javascript" src="~/main*.js")"></script> //this is not working
You can try some thing like this in the BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/AngularMain").IncludeDirectory(
"~/Scripts/dist/","main.*"))
Refer them in you layout
@Scripts.Render("~/bundles/AngularMain")
you can find more info in this link Bundling and Minification I hope this might help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With