File and product version in deps.json

Hi,
I noticed that file version isnt included in the generated deps.json

Using dotnet I get

      "Amazon.Lambda.Core/2.1.0": {
        "runtime": {
          "lib/net6.0/Amazon.Lambda.Core.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.0.0.0"
          }
        }
      }

but with Elements I get

      "Amazon.Lambda.Core/2.1.0": {
        "runtime": {
          "lib/net6.0/Amazon.Lambda.Core.dll": {
          }
        },
        "compile": {
          "lib/net6.0/Amazon.Lambda.Core.dll": {
          }
        }
      }

There is a folder in the zip called csharp6 that I created using dotnet.

ConsoleApplication6.zip (128.0 KB)

Cheers,
John

I assume this is not merely cosmetic, but is what’s causing the problem you have in the other thread?

Logged as bugs://E26369.

Curious. the code is actually in place to add these., its just — I get a n il version from that dll…

                    var lAssemblyVersion := ElementsCompilerHelpers.GetAssemblyAndFileVersion(Context, f);
                    Log($"lAssemblyVersion[0] {lAssemblyVersion[0]}");
                    Log($"lAssemblyVersion[1] {lAssemblyVersion[1]}");
                    lJson.Root["runtime"][lRelativePath]["assemblyVersion"] := lAssemblyVersion[0];
                    lJson.Root["runtime"][lRelativePath]["fileVersion"] := lAssemblyVersion[1];
f /Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/NuGet/amazon.lambda.core/2.1.0/lib/net6.0/Amazon.Lambda.Core.dll
lAssemblyVersion (, )
lAssemblyVersion[0] 
lAssemblyVersion[1] 

Logged as bugs://E26370: Tuples come across broken thru Reflection call

compiler bug with tuples on 4.8. I’ve committed a workaround in EBuild for the next/first 2804 build.

1 Like

bugs://E26369 was closed as fixed.

I dont think so. I went through a deps.json file and added the proper values but it didn’t appear to make a difference.
Its strange. The first project I attempted is using the same nugets and works fine. The second one required me to change the architecture but I still end up with

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Amazon.Lambda.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

2022-12-31T00:35:46.942-05:00	File name: 'Amazon.Lambda.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

2022-12-31T00:35:46.942-05:00	at Amazon.Lambda.RuntimeSupport.RuntimeSupportInitializer.RunLambdaBootstrap()

2022-12-31T00:35:46.942-05:00	at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)

2022-12-31T00:35:46.942-05:00	at Amazon.Lambda.RuntimeSupport.RuntimeSupportInitializer.RunLambdaBootstrap()

2022-12-31T00:35:46.942-05:00	at Amazon.Lambda.RuntimeSupport.Program.Main(String[] args) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs:line 16

2022-12-31T00:35:46.942-05:00	at Amazon.Lambda.RuntimeSupport.Program.<Main>(String[] args)
      "Amazon.Lambda.SQSEvents/2.1.0": {
        "runtime": {
          "lib/netcoreapp3.1/Amazon.Lambda.SQSEvents.dll": {
          }
        },
        "compile": {
          "lib/netcoreapp3.1/Amazon.Lambda.SQSEvents.dll": {
          }
        }
      },

The other thing I was wondering about was the compile section, is that needed ? I also tried removing that but it didnt make a difference. I was just wondering why its being added ?

No idea ;). this has been there since I added NuGet support; I assume I made it match what VC# did, but this was years ago, so I don’t recall the details. You think I should drop it?

current logic:

                  if t = "lib" then begin
                    if not assigned(lJson.Root["runtime"]) then
                      lJson.Root["runtime"] := new JsonObject;
                    lJson.Root["runtime"][lRelativePath] := new JsonObject;
                    var lAssemblyVersion := ElementsCompilerHelpers.GetAssemblyAndFileVersion(Context, f);
                    lJson.Root["runtime"][lRelativePath]["assemblyVersion"] := lAssemblyVersion[0];
                    lJson.Root["runtime"][lRelativePath]["fileVersion"] := lAssemblyVersion[1];
                  end;

                  if lKind = "Reference" then begin
                    if not assigned(lJson.Root["compile"]) then
                      lJson.Root["compile"] := new JsonObject;
                    lJson.Root["compile"][lRelativePath] := new JsonObject;
                  end;

I think compile might be relevant for the .deps.json for class libraries?

bugs://E26370 was closed as fixed.