Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget not updating content files which are not included in the csproj file when installing new version of package

I made a nuget package for internal usage which addes a dll and a few javascript/css/html files.

The first time I install it all files are copied but when I create a new version with updated content files, these are not updated.

In the install log I get this during the uninstall of the old version:

Removed package 'Consilium.NuTranslation.0.1.1-alpha' from 'packages.config'
Directory 'App_Plugins\NuTranslation\views' is not empty. Skipping...
Directory 'App_Plugins\NuTranslation\js' is not empty. Skipping...
Directory 'App_Plugins\NuTranslation' is not empty. Skipping...
Directory 'App_Plugins\NuTranslation' is not empty. Skipping...
Directory 'App_Plugins\NuTranslation' is not empty. Skipping...

And I get this while installing the new version:

'App_Plugins\NuTranslation\views\translationHistory.html' already exists. Skipping...
'App_Plugins\NuTranslation\views\sendforTranslation.html' already exists. Skipping...
'App_Plugins\NuTranslation\views\manualTranslationImport.html' already exists. Skipping...
'App_Plugins\NuTranslation\package.manifest' already exists. Skipping...
'App_Plugins\NuTranslation\js\translationHistory.controller.js' already exists. Skipping...
'App_Plugins\NuTranslation\js\sendForTranslation.controller.js' already exists. Skipping...
'App_Plugins\NuTranslation\js\manualTranslationImport.controller.js' already exists. Skipping...
Added package 'Consilium.NuTranslation.0.1.4' to 'packages.config'

I just want to point out that those files are not into the csproj file, but they are just inside the folder. I tried adding them to the project file and everything gets updated.

Is there a way to force the update of those files even without adding them to the project?

like image 908
CodeClimber Avatar asked Nov 08 '22 01:11

CodeClimber


1 Answers

I have the same problem. Seems that you have no options. Nuget won't replace content files. You can find some ideas that to do in the related question. For example you can use FileConflictAction option - it will work only if you reference content files in your project.

Update-Packate my.package -FileConflictAction Overwrite

But seems that all of that ideas are not about your case.

like image 60
Igor S Avatar answered Jan 04 '23 01:01

Igor S