You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a new IoT Edge solution with a single IoTEdgeModule project with the AzureIoTEdgeApp everything works as expected.
If however, you have multiple projects in the same solution it does not build from the Dockerfile as expected due to it not having the parent directory available in its context, for example;
For this to work the most successful approach is to set the data context within module.json to be the root directory, i.e. the parent of the module.json and the location of the solution file as ../. This mostly works, however you end up with a warning from the dockerfile of:
/app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj : warning NU1503: Skipping restore for project '/app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj'. The project file may be invalid or missing targets required for restore. [/app/AzureIotEdgeApp1.sln]
The only approach to not encounter that warning is to have the Dockerfile (and its context) in the same folder as the module.json file. Using that approach removes the warning above, but prohibits multiple projects within a solution as the Docker context is not able to access them from the current folder.
Current Behavior
As outlined in the summary above, it's not possible to have multiple projects within an IoTEdgeModule solution and have it build within the usual flow of tooling in Visual Studio or using the Dockerfile from the shell.
Expected Behavior
A simple approach to allowing multiple projects (class libraries) within a solution and have a simple build solution.
Steps to Reproduce - Flow 1
Create a new IoTEdgeModule
Add a class library and link it as a project reference to the edge module
Build IoT Edge Modules
Dockerfile output will show Skipping project "/ClassLibrary1/ClassLibrary1.csproj" because it was not found.
Steps to Reproduce - Flow 2
Create a new IoTEdgeModule
Set "contextPath": "../" in module.json
Add a class library and link it as a project reference to the edge module
Build IoT Edge Modules
Dockerfile output will show /app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj : warning NU1503: Skipping restore for project '/app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj'. The project file may be invalid or missing targets required for restore. [/app/AzureIotEdgeApp1.sln]
Is there a simple approach, or documented guidance to this workflow as it doesn't seem like an extraordinary developer experience or use case.
The text was updated successfully, but these errors were encountered:
click2install
changed the title
Unable to build solution with multiple projects
Unable to build module for solution with multiple projects
Aug 19, 2022
Thanks @marianan that's what we've done to workaround the issue (flow #2 above). The challenge that poses though is the references from the build target aren't included so we've had to include those manually (in a temporarily linked project) so there isn't a runtime exception from assembly load.
When creating a new IoT Edge solution with a single IoTEdgeModule project with the AzureIoTEdgeApp everything works as expected.
If however, you have multiple projects in the same solution it does not build from the Dockerfile as expected due to it not having the parent directory available in its context, for example;
For this to work the most successful approach is to set the data context within
module.json
to be the root directory, i.e. the parent of themodule.json
and the location of the solution file as../
. This mostly works, however you end up with a warning from the dockerfile of:The only approach to not encounter that warning is to have the Dockerfile (and its context) in the same folder as the module.json file. Using that approach removes the warning above, but prohibits multiple projects within a solution as the Docker context is not able to access them from the current folder.
Current Behavior
As outlined in the summary above, it's not possible to have multiple projects within an IoTEdgeModule solution and have it build within the usual flow of tooling in Visual Studio or using the Dockerfile from the shell.
Expected Behavior
A simple approach to allowing multiple projects (class libraries) within a solution and have a simple build solution.
Steps to Reproduce - Flow 1
Skipping project "/ClassLibrary1/ClassLibrary1.csproj" because it was not found.
Steps to Reproduce - Flow 2
"contextPath": "../"
inmodule.json
/app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj : warning NU1503: Skipping restore for project '/app/AzureIotEdgeApp1/AzureIotEdgeApp1.iotedgeproj'. The project file may be invalid or missing targets required for restore. [/app/AzureIotEdgeApp1.sln]
Is there a simple approach, or documented guidance to this workflow as it doesn't seem like an extraordinary developer experience or use case.
The text was updated successfully, but these errors were encountered: