-
Notifications
You must be signed in to change notification settings - Fork 250
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
RestoreLockedMode: Unexpected NU1004 when ProjectReference refers to a project with custom AssemblyName #7889
Comments
From @patrikbeno on March 17, 2019 19:30 also tested in latest 3.0 preview:
|
@nkolev92 I think the issue is that the lock file is writing the project reference Id: But the verification uses the project file name: |
One workaround is to rename your project to the same as |
/cc @zivkan to get this on your radar |
As discussed, I think we should give preference in the following order:
I have no pref between 1 or 2, but I guess we should respect a name specifically mentioned in the csproj as either PackageId or AssemblyName. |
What @anangaur is referring to more specifically is the following: Basically what we are debating is given a project with a custom assembly name, does the lock file contain: {
"version": 1,
"dependencies": {
".NETFramework,Version=v4.7.2": {
"CustomName": {
"type": "Project"
}
}
}
} or {
"version": 1,
"dependencies": {
".NETFramework,Version=v4.7.2": {
"Lib2": {
"type": "Project"
}
}
}
} If you look at the assets file you will see CustomName as the unique identifier. I am ok with either approach and both are the same complexity. |
Discussed internally, we will preserve the assembly name/package id representation as it guarantees uniqueness in the package graph. |
@nkolev92 - Thanks for fixing this! I see this is part of the 5.1 milestone. How far away would you guess that release is? Once it is released, how long until the fix makes it into the .net sdk? This will prevent many people in my team from migrating to .net core/standard (or even packagereferences) since we have a hard requirement for lock file usage. |
5.1 is 16.1 and matches 2.2.300, 2.1.700 of the SDK. The stable release should happen in the 2nd quarter of May. However, this fix should make it in preview 3 of all respective products. |
@nkolev92 - the issue is not fixed in sdk version 2.2.300. See Sample output:
|
@bergbria |
I can repro it. This should only be an issue if there's ATF enabled in the project (which is by default in .NET Core SDK). The equality check runs into an unexpected situation. |
Note that it has nothing to do with the AssemblyName but rather ATF. |
From @patrikbeno on March 17, 2019 12:23
Steps to reproduce
Expected behavior
dotnet restore -f --locked-mode
completes without error.Actual behavior
Environment data
dotnet --info
output:tested in latest
dotnet/core/sdk:2.2-alpine
docker imageCopied from original issue: dotnet/cli#10988
The text was updated successfully, but these errors were encountered: