-
Notifications
You must be signed in to change notification settings - Fork 474
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
Test Tool: Internal Server Error: FileNotFoundException: Could not load file or assembly #594
Comments
I'm working on a new version of this tool that is tied with the upcoming .NET Core 3.1 release but also still support .NET Core 2.1. I have been doing some rework to how the Lambda code is loaded. If I provided a link to a preview build would you be willing to try it out. |
@normj definitely if it's backwards compatible with 2.1 since I would ideally not want to rework all my functions just yet 😅 |
Yeap, going forward there were be 2 separate tools one for 2.1 and one for 3.1 but they will share a lot of the same logic. Let me clean things up and then I'll add a link to the 2.1 version. |
Appreciated thank you |
Here is a link to a preview build of the upcoming version. https://normj-packages.s3.us-west-2.amazonaws.com/Amazon.Lambda.TestTool-2.1.0.10.0-preview1.nupkg To install it download the nupkg file. Then in the directory that you download the file to run the following command to update your existing version. dotnet tool update -g amazon.lambda.testtool-2.1 --version 0.10.0-preview1 --add-source . |
We were having trouble with 0.9.5 not loading the netstandard20 version of the NuGet package |
@brandon-king-halo Thanks for letting me know that 0.10.0 preview fixes the issue! |
Apologies I've not had chance to test this yet. I should be able to look at it this week! |
FYI If anyone has trouble installing the
And then run:
@normj
|
You mentioned you were doing this on Ubuntu. Have you tried the same solution on anything besides Ubuntu? Wondering if this is a platform specific issue. |
Might be related, tried to run using 3.1 and respective Test Tool on ubuntu 19.10.
dump:
(Note that it runs "properly" if the assembly reference (LambdaSerializer) is removed, but obviously that's not a solution) |
Any update on this? I'm using Fedora 31 (so it's seems not to be a Ubuntu issue as @normj suposed) with amazon.lambda.testtool-3.1 (0.10.0) and I tried the same as @JoelRoxell:
This is what I get as a response: ============================================= AWS .NET Core 3.1 Mock Lambda Test Tool (0.10.0) at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) ============================================= As @JoelRoxell mentioned, it doesn't happen if I comment the following line of code: ... but it turns out I tried the same on a real project and it started to complain about the Serilog:
Sounds like it's not finding any dependencies. Does anyone have any idea what's happening here? |
@ericmilaneze Could you try and experiment for me and in your csproj file add the property Here is a full csproj file example. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.1" />
</ItemGroup>
</Project> |
@normj |
It works! Thanks, @normj! |
@normj we are having a similar issue and get exception 'System.IO.FileLoadException' however slightly different stack trace. We tried adding the property above however did not solve the issue. When deployed to AWS this works fine. We are using the latest test tool for 2.1 but when we use a nuget package that is built for .NET Standard we get the following error: System.IO.FileLoadException: Could not load file or assembly 'Internal.Integration.Amy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. An operation is not legal in the current state. (Exception from HRESULT: 0x80131509) Any ideas? |
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> Adding this worked for me. Can we add this to the README temporarily? |
this is the only thing that solved my issue |
adding the above mentioned property solved the issue for me as well . |
I'm using version 0.11.1 with a .Net 5 container Lambda. The test tool works fine for me in Visual Studio, but the Rider instructions result in the following error:
I have Any thoughts? EDIT: It turns out I was still version 3.1 of the test tool instead of version 5. I've created #821 to request formal documentation surrounding .Net 5. |
Hi @alexbaileymembr, Good afternoon. I was going through backlog and came across this issue. Looks like the issue has been resolved for many users as per comments. Please confirm if this issue could be closed. Thanks, |
@ashishdhingra sorry about the delay replying. Looks good thanks! |
|
It seems like I'm having an issue that I can't see others coming across. I've checked everything I can think of but no matter what I do, when the lambda test tool opens in the browser, it fails to load the functions list.
In the network tab I can see:
Full Stack Trace:
Has anyone come across this before or can point me in the right direction? There are no errors in the console from me running it and I'm not totally sure where it's going wrong.
Might be worth mentioning that I'm running this on Ubuntu.
The text was updated successfully, but these errors were encountered: