dotnet ef migrations script from powershell or command line

when I run "dotnet ef migrations script --startup-project <project dir>" using command line or powershell from the Build Step,

it first fails to build solutions because it fails to retrieve information about Nuget packages. 

ex) " C:\Program Files\dotnet\sdk\2.1.402\NuGet.targets(114,5): error : Failed to retrieve information about '<PackageReference>' from remote source"

However, I have no issue building solutions using Runner type:.Net CLI and Command: build from build step.


Any ideas how to approach this issue? 

Thank you!


1 comment
Comment actions Permalink



first things first, please keep in mind that if this is happening through the command line, it's likely that it's a dotnet/environment issue and not strictly tied to teamcity. If the command works correctly on your dev environment, we'd recommend ensuring that the user which runs it has permissions to access everything required and its environment is properly set up.


You mention that the dotnet steps run fine, would it be possible to try to replace some of the dotnet build steps (regular build) with a command line that runs the dotnet command? If it works, then it would seem to be something specific to that command, while if it doesn't, it seems like some of the dotnet tooling is configuring the environment in a way that your command line is not.


Please sign in to leave a comment.