oqtane / oqtane.framework

CMS & Application Framework for Blazor & .NET MAUI
http://www.oqtane.org
MIT License
1.89k stars 547 forks source link

[BUG] My DLL's are replaced with older DLL's in bin/debug/Net8.0 when startup in debug-mode. #4757

Closed beolafsen closed 1 month ago

beolafsen commented 1 month ago

Oqtane Info

My DLL's are replaced with older DLL's in bin/debug/Net8.0 and projects DLL's that are deleted are added to the same directory. The responsible routine seams to be the InstallPackages(string webRootPath, string contentRootPath) in InsattaltionManager.cs.

This does not happen all the time - but it seams to happen after I have compiled for Release and the Debug. When I then startup in debug-mode I can see (in the filebrowser) that my projectfiles are changed a lot of times before it fails.

After compile (for debug) I have this files in the bin/debug/net8.0: image

When I start the debug my files are changed in the filebrowser, but it looks like this when I get the error in startup. image

The ClientSFO project are deleted some months ago - and if its in the debug directory I get error later in the startup process.

What should I do? Delete all the old packages?

I try to send a video where you can see the changing of dll's in the debug-directory. The size was to large so I send you a link to dropbox:

https://www.dropbox.com/scl/fi/1j395a74wkt94iq86nuy2/OqtaneDLLproblem.zip?rlkey=y9okqzopoydts0fygvzcdg29a&st=qq6hrwix&dl=0

Version - 5.2.4 Render Mode - Static Interactivity - Server Database - SQL Server

Best regards BEO

sbwalker commented 1 month ago

@beolafsen If you build your module in Debug mode, it will copy the DLLs to the Oqtane /bin folder using the debug.cmd file in the module's Package project folder. If you build your module in Release mode, it will create a Nuget package using the Nuspec file in the module's Package project folder and then copy the Nuget package to the Oqtane /packages folder where it will be extracted the next time you run the framework. My guess is that your Nuspec is not configured correctly and is including DLLs from an older .NET version. Please check the "files" section of the Nuspec to ensure the paths are correct:

  <files>
    <file src="..\Client\bin\Release\net8.0\Oqtane.Blogs.Client.Oqtane.dll" target="lib\net8.0" /> 
    <file src="..\Client\bin\Release\net8.0\Oqtane.Blogs.Client.Oqtane.pdb" target="lib\net8.0" /> 
    ...
beolafsen commented 1 month ago

Hi!

After compile everything looks fine in the /bin folder. It is when I start the application that the changes happens,

I can see ( in the FileExplorer) that the dates on my DLL-files are changed when the application runs - and this seams to happens when the system is in the InstallPackages routine.

My nuspec looks like this:

<?xml version="1.0" encoding="utf-8"?>

OqtaneLibrary 1.4.4 OqtaneLibrary OqtaneLibrary OqtaneLibrary OqtaneLibrary OqtaneLibrary false MIT https://github.com/oqtane/oqtane.framework icon.png oqtane module
sbwalker commented 1 month ago

please review your release.cmd file in module's Packages project. I suspect it is missing the delete command:

ie.

del "*.nupkg"
"..\..\oqtane.framework\oqtane.package\nuget.exe" pack Oqtane.Blogs.nuspec 
XCOPY "*.nupkg" "..\..\oqtane.framework\Oqtane.Server\Packages\" /Y

if it does not have a delete command then the Packages folder will contain Nuget packages for every prior version of the module you have ever created. And when you compile your module in Release mode, it will copy ALL of those Nuget packages to the Oqtane framework /packages folder. And then when you run Oqtane, it will extract the contents of ALL of the Nuget packages - which may lead to the behavior you are describing.

beolafsen commented 1 month ago

Thank you - the delete stmt was missing.