-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NETSDK1148 error when building for runtime win7-x86 #15748
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
This is a new error added with .NET 6, this comment provides some details on what it means: dotnet/aspnetcore#29524 (comment). This error is very project dependent so if you need help debugging please provide a binlog recreating the error. |
Attaching the binlog as requested. |
From the binlog it looks like the conflict should be resolved by HandlePackageFileConflicts but since the casing is different between the two file names (API-MS-Win-core-xstate-l2-1-0.dll and api-ms-win-core-xstate-l2-1-0.dll) it isn't marked as a conflict and doesn't get resolved. @dsplaisted is this expected since different platforms have different policies on casing in file names? Is this an issue with one of the packages pulling in the dll or is this a SDK bug? |
It looks like this is a package that we produce, so we should be consistent about the casing. So we should probably file a bug (on dotnet/runtime I think) for that. It also might be a good idea to do case-insensitive comparison when doing conflict resolution. Pros:
Cons:
|
Cool, I filed an issue on the runtime. It seems like changing to case insensitive comparisons would be ideal for case insensitive file systems, but I would be concerned about the effect on case sensitive file systems, I agree that it would probably be a breaking change for some scenarios. |
MSBuild already does case insensitive comparisons in a lot of places. So I'm not sure this would break the scenario where you have files that only differ by case any worse than it already is broken. Certainly there is some amount of risk though. |
I'm also getting this error on the preview pipeline for the dot.net website using the .NET 6 Preview 1 SDK Same pipeline with .NET 5 SDK publishes without any errors. |
I'm facing the same issue with 6.0.101 SDK Error reports the same file as duplicate, just different character case in path (which is actually the same path for windows file systems), and it is not appsettings.json, it's mongodb driver dll. It worked well with 5.0.100 SDK |
@spanevin See this documentation on the breaking change and how to resolve it: https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/duplicate-files-in-output The simple fix is to set If possible, it would be better to normalize the casing for the file if that's under your control. |
@dsplaisted I read the docs and behavior which I see doesn't match behavior which should be, based on the docs. Docs say:
It clearly says that if the files are the same - duplicates must be removed by msbuild. In my case files are the same - it's snappy32.dll, snappy64.dll and libzstd.dll from exactly the same nuget package.
Solution configuration is the following: When I'm doing build of ProjectC - dotnet publish fails with this error. If I convert ProjectA to SDK-style with PackageReference instead of packages.config reference - dotnet publish is not failed anymore. I don't think that setting ErrorOnDuplicatePublishOutputFiles to false is a good idea. It is not a fix, it is just a workaround for a particular case. If real duplicate files with different content appear in this solution - this setting will hide a real error, which is not good. As you can see from my build output - paths to the files have different case, and different package location is used (package\version vs package.version), but it's still the same nuget package, so it's the same files. |
@spanevin Yes, I think it is better not to set ErrorOnDuplicatePublishOutputFiles to false, but for folks who just want an easy fix to get back to the behavior (even though it can hide issues) that was in the 5.0 and earlier SDKs, it's an option. In your case, it looks like the duplicate files are caused by a mix of projects that use packages.config and PackageReference. I'd suggest one of the following:
|
@dsplaisted I understand there are workarounds, but it makes migration to new versions really complicated. Luckily right now just few of several hundreds of projects are affected for us, but it could be much worse... |
@spanevin I'm not sure what you're asking for. Right now you can either go back to the old behavior where the error is ignored, or you can fix the root cause. Is there something else you think we should be doing? |
We are seeing an issue when trying to build Powershell against .NET 6 preview.1 SDK. The error is:
The command line used to build:
Might be related to #14020
/cc @sfoslund as per Marc Paine.
The text was updated successfully, but these errors were encountered: