I have created an Azure function application in Visual Studio 2017 (as detailed here) and the application builds without an issue from within Visual Studio. However when I try and build the application from the command line (simply running msbuild.exe mysolution.sln) with MSBuild version 15, I get errors such as:
error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) which is most likely because the application references Microsoft.Azure.WebJobs by default as mentioned here.
So I presume I need to restore the Microsoft.Azure.WebJobs package somehow but I am unsure on how to restore packages in an Azure function application manually. I created a project.json file and listed the package in there but that didn't work. I then created a packages.json nuget file and that didn't work either. Any ideas?
nuget restore, just like with any other msbuild based project?nuget restore mysolution.slnand get the messageNothing to do. None of the projects in this solution specify any packages for NuGet to restore.If I knew how Visual Studio was restoring the packages, I could just copy that.nuget restorefollowed bymsbuildworks great. Make sure you do this from a dev prompt for VS 2017 preview.