callumbwhyte / meganav

A flexible, draggable link picker for constructing site navigation menus in Umbraco
MIT License
35 stars 34 forks source link

Cogworks.Meganav.dll v1.1.2 DLL keeps getting deleted in Visual Studio #42

Closed John-Blair closed 5 years ago

John-Blair commented 5 years ago

Hi, I've just been experiencing disappearing Cogworks.Meganav.dll and Merchello DLLs from my visual studio solution: The files that have disappeared 3 times now are: Merchello.Core.dll Merchello.Examine.dll Merchello.Web.dll - all from merchello version 2.7.0 Oddly another DLL disappears at the same time - Cogworks.Meganav.dll from the Meganav package version 1.1.2 - it is always these 4 as a group that get deleted - nothing else. I also have the Fasttrack package installed version 2.7.0 , and 1 other package Doc Type Grid Editor version 0.6.1 though that is never impacted. I've been using umbraco for many years and never seen this behaviour before - it only started a couple of days ago and ive been using merchello for over a month. In my setup I have an IIS website mapped to my VS website folder to make changes quick to view in Chrome as no rebuild is required when making changes or adding code to appcode folder. Now I've been adding helper extensions and web api controller into the appcode directory recently and wonder if this could have any impact. Any thoughts on why this could be happening and what can be done to prevent it would be appreciated.

I've reported this against Merchello too as previous versions of that had problems with a search dll named Merchello.Examine.dll disappearing before...so im guessing the problem may be more with that package than this one...but reporting it in case other users have experienced this issue.

https://github.com/Merchello/Merchello/issues/2240

The version of umbraco i'm using is 7.13.1

I've now separated my IIS website into a separate folder to rule that out ..I'll monitor the situation and report back if it has helped.

callumbwhyte commented 5 years ago

Hello John,

Firstly thanks for trying out Meganav! Sorry to hear you're having issues.

There is nothing in the Meganav package itself that would cause DLLs to go missing, so it must be an "outside" process causing it to be removed.

How did you install the package? Did you install via NuGet or the Umbraco backoffice? Due to the way the backoffice package installer works DLLs will be wiped out every time you perform a "rebuild" in Visual Studio. This is the only thing I can think of.

If you haven't already, I would suggest installing these ghost packages into your Visual Studio solution via NuGet. Hopefully that fixes the issue.

If the issue persists, I suggest asking for help on the Our Umbraco forums as this would appear to be a wider issue than just targeted towards specific packages.

Cheers, Callum

John-Blair commented 5 years ago

Hi Callum,

Thank you very much for taking the time to reply. You were spot on with your advice!

I recently added a class library project to my visual studio solution - and added assembly references to 3 of the 4 files that kept disappearing (i.e. the Merchello dlls) - oddly the 4th file Cogworks.Meganav.dll was not added as reference. The Merchello umbraco package was added via the Umbraco backend - not via a nuget package - so it put its dlls into the website bin directory. When I added the reference to the Merchello DLLs I added them directly from the /bin directory (as there is no nuget packages directory for these created when you install via the umbraco back office). When you add an assembly the default property for these DLLs is Copy Local = true Now the effect of this is that when I build the solution Visual Studio will try and copy the DLL to itself in the bin directory - and I can see that this might cause the file to be deleted - depending on how visual studio does the copy. The solution I took was to create a separate "lib" directory and reference the DLLs from there so there is no conflict during the copy. Going forward I see there is a Nuget package for the Merchello package so I will move over to using that in time - as these packages take the DLLs from the "packages" folder so avoiding a conflict with the bin directory.

I am still puzzled why the Meganav DLL disappeared - as I do not reference it directly in any of my Visual Studio projects - but it is probably related to the above situation - and the problem has not happened again since I made the change.

Please feel free to close this issue.

Aside: The Meganav is a great product, saving me lots of dev time - thank you. FYI I use it for both header and footer menus. For the footer menu I found myself wrapping the meganav in a Nested Content type so I could add a title for each child menu. I see a lot of footers have a title at the top of each column of child links so if you are considering enhancement you might like to add a "Child Title" property to the product. Great work.

callumbwhyte commented 5 years ago

Hey @John-Blair,

Glad you managed to resolve your issue!

And thanks for the kind words about Meganav. The idea of adding additional data to groups of nav items is currently being actively investigated for V2.

Callum