سلام خسته نباشید بنده با این کد bundle تمام فایلل ها را بارگذاری میکنم
bundles.Add(new StyleBundle("~/Content/AdminTheme/Css").IncludeDirectory("~/Content/AdminTheme/Assets", "*.css", true));
ولی بعضی از اسکریپت ها لود نمیشود مخصوص فونت ها
Simple-Line-Icons.woff2-v=2.4.0 Failed to load resource: the server responded with a status of 404 (Not Found)
fontawesome-webfont.woff2-v=4.7.0 Failed to load resource: the server responded with a status of 404 (Not Found)
glyphicons-halflings-regular.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
Simple-Line-Icons.ttf-v=2.4.0 Failed to load resource: the server responded with a status of 404 (Not Found)
glyphicons-halflings-regular.woff Failed to load resource: the server responded with a status of 404 (Not Found)
fontawesome-webfont.woff-v=4.7.0 Failed to load resource: the server responded with a status of 404 (Not Found)
glyphicons-halflings-regular.ttf Failed to load resource: the server responded with a status of 404 (Not Found)
Simple-Line-Icons.woff-v=2.4.0 Failed to load resource: the server responded with a status of 404 (Not Found)
fontawesome-webfont.ttf-v=4.7.0 Failed to load resource: the server responded with a status of 404 (Not Found)
چرا به این مشکل بر می خورم ؟ و چگونه باید حلش کنم؟
باسپاس
bundle.Add(new StyleBundle("~/Content/AdminTheme/Css") .Include("~/Areas/Admin/wwwroot/css/style.css", new CssRewriteUrlTransform()));
باید از CssRewriteUrlTransform استفاده کنید.
متاسفانه لود نمیشوند
bundles.Add(new StyleBundle("~/Content/AdminTheme/Assetes").Include("~/Content/AdminTheme/Assets/plugins/simple-line-icons/simple-line-icons.css", new CssRewriteUrlTransform()) .Include("~/Content/AdminTheme/Assets/plugins/font-awesome/css/font-awesome.css", new CssRewriteUrlTransform()));
از طریقinspect کد های html رندر شده را قرار دهید. فقط Style و Script
آیا فایل min در مسیر فایل شما وجود دارد ؟ اگر دارد آن را حذف کنید و کد زیر را هم به BundleConfig اضافه کنید:
BundleTable.EnableOptimizations = true;
منم دقیقا همین مشکل رو دارم
و بعضی زمان ها جواب میده و بعضی زمانها جواب نمیده
فونت ها باید بدون پسوند ورژن باشند یعتی مثلا .ttf باشد و نه .ttfV-2
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)