# File and product version in deps.json

**URL:** https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688
**Category:** Elements
**Created:** [December 30, 2022, 4:47pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688 "2022-12-30T16:47:33Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 30, 2022, 4:47pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/1 "2022-12-30T16:47:33Z")

</div>

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

Using dotnet I get

```auto
      "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

```auto
      "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](https://talk.remobjects.com/uploads/short-url/fFh4NHmZKbzrCxF9cSSTY6WMo2r.zip) (128.0 KB)

Cheers,  
John

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 31, 2022, 12:31pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/2 "2022-12-31T12:31:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [December 31, 2022, 12:32pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/3 "2022-12-31T12:32:09Z")

</div>

Logged as [bugs://E26369](https://www.remobjects.com/portal/bugs/?id=E26369).

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 31, 2022, 12:42pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/4 "2022-12-31T12:42:26Z")

</div>

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

```auto
                    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];

```

```auto
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] 

```

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [December 31, 2022, 12:51pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/5 "2022-12-31T12:51:40Z")

</div>

Logged as [bugs://E26370](https://www.remobjects.com/portal/bugs/?id=E26370): Tuples come across broken thru Reflection call

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 31, 2022, 1:19pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/6 "2022-12-31T13:19:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [December 31, 2022, 1:19pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/7 "2022-12-31T13:19:35Z")

</div>

[bugs://E26369](https://www.remobjects.com/portal/bugs/?id=E26369) was closed as fixed.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 31, 2022, 1:21pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/8 "2022-12-31T13:21:46Z")

</div>

> [@mh](#):
>
> I assume this is not merely cosmetic, but is what’s causing the problem you have in the other thread?

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

```auto
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)

```

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [December 31, 2022, 1:43pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/9 "2022-12-31T13:43:25Z")

</div>

```auto
      "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 ?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [December 31, 2022, 3:17pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/10 "2022-12-31T15:17:08Z")

</div>

> [@JohnMoshakis](#):
>
> The other thing I was wondering about was the section, is that needed ? I also tried removing that but it didnt make . 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:

```auto
                  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?

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [March 28, 2023, 2:50pm UTC](https://talk.remobjects.com/t/file-and-product-version-in-deps-json/27688/11 "2023-03-28T14:50:17Z")

</div>

[bugs://E26370](https://www.remobjects.com/portal/bugs/?id=E26370) was closed as fixed.
