Using Smidge in Debug mode to bust cache
o

Owain

about 1 year ago
Hey, has anyone managed to get smidge to bust the cache, specifically for javascript files, but setting the Configuration options as should in the github exmaple? https://github.com/Shazwazza/Smidge/wiki/installation
services.AddSmidge(_config)
    .Configure<SmidgeOptions>(options =>
    {
        //specify callback for filtering the pipeline for a given web file:
        options.PipelineFactory.OnGetDefault = GetDefaultPipelineFactory;
        //change some of the bundle options for rendering in Debug mode:
        options.DefaultBundleOptions.DebugOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
        options.DefaultBundleOptions.DebugOptions.FileWatchOptions.Enabled = true;
        //change some of the bundle options for rendering in Production mode:
        options.DefaultBundleOptions.ProductionOptions.SetCacheBusterType<AppDomainLifetimeCacheBuster>();
    });
From my understanding, which isn't much, I would have thought that if I am running the project locally, via Visual Studio / Kestrel, then my cache should be cleared every time I spin up the site and any JS changes I have made would be picked up. This doesn't seem to be the case. The only thing I've found that works is if I set debug on my import e.g.
<environment names="Development">
    @await SmidgeHelper.JsHereAsync(debug: true)
</environment>
<environment names="Staging,Production">
    @await SmidgeHelper.JsHereAsync(debug: false)
</environment>
This works but I would prefer not to have to set this on every instance that I use the SmidgeHelper. Anyone had similar issues?
U10 Conflicting assets with the same target path
m

MobyDog

over 1 year ago
I have a u10 site that was working fine locally until I installed .net 8 for u13 sites and now it's giving this error when I try to build or run it. Any ideas how to get around it? Have tried cleaning, rebuilding etc. C:\Program Files\dotnet\sdk\8.0.102\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.targets(475,5): error : Conflicting assets with the same target path 'App_Plugins/UmbracoForms/Assets/themes/default/style.css'. For assets 'Identity: C:\Users\Username\.nuget\packages\umbraco.forms.staticassets\10.5.4\staticwebassets\Assets\themes\default\style.css, SourceType: Package, SourceId: Umbraco.Forms.StaticAssets, ContentRoot: C:\Users\Username\.nuget\packages\umbraco.forms.staticassets\10.5.4\staticwebassets\, BasePath: App_Plugins/UmbracoForms, RelativePath: Assets/themes/default/style.css, AssetKind: All, AssetMode: All, AssetRole: Primary, AssetRole: , AssetRole:, RelatedAsset: , AssetTraitName: , AssetTraitValue: , CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNe west, OriginalItemSpec: C:\Users\Username\.nuget\packages\umbraco.forms.staticassets\10.5.4\staticwebassets\Assets\themes\default\style.css' and 'Identity: :\Users\Username\a_files\website10\website10\website10\wwwroot\App_Plugins\UmbracoForms\Assets\themes\default\style.css, SourceType: Discovered, SourceId: website10, ContentRoot: C:\Users\Username\a_files\website10\website10\website10\wwwroot\, BasePath: _content/website10, RelativePath: App_Plugins/UmbracoForms/Assets/themes/default/style.css, AssetKind: All, AssetMode: All, AssetRole: Primary, AssetRole: , AssetRole: PreferTarget, RelatedAsset: , AssetTraitName: , AssetTraitValue: , CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNewest, OriginalItemSpec: wwwroot\App_Plugins\UmbracoForms\Assets\themes\default\style.css' from different projects. [C:\Users\Username\a_files\website10\website10\website10\website10.csproj]