I have successfully deployed a layer of packages and am now trying to publish my function with the app.
Artifacts file from the stored S3 bucket:
<?xml version="1.0"?>
-<StoreArtifacts>
<Package Version="2.0.0" Id="Amazon.Lambda.Core"/>
<Package Version="1.2.0" Id="Amazon.Lambda.Core"/>
<Package Version="2.1.0" Id="Amazon.Lambda.Serialization.SystemTextJson"/>
<Package Version="1.8.0" Id="DocX"/>
<Package Version="1.18.0" Id="Azure.Core"/>
<Package Version="1.0.0" Id="Microsoft.Bcl.AsyncInterfaces"/>
<Package Version="4.6.0" Id="Microsoft.Graph"/>
<Package Version="2.0.5" Id="Microsoft.Graph.Core"/>
<Package Version="4.35.1" Id="Microsoft.Identity.Client"/>
<Package Version="6.12.2" Id="Microsoft.IdentityModel.JsonWebTokens"/>
<Package Version="6.12.2" Id="Microsoft.IdentityModel.Logging"/>
<Package Version="6.12.2" Id="Microsoft.IdentityModel.Protocols"/>
<Package Version="6.12.2" Id="Microsoft.IdentityModel.Protocols.OpenIdConnect"/>
<Package Version="6.12.2" Id="Microsoft.IdentityModel.Tokens"/>
<Package Version="6.12.2" Id="System.IdentityModel.Tokens.Jwt"/>
<Package Version="1.0.2" Id="System.Memory.Data"/>
<Package Version="13.0.1" Id="Newtonsoft.Json"/>
</StoreArtifacts>
I then try to deploy the function using:
dotnet lambda deploy-function DemoFunction --function-layers arn:aws:lambda:us-east-2:687758306845:layer:DemoLayer:1
I get multiple errors
... publish: C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\Function.cs(4,7): error CS0246: The type or namespace name 'Xceed' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]
... publish: C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\Function.cs(5,7): error CS0246: The type or namespace name 'Xceed' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]
... publish: C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\Function.cs(8,7): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]
... publish: C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\Function.cs(10,17): error CS0234: The type or namespace name 'Identity' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]
... publish: C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\Function.cs(11,17): error CS0234: The type or namespace name 'Graph' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]
How can I get this deployment working? The lines failing are at the imports on top:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xceed.Document.NET;
using Xceed.Words.NET;
using Amazon.Lambda.Core;
using System.IO;
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;
using Microsoft.Identity.Client;
using Microsoft.Graph;
using System.Net.Http.Headers;
CodePudding user response:
Are you sure that your tests, as well as your project, reference the required packages?
It looks like DemoTests.csproj
is missing references based on your error messages:
[C:\Users\UserX\source\repos\DemoTests\DemoTests\src\DemoTests\DemoTests.csproj]