Change package.config to somethingelse.config

I created an ASP.NET MVC 4.5 application.
Now I want to change package.config to mypackages1.config. Simple file renaming.

I edited the .csproj file and renamed it. I renamed the package.config file as indicated.
I edited repositories.config and made the changes as mentioned.

But when I released the install-Package somepackage package, it created a new package.config file.

Is there a way to rename the package.config file? I don't have a .nuget folder yet in my solution.

+6
source share
2 answers

This is not supported. You cannot change the packages.config file to any arbitrary name.

The only thing that supports NuGet is to have a package.config file named after the project file itself. This allows you to use multiple project files (.csproj) in the same directory. Therefore, if your project is called FooBar.csproj, you can have a package.config file named:

packages.FooBar.config 
+10
source

Try enabling nuget package recovery for your solution, then the nuget folder will be created. In the Nuget.Targets file, rename the packages.config file to the name you changed. I have not tried, but trying this may help you. You should also make sure that the recently loaded one should create an entry only in this file, and not the packages.config file that it creates.

+1
source

Source: https://habr.com/ru/post/976816/


All Articles