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
Hi,
I have a question regarding running sam build on a .NET 8 Serverless NativeAOT project with project references referencing an adjacent directory.
My project structure is as below, building worked fine when building only the Cwoc.Lambda project but ever since including shared projects from the shared folder, the docker run command that is eventually called is not able to locate these files as they aren't mounted.
Please let me know of any workarounds or options to address this.
Thanks
sam build --template ./apps/Cwoc/Cwoc.Lambda/serverless.yaml
Building codeuri: /Users/kt/Source/custom/src/apps/Cwoc/Cwoc.Lambda runtime: dotnet8 metadata: {'Tool': 'Amazon.Lambda.Annotations'} architecture: arm64 functions:
CwocLambdaFunctionsOrderTxHandlerGenerated, CwocLambdaFunctionsOrderRxHandlerGenerated, CwocLambdaFunctionsStockSyncHandlerGenerated
Workflow DotnetCliPackageBuilder does not support value "False" for building in source. Using default value "True".
Running DotnetCliPackageBuilder:GlobalToolInstall
Tool 'amazon.lambda.tools' was reinstalled with the stable version (version '5.10.7').
Running DotnetCliPackageBuilder:RunPackageAction
Amazon Lambda Tools for .NET Core applications (5.10.7)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet
Executing publish command
Starting container for native AOT build using build image: public.ecr.aws/sam/build-dotnet8:latest-arm64.
... invoking 'docker run --name tempLambdaBuildContainer-6e26ef82-2544-427d-83cd-b3d780edf5e1 --rm --volume "/Users/kt/Source/custom/src/apps/Cwoc":/tmp/source/ -i -u 501:20 -e DOTNET_CLI_HOME=/tmp/dotnet -e XDG_DATA_HOME=/tmp/xdg
public.ecr.aws/sam/build-dotnet8:latest-arm64 dotnet publish "/tmp/source/Cwoc.Lambda" --output "/tmp/source/Cwoc.Lambda/bin/Release/net8.0/publish" --configuration "Release" --framework "net8.0" --runtime linux-arm64
/p:GenerateRuntimeConfigurationFiles=true --self-contained True /p:StripSymbols=true' from directory /Users/kt/Source/custom/src/apps/Cwoc
... docker run: An issue was encountered verifying workloads. For more information, run "dotnet workload update".
... docker run: Determining projects to restore...
... docker run: Skipping project "/shared/CA.C7.API/CA.C7.API.csproj" because it was not found.
... docker run: Skipping project "/shared/CA.Protocols.SFTP/CA.Protocols.SFTP.csproj" because it was not found.
... docker run: Skipping project "/shared/CA.C7.API/CA.C7.API.csproj" because it was not found.
... docker run: Skipping project "/shared/CA.Protocols.SFTP/CA.Protocols.SFTP.csproj" because it was not found.
... docker run: Restored /tmp/source/Cwoc/Cwoc.csproj (in 4.07 sec).
... docker run: Restored /tmp/source/Cwoc.Lambda/Cwoc.Lambda.csproj (in 8.59 sec).
... docker run: /var/lang/bin/sdk/8.0.303/Microsoft.Common.CurrentVersion.targets(2165,5): warning : The referenced project '../../../shared/CA.C7.API/CA.C7.API.csproj' does not exist.
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /var/lang/bin/sdk/8.0.303/Microsoft.Common.CurrentVersion.targets(2165,5): warning : The referenced project '../../../shared/CA.Protocols.SFTP/CA.Protocols.SFTP.csproj' does not exist.
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Di.cs(4,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Di.cs(5,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Handlers/OrderRxHandler.cs(4,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Handlers/OrderRxHandler.cs(5,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Handlers/OrderRxHandler.cs(6,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
... docker run: /tmp/source/Cwoc/Handlers/OrderTxHandler.cs(3,7): error CS0246: The type or namespace name 'CA' could not be found (are you missing a using directive or an assembly reference?)
[/tmp/source/Cwoc/Cwoc.csproj]
...
[/tmp/source/Cwoc/Cwoc.csproj]
ERROR: Container build returned 1
Build Failed
Error: DotnetCliPackageBuild
The text was updated successfully, but these errors were encountered:
As mentioned by @normj in this discussion - "code-mount-directory" can be set in the aws-lambda-tools-defaults.json to reference a path that the dotnet lambda command eventually uses.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hi,
I have a question regarding running
sam build
on a .NET 8 Serverless NativeAOT project with project references referencing an adjacent directory.My project structure is as below, building worked fine when building only the Cwoc.Lambda project but ever since including shared projects from the shared folder, the
docker run
command that is eventually called is not able to locate these files as they aren't mounted.Please let me know of any workarounds or options to address this.
Thanks
The text was updated successfully, but these errors were encountered: