Page MenuHomePhabricator

AWBPackager tries to include missing Newtonsoft DLL
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Build and run AWBPackager

What happens?:

Error: Could not find file '...\AWB\bin\Release\Newtonsoft.Json.dll'.

What should have happened instead?:

Build the zip file.

Software version (skip for WMF-hosted wikis like Wikipedia):
AWB sourceforge release 12586.

I assume it is no longer needed alongside AWB, and was removed from the build. If so, the obvious line needs to be removed from the packager.

Event Timeline

The inclusion of Newtonsoft was removed in change 12588.

The inclusion of Newtonsoft was removed in change 12588.

No it wasn't?

It was added to the AWB exe, after being used by only WikiFunctions.dll for years...

I've just tested this further. If I clean the solution and then delete the bin folder (in AWB), then rebuild the solution, both in RELEASE and in DEBUG, I see Newtonsoft.Json.dll in the folder. Using the packager, it happily builds an SVN release. It also happily builds a "normal" release, when I remember to build the whole solution...

I apologize; I misread the changes in 12588. But I must have something different in my context from yours: I deleted all the bin and obj folders, and the Tortoisesvn checkmarks everywhere are green. I F6 the solution, and still no Newtonsoft in AWB\bin\release. But when I copy the elements of WikiFunctions csproj <Reference> entry to the AWB csproj (SpecificVersion and HintPath) and rebuild it does get copied.

AWBUpdater didn't get into the AWB\bin\release folder this time, so I may need to dig further.

There's a difference if you build the whole solution, vs just building AWB (ie the exe), which depends on WikiFunctions.

I don't know off hand what F6 does by default, but using the solution explorer, and then right click build solution (on the most top level thing) should give the right result.

I always build the entire AutoWikiBrowser solution (F6 in VS2019).

I'm still trying to understand why I need a HintPath and you don't. Apparently you don't need the HintPath if the assembly is in one of four places, of which the two relevant here are (a) the output bin directory (which I hope actually means bin\release) but you said you had cleaned that (b) "paths can be specified in the project settings or configuration files". SpecificVersion false and HintPath ..\libs\NewtonSoft.json.dll work for me. While I'm here, CheckPageConverter has build errors due to 12588 but I guess that doesn't matter now.

I wonder if a third party can try to repro? I guess there aren't many of us who try to build release packages anyway.

When I clean, I deep-clean (all bin and obj folders in the tree) because VS clean only does a partial job, but if as you say you directly delete the AWB\bin folder that should have the same effect here. The only other remote possibility I can think of is another of the four places: the GAC. Is it possible the DLL got installed there on your machine for some reason?

Also, my system builds AWBUpdater before AWB, so it fails to copy the exe to the not yet existing AWB bin directory, but that's just a minor annoyance.

It's not in GAC. And confirming in the Assembly Explorer, the ref'd DLL is indeed the one that's checked into the SVN repo.

I don't know of anything specifically that might cause it, but are you fully up to date on patches on VS2019 (16.11.34 according to my machine).

I've done a clean svn co of the AWB SVN repo (into a new folder), and then right click on the solution, build solution...

The files are all there, AWB starts up fine from the bin folder.

Which I think rules out anything related to something that might not be SVN checked in...

Is AutoWikiBrowser (ie the exe) the "startup" project in the solution? ie it's showing as bolded in the solution explorer?

I know in some older versions of VS, it would select WikiFunctions.

So unless one of the extensions (I have ReSharper and VisualSVN) are doing something weird, it feels like it's something local (hence my "up to date" question above).

I can probably install VS2019 on another machine (VM) and see...

Strange. Yes on the VS version. I did have UnitTests as startup (don't ask) but fixing that didn't help. And AutoWikiBrowser.exe runs just fine without NewtonSoft alongside, presumably because I haven't done anything that requires its services.

Let's not spend more time on this because we may be the only people in the universe who run the packager. However, if you have the time, then extending the <Reference> element as I suggested wouldn't do any harm?

I don't know why it set SpecificVersion to True when I added it to AWB (other than it being the default I guess). That's fixed in rev 12600.

I can add the HintPath manually in the XML in the csproj, it's just curious that VS seemingly isn't displaying/exposing it under the properties tab for a referenced assembly. I feel like it did at one point, but then that's 15+ years of using VS in one form or another. Neither is it removing it when other changes are made...

Curiously, if I remove the reference to the DLL in the VS solution explorer, it adds it with the hintpath set in the csproj...

Not sure how/what added it originally (could've been ReSharper detecting it being missing).

rev 12601 commits that.

Thanks for letting me whine and posting the update. I verified the clean build. I too am frustrated that there is no UI for these settings. But worse is that the build system doesn't issue an error message when it can't find a reference. That is definitely a bug, although whether in MSBuild or VS I don't know. Never did figure out the join between them.