Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] C# solution generation broken #621

Open
iainwhiteigs opened this issue Feb 26, 2024 · 7 comments
Open

[BUG] C# solution generation broken #621

iainwhiteigs opened this issue Feb 26, 2024 · 7 comments
Labels
bug triage Issues that need to be looked at

Comments

@iainwhiteigs
Copy link

iainwhiteigs commented Feb 26, 2024

Description

When I generate a new C# module, there is no module.json generated. This seems to cause problems in the build stage, meaning that the placeholder is not populated in the generated deployment file as follows.

"image": "${MODULES.SampleModule}",

This happens when you add a new #C module, or when you start from scratch with iotedgedev new.

Expected behavior

Basic project generation works - I can build and deploy the new module

Actual behavior

Basic project generation doesn't work - I can't build and deploy the new module.

Steps to Reproduce

mkdir test-solution
cd test-solution
iotedgedev new TestSolution # defaults to #C

The generated filtermodule has no module.json file.

When you build with iotedgedev build you get a deployment.amd64.json in the config directory with the following:

"image": "${MODULES.filtermodule}", - This is invalid and won't deploy correctly.

I think the generation and deployment of C# modules needs to be tested to make sure the build steps work. It just seems broken right now.

Environment

iotedgedev, version 2.1.0
Python 3.11.4
pip 23.1.2

@iainwhiteigs iainwhiteigs added bug triage Issues that need to be looked at labels Feb 26, 2024
@iainwhiteigs
Copy link
Author

Additional info - The only way I can get the deployment config to generate properly is to create a module.json file with the following content. Without the platform details it fails to generate - however since there is now no Dockerfile in the c# .net 7 modules this doesn't really make sense does it?

{
    "$schema-version": "0.0.1",
    "description": "",
    "image": {
      "repository": "acragrisandboxukw.azurecr.io/filtermodule",
      "tag": {
        "version": "0.0.1",
        "platforms": {
            "amd64": "./Dockerfile.amd64", 
            "amd64.debug": "./Dockerfile.amd64.debug"
        }
      },
      "buildOptions": [],
      "contextPath": "./"
    },
    "language": "csharp"
}

@konichi3
Copy link
Collaborator

We are aware of this issue and apology for the inconvenience.

Meanwhile, please follow these steps in this page.

@iainwhiteigs
Copy link
Author

We are aware of this issue and apology for the inconvenience.

Meanwhile, please follow these steps in this page.

@konichi3, I don't know how the steps on that page help me - They seem to be about running edge locally - that's not my issue and there's nothing in there to help me generate a deployment manifest.

I'm manually generating the module.json defined above as a work-around, but it seems wrong that I need to specify Dockerfiles even though there are no longer Docker files in the dotnet7 modules. (Since dotnet publish is now being used)

@RollsChris
Copy link

same issue here

@iainwhiteigs
Copy link
Author

Hi @RollsChris I got a working C# module but I am a bit disappointed I had to go through the pain myself. I had to create a module.json and my own build script. Let me know if you need help and I can share them with you.

I am surprised the change to .NET 7 seems to have been pushed out without any form of verification.

@RollsChris
Copy link

Thanks @iainwhiteigs we have something working

@bagoette
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues that need to be looked at
Projects
None yet
Development

No branches or pull requests

4 participants