Dependency names in deps.json

Sorry. I thought it was two separate issues because the .nuget folder is already lower case.

So all is good now?

Sorry I’m confused. Is the problem that you think its 1 issue whereas I think its two ?

Isn’t Carter is already in lowercase so its not impacted by the cache folder names issue ?

I tried to build a fresh sample with the build you gave me and got the same problem.

Well, then what is the second issue? The only one I’m aware of is that because you spell carter lowercase, it shows lowercase in the .deps. Fixing that will fix your issue.

What else am I missing?

Why would it “already” be lowercase? It needs to be uppercase, as I told you was the problem two weeks ago. If you keep it lowercase, it’ll continue to be wrong, “as designed”.

Carter is using the DependencyContext class to find assemblies that reference carter. It does
this

private static bool IsReferencingCarter(Library library)
{
return library.Dependencies.Any(dependency => dependency.Name.Equals(carterAssemblyName));
}

The only way I can get that to work is by changing the case of the nuget reference in the elements file so that its “Carter”, that fixes the deps file which then allows carter to think my library has carter as a reference.

Im adding the carter reference through Fire and even after the new build it still adds lowercase.

John,

RIGHT. THAT IS THE CORRECT FIX. That’s not an “odd workaround you had to do to work around a bug”. that’s the way IT SHOULD BE. You need to have the case correct for the case to be correct in the .deps. Having the case wrong is a a project/test-case/user error, and is expected to fail, since clearly this stuff is case sensitive.

What build are you using, because here for me, it shows as “Carter” in add references (which my latest fixes, which are in .2369 for sure, but, I cannot tell you for sure what the first build was that had this fixed), and when I add it via the dialog, t gets added as “Carter:*”… As it should be.

Im using 2369. It adds the reference as “carter”


Hm, that’s very odd, because that’s specifically what I fixed, and it works here. What does the content of your carter/3.10.0 folder look like, exactly? does the package have the proper case inside there (it does for me)? do you have more than one “carter” version in the cache folder?


This is my .nuget folder

Odd. the .nupkg name there already is lowercase. that’s what the add reference dialog goes by, now. For me, it has the proper case…

If you delete the cache folder and rebuild your project, does it come back with proper case?

(Sorry, its the Carter.nuspec I look at, not the .nupkg)

That was ~/.nuget

Carter isnt in

~\Library\Application Support\RemObjects Software\EBuild\Elements\Packages\NuGet

You want me to delete the carter folder from .nuget ?

hmm, ~/.nuget is still a thing? I guess it that one has inconsistent cases, I need to rethink this logic, because that folder is/was maintained by botnet, not me :(.

Please try deleting this whole folder, yes.

Also, after confirming this works, can you also check if it comes back with a lowercase name there, if you rebuild a project in VS (or with botnet command line) that uses Carter:3.11.0?

thanx!

If it’s not in there, I don’t see how the Add References dialog would show it at all… (unless it’s already in your project, with the bad case). Add References one checks (our) local cache, plus shows any unknown references it finds in the project.

I was under the impression that you didnt support downloading nuget packages ?

I got it in the .nuget folder by adding a package to a project I created using the dotnet commandline

dotnet new console
dotnet add package carter

The nuspec file has id which has the correct case, what about that ?

You no longer use the .nuget folder ?

Im starting off with a new project and adding it with add references

Ok, reproduced that it does add the files lowercase.

I know what the problem is now, so I’ll just have to find a way to fix it that isn’t gonna be super slow because it’ll require me to read the .XML for each package in the cache :(. But that might be the only option, if cannot rely on the file name case for Microsoft’s cache :(.

bloody hell.

Fixed it on a different level, now. The .deps (and other processing) will now use the proper case form inside the XML file, and not give a damn what wrong case might be in the project.

The Add References dialog, for now, will continue showing the lower case, if the package was from ~/.nuget, because fixing that make the gathering of all packages to costly/slow. You don’t want me having to read 876 XML files when you open the Add Referent dialog.

Alternatively, I could make Add References not query ~/.nuget at all, and have it go just by our cache…

1 Like

That was quick.

Can I download from Firehose ?

In a bit. I can’t merge right now because I’m branched off for other stuff.