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

Dotnet support #355

Open
robert-lilleker opened this issue Feb 28, 2022 · 4 comments
Open

Dotnet support #355

robert-lilleker opened this issue Feb 28, 2022 · 4 comments

Comments

@robert-lilleker
Copy link

robert-lilleker commented Feb 28, 2022

Hi, I wanted to be able to integrate this with my CDK stack however I can't seem to get projen to generate a C# package. I've added to the .projenrc.js as seen on my fork https://github.com/awslabs/cdk-serverless-clamscan/compare/main...robert-lilleker:dotnet-support?expand=1 however I get the following message:

[jsii-pacmak] [WARN] Exception occurred, not cleaning up [jsii-pacmak] [WARN] dotnet failed TypeError: Cannot read properties of undefined (reading 'namespace') at DotNetTypeResolver.resolveNamespacesDependencies (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/targets/dotnet/dotnettyperesolver.js:71:46) at DotNetGenerator.generate (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.js:43:27) at Dotnet.generateCode (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/target.js:29:28) at async DotnetBuilder.generateModuleCode (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/targets/dotnet.js:94:9) at async /home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/targets/dotnet.js:62:30 at async Function.make (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/util.js:227:36) at async DotnetBuilder.buildModules (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/targets/dotnet.js:35:35) at async Promise.all (index 0) at async Object.pacmak (/home/ec2-user/environment/forks/cdk-serverless-clamscan/node_modules/jsii-pacmak/lib/index.js:61:9) 👾 Task "release » build » package" failed when executing "jsii-pacmak" (cwd: /home/ec2-user/environment/forks/cdk-serverless-clamscan) error Command failed with exit code 1.

@dontirun
Copy link
Contributor

I was able to replicate the error. This package has a dependency on cdk-nag. Looking at the .jsii file that gets generated in the compilation process we can see that cdk-nag does have a .NET target.

"cdk-nag": {
...
    "targets": {
      "js": {
        "npm": "cdk-nag"
      },
      "python": {
        "distName": "cdk-nag",
        "module": "cdk_nag"
      }
    }
}

I think the packaging mechanism is expecting a dotnet configuration on cdk-nag and is throwing an error there as it cannot find one. If this is correct, then cdk-nag will have to publish a .NET package to resolve this error.

@dontirun
Copy link
Contributor

dontirun commented Mar 2, 2022

@robert-lilleker cdk-nag now has a NuGet package. You should be able to compile the package now (though you may have to delete the yarn.lock before re-attempting).

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2022

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

@github-actions github-actions bot added the stale label May 2, 2022
@dontirun dontirun removed the stale label May 2, 2022
@dontirun
Copy link
Contributor

dontirun commented May 2, 2022

Keep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants