microsoft / vs-azure-iot-edge-docs

Documentation for Azure IoT Edge Tools for Visual Studio
Creative Commons Attribution 4.0 International
5 stars 6 forks source link

Build Edge solution with Visual Studio 2019 BuildTools #8

Closed cmenzi closed 5 years ago

cmenzi commented 5 years ago

How to install the extension on Visual Studio 2019 Build Tools?

Or what do I need to add to the project(s)? It seems the variable MSBuildToolsRoot is not set

error MSB4019: The imported project "C:\Microsoft\VisualStudio\v16.0\Azure IoT Edge Tools\AzureIoTEdgeProject.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
SLdragon commented 5 years ago

Hi, cmenzi, Our extension needs to download templates from remote when user open new Edge project, I am not sure whether it would work on BuildTools.

If you just want to build module image, I think docker is enough, and we also have Azure Pipelines for Edge project, can you share us your scenario why you need it in the BuildTools, thank you very much!

cmenzi commented 5 years ago

The problem is that when using this extension, then the project iotedgeproj is added to the solution (.sln). If you then try to build the solution on the Build Server, it don't compile anymore. Because the target files are not found.

So, our solution was to remove it from the Release Configuration from the solution file.

SLdragon commented 5 years ago

Hi, cmenzi, here is a command line tools which can install VSIX, you can refer to this question: https://stackoverflow.com/questions/30574829/how-to-install-visual-studio-gallery-extensions-from-command-line

Not sure whether it works for BuildTools without Visual Studio installed, but you can take a try

SLdragon commented 5 years ago

Hi, cmenzi, from our investigation, we found that vsix is for Visual Studio IDE and not supported by the BuildTools. So if you want to build edge solution, you should install the Visual Studio IDE in your build server.

Another way is to build iot edge modules is to use docker. From the visual studio, you can right click the edge project and select "Build and Push IoT Edge Modules", then from output logs, you would learn how to build the module.

image

The main steps are:

SLdragon commented 5 years ago

If you have any other questions, feel free to contact us, thanks!

grahamehorner commented 4 years ago

@SLdragon we are using AzureDev ops and wish to build using CI pipeline are you able to advise on the correct actions to take to use a CI pipeline with regards to Azure IoT Edge Modules developed using .NET Core