# Elements library in ASP.NET Core WebAplications - problem with publish (deps.json)

**URL:** https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491
**Category:** Elements
**Created:** [October 6, 2021, 8:30pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491 "2021-10-06T20:30:54Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [October 6, 2021, 8:30pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/1 "2021-10-06T20:30:54Z")

</div>

Hi,

I’ve problem with publishing my [ASP.NET](http://ASP.NET) Core web app to linux - problem with reference to Elements project.  
If I add Elements project to [ASP.NET](http://ASP.NET) Core as built dll, its generated to WebApplication.deps.json.  
If Iadd it as project reference it does not happen.

I paste you test case.  
WebApplication3 with reference to built ClassLibrary4  
TestASPNETCore\WebApplication3\bin\Release\netcoreapp3.1\publish\WebApplication3.deps.json  
There is a link to ClassLibrary4.  
WebApplication2 with reference to project ClassLibrary4  
TestASPNETCore\WebApplication2\bin\Release\netcoreapp3.1\publish\WebApplication2.deps.json

> **[TestASPNETCore.zip](https://drive.google.com/file/d/1uiih_xxFwQxqARKftzQ-quvtTGCxgv4j/view?usp=sharing)**
>
> Google Drive file.

It’s the only difference between WebApplication2 and WebApplication3.  
WebApplication3 is starting on linux  
WebApplication2 isn’t starting on linux, but the is a workaround - copy WebApplication3.deps.json as WebApplication2.deps.json and it works.

I’ve also added ClassLibrary2 - c# library, and modified Elements library project file to be similar but it doesn’t change anyting.

Please help - I don’t want to build ma classlib seperately

---

<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: [October 6, 2021, 9:03pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/2 "2021-10-06T21:03:37Z")

</div>

Strange. Since the host project is VC#, I’m assuming it’s an issue with how MSBuild passes the reference, for project vs. hardcoded .dll reference…

Does this work ok if the host project is Elements (Oxygene or C#, doesn’t matter), too?

Indeed it seems .deps file for App2 is missing ClassLIbrary4, while App3 has it:

 ![image](https://talk.remobjects.com/uploads/default/original/3X/d/2/d2e704520cbf5443a0eb06f3d416ec18603ab263.jpeg)

---

<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: [October 6, 2021, 9:04pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/3 "2021-10-06T21:04:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [October 6, 2021, 9:12pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/4 "2021-10-06T21:12:45Z")

</div>

In [ASP.NET](http://ASP.NET) Core Elements project I can onlu publish as Azure WebJob - I want to publish it to local folder - maybe it’s possible but don’t know how

It’s the difference - ClassLibrary4 in deps file. When running it with IIS it generates it ok, and this generated deps file for IIS pasted for linux service works fine

---

<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: [October 6, 2021, 10:02pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/5 "2021-10-06T22:02:08Z")

</div>

> [@Mateusz\_Galazka](#):
>
> In [ASP.NET](http://ASP.NET) Core Elements project I can onlu publish as Azure WebJob - I want to publish it to local folder - maybe it’s possible but don’t know how

Okay. thats something to look art separately, later )maybe start a separate thread).

But is the library in the .deps.jsob ok? That should be verifiable regardless of publishing.

> [@Mateusz\_Galazka](#):
>
> It’s the difference - ClassLibrary4 in deps file. When running it with IIS it generates it ok, and this

Yeah, we’ll need to fid out why its missing ion the Project Reference case. The prpoblem tis probably on the MSBuild side…

---

<div class="post-metadata">

### Author: ![viktoriad](https://talk.remobjects.com/user_avatar/talk.remobjects.com/viktoriad/32/11148_2.png) [@viktoriad](https://talk.remobjects.com/u/viktoriad)
#### Post date: [October 13, 2021, 12:56pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/6 "2021-10-13T12:56:52Z")

</div>

Hello Mateus,  
could you please retest this issue with latest build? Recently we added some fixes that could affect and fix this issue as well. I cannot reproduce it here now. I tried to rebuild the attached project with VS2022, and I can see ClassLibrary4 in the WebApplication2.deps.json. This part looks like this:  
…  
“targets”: {  
“.NETCoreApp,Version=v3.1”: {  
“WebApplication2/1.0.0”: {  
“dependencies”: {  
“ClassLibrary2”: “1.0.0”,  
“ClassLibrary4”: “1.0.0”,  
…

Best regards.

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [October 18, 2021, 9:06pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/7 "2021-10-18T21:06:59Z")

</div>

I’ve installed VS 2022 and new version of Elements and it’s ok during build, but not during publish ☹  
And it is the same in VS 2019

---

<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: [November 13, 2021, 3:11pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/8 "2021-11-13T15:11:52Z")

</div>

This _should_ be fixed (post .2689), pending some more retesting on our side.

I’ve uploaded a new build for you to Personal Downloads, `RemObjects Elements with Water - 11.0.0.2690.exe` — please let me know if that one fixes the issue for you, as well.

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [November 15, 2021, 9:14pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/9 "2021-11-15T21:14:02Z")

</div>

Now it works - running under Linux, but still small diff - when published with built reference version of my dll is 1.0.0.1, when published with project reference version is 1.0.0

Looking into AssemblyInfo.pas I’ve got [assembly: AssemblyVersion(‘1.0.0.1’)]

---

<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: [November 15, 2021, 10:34pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/10 "2021-11-15T22:34:05Z")

</div>

> [@Mateusz\_Galazka](#):
>
> Now it works - running under Linux, but still small diff - when published with built reference version of my dll is 1.0.0.1, when published with project reference version is 1.0.0

Is that wrong/truncated version in the actual .dll, or in the .json file?

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [November 16, 2021, 7:13am UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/12 "2021-11-16T07:13:00Z")

</div>

In the json file - it’s ok in dll

---

<div class="post-metadata">

### Author: ![viktoriad](https://talk.remobjects.com/user_avatar/talk.remobjects.com/viktoriad/32/11148_2.png) [@viktoriad](https://talk.remobjects.com/u/viktoriad)
#### Post date: [November 16, 2021, 10:14am UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/13 "2021-11-16T10:14:39Z")

</div>

Hello Mateusz,  
I checked the json file and I can see that both ClassLibrary2 and ClassLibrary4 are contained there with 1.0.0 version as:  
“ClassLibrary2”: “1.0.0”,  
“ClassLibrary4”: “1.0.0”,  
While both are declared as 1.0.0.1 in the AssembplyInfo file. So most probably it is not our problem, but some feature of Microsoft C#.

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [November 16, 2021, 11:36am UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/14 "2021-11-16T11:36:53Z")

</div>

If I change project reference to dll reference it is 1.0.0.1 in deps.json

---

<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: [November 16, 2021, 12:25pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/15 "2021-11-16T12:25:35Z")

</div>

> [@Mateusz\_Galazka](#):
>
> If I change project reference to dll reference it is 1.0.0.1 in deps.json

Okay. But if our .dll via project reference generates the same as as a VC# done does via project reference, then that’s “as designed”, as far as we are concerned. And even if it’s not, that’s Microsoft’s bug, as no art of our toolchain is involved in that part, for the VC# .dll (and most likely not for ours, either)…

Is this causing any actual _problems_?

---

<div class="post-metadata">

### Author: ![Mateusz\_Galazka](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@Mateusz\_Galazka](https://talk.remobjects.com/u/Mateusz_Galazka)
#### Post date: [November 16, 2021, 12:48pm UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/16 "2021-11-16T12:48:47Z")

</div>

Not, It’s not causing any problems and it’s good information 😉

---

<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: [November 17, 2021, 7:46am UTC](https://talk.remobjects.com/t/elements-library-in-asp-net-core-webaplications-problem-with-publish-deps-json/25491/17 "2021-11-17T07:46:27Z")

</div>

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