DbLocalizationProvider Publish causes error: Conflicting assets with the same target path

Vote:
 

I am using DbLocalization provider on a project with Optimziely CMS 12.16. In order to publish to the DXP, I create a nuget package. The build for this package causes an error:

"D:\J\workspace\MyProject\MyProject_AD\src\MyProject\MyProject.csproj" (default target) (1) ->
(GenerateStaticWebAssetsManifest target) -> 
  C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(410,5): 
error : Conflicting assets with the same target path '_content/LocalizationProvider.AdminUI.AspNetCore/css/bootstrap.min.css'. 
For assets 'Identity: C:\Users\svc_jenkins\.nuget\packages\localizationprovider.adminui.aspnetcore\7.5.1\staticwebassets\css\bootstrap.min.css, 
SourceType: Package, SourceId: LocalizationProvider.AdminUI.AspNetCore, 
ContentRoot: C:\Users\svc_jenkins\.nuget\packages\localizationprovider.adminui.aspnetcore\7.5.1\staticwebassets\, 
BasePath: _content/LocalizationProvider.AdminUI.AspNetCore, 
RelativePath: css/bootstrap.min.css, 
AssetKind: All, 
AssetMode: All, 
AssetRole: Primary, 
RelatedAsset: , 
AssetTraitName: , 
AssetTraitValue: , 
CopyToOutputDirectory: Never, 
CopyToPublishDirectory: PreserveNewest, 
OriginalItemSpec: C:\Users\svc_jenkins\.nuget\packages\localizationprovider.adminui.aspnetcore\7.5.1\staticwebassets\css\bootstrap.min.css' and 'Identity: 
D:\J\workspace\MyProject\MyProject_AD\src\MyProject\wwwroot\_content\LocalizationProvider.AdminUI.AspNetCore\css\bootstrap.min.css, 
SourceType: Discovered, 
SourceId: myproject.cms.app, 
ContentRoot: D:\J\workspace\MyProject\MyProject_AD\src\MyProject\wwwroot\, 
BasePath: _content/myproject.cms.app, 
RelativePath: _content/LocalizationProvider.AdminUI.AspNetCore/css/bootstrap.min.css, 
AssetKind: Build, 
AssetMode: All, 
AssetRole: Primary, 
RelatedAsset: , 
AssetTraitName: , 
AssetTraitValue: , 
CopyToOutputDirectory: Never, 
CopyToPublishDirectory: Never, 
OriginalItemSpec: wwwroot\_content\LocalizationProvider.AdminUI.AspNetCore\css\bootstrap.min.css' from different projects. 
[D:\J\workspace\MyProject\MyProject_AD\src\MyProject\MyProject.csproj]

In my csproj, I do have
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

So I would think this error shouldnt happen. And since the files are from a module, I cant control their behavior?

Any ideas on how to resolve?

#295388
Jan 26, 2023 17:38
Vote:
 

Do you have your modules folder set to ignore in your .gitignore file, this is how my web project looks in Visual Studio, you can clearly see the modules files are ignored and not put into source control. We always have the following set in our .gitignore file:

# Optimizely files
*license.config
modules/

#Hide App_Data
**/App_Data/*

#Hide Web.config
web.config

#298771
Mar 22, 2023 13:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.