# Elements project file compatible with new dotnet proj format?

**URL:** https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635
**Category:** Silver
**Tags:** net, silver
**Created:** [July 20, 2020, 2:54am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635 "2020-07-20T02:54:06Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 20, 2020, 2:54am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/1 "2020-07-20T02:54:06Z")

</div>

I was hoping to convert a Silver [ASP.NET](http://ASP.NET) Core API project to run in Azure Functions. However, I am a bit stumped given the current elements project format uses the older dotnet project format. Is it possible to use the elements compiler with the newer dotnet SDK project format?

---

<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: [July 20, 2020, 11:31am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/2 "2020-07-20T11:31:32Z")

</div>

Ryan,

> [@ryanriley](#):
>
> Is it possible to use the elements compiler with the newer dotnet SDK project format?

No, I’m afraid not. Elements uses the EBuild build chain, not MSBuild, and it uses its own project format (which for backwards compatibility largely looks like what you could call the “old” MSBuild format.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 20, 2020, 4:26pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/3 "2020-07-20T16:26:12Z")

</div>

Any suggestion as to how I might be able to use Silver for an Azure Functions app? I may try adding the required libraries and then dockerize it.

---

<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: [July 20, 2020, 4:29pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/4 "2020-07-20T16:29:46Z")

</div>

> [@ryanriley](#):
>
> Any suggestion as to how I might be able to use Silver for an Azure Functions app? I may try adding the required libraries and then dockerize it.

I just admit i have not looked at Azure functions and their API yet. If they work by you loading a source project, rather than a precompiles binary, I would imagine they probably will only work with the Microsoft-provided compilers. Unless;ess there;'s an option for you to build the code to a .dll and upload the binary?

If you can send me a sample VC# project for a simple Azure Function, I can have a look at what it does and at converting it.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 20, 2020, 4:32pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/5 "2020-07-20T16:32:16Z")

</div>

Yes, most of the Azure Functions I’ve written are compiled. Here’s a sample C# function from GitHub: [https://github.com/Azure-Samples/functions-docs-csharp/tree/master/http-trigger-template](https://github.com/Azure-Samples/functions-docs-csharp/tree/master/http-trigger-template).

---

<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: [July 20, 2020, 4:33pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/6 "2020-07-20T16:33:53Z")

</div>

Thanx, will have a look this afternoon or tomorrow.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 20, 2020, 4:36pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/7 "2020-07-20T16:36:19Z")

</div>

Thank you!

---

<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: [July 20, 2020, 8:38pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/8 "2020-07-20T20:38:02Z")

</div>

After a couple of fixes (one to project import, which wont affect you, and one for EBuild/NuGet, which you probably do need a new build for), this converts and builds fine for me. I’m, attaching the .elements project.

I;m assuming you can just upload the .dll (and maybe host.json) file, then?

[LocalFunctionProj.elements](https://talk.remobjects.com/uploads/short-url/3HkHLQx2kHOIfa9oxxzi7x9DoXf.elements) (1018 Bytes)

---

<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: [July 21, 2020, 3:12am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/9 "2020-07-21T03:12:20Z")

</div>

What was the issue with System.Xml ?

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 21, 2020, 3:47am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/10 "2020-07-21T03:47:14Z")

</div>

Thanks! I ran into the System.Xml issue when I made a naive first pass. I’ll try to run this in the morning.

---

<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: [July 21, 2020, 11:59am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/11 "2020-07-21T11:59:15Z")

</div>

> [@JohnMoshakis](#):
>
> What was the issue with System.Xml ?

the WindowsAzure.Storage package added a _framework_ reference to System.Xml.dll, which relied on the “regular” resolve logic to find it later. but of curse for .NET Core there are no base system dlls to be referenced, so this failed to resolve.

The standard .NET Core package of course does add System.Xml itself, but due to ordering, that one was hit _after_ the one from WindowsAzure.Storage was already there, got skipped (already have this dll, dont need it again), and as result we ended up with a reference w/o resolved path.

The fix was that the “skip” login now only applies if the existing reference is already fully resolved; if not it replaces it.

---

<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: [July 21, 2020, 12:00pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/12 "2020-07-21T12:00:45Z")

</div>

> [@ryanriley](#):
>
> Thanks! I ran into the System.Xml issue when I made a naive first pass. I’ll try to run this in the morning.

I’ll start a new full build with Water for you, and out init your Personal Download folder. usually takes 1-2h.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 21, 2020, 12:47pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/13 "2020-07-21T12:47:52Z")

</div>

Thank you!

![2D39CBF28F6E4DCD95EF5AC40E25F0BE.png](https://talk.remobjects.com/uploads/default/original/2X/0/0a030daf4d1cf77c97ad763ed2eaaad28590b5e0.png)

---

<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: [July 21, 2020, 6:24pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/14 "2020-07-21T18:24:11Z")

</div>

Sorry, didn’t get the build I was waiting for yet, due to some unrelated breakage on the branch. building now (and hopefully successful, this time 😉

---

<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: [July 21, 2020, 7:59pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/15 "2020-07-21T19:59:27Z")

</div>

Done/Up.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 22, 2020, 3:09am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/16 "2020-07-22T03:09:48Z")

</div>

Thank you! I tried running with `func host start`, even after making several adjustments and adding the missing `function.json` binding. I found I had to cd into the output directory and run `func host start` from there. When I did that, it worked!

Out of curiosity, does EBuild support copying a file to the output directory based on its directory in the project? I added `HttpExample\function.json` to the project and set it to `PreserveNewest`, but it always copies `function.json` to the output root.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 22, 2020, 3:13am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/17 "2020-07-22T03:13:05Z")

</div>

Here’s the project I created. Currently, I have to `mkdir bin/output/HttpExample` and `mv bin/output/function.json bin/output/HttpExample`.

[LocalFunctionProj.zip](https://talk.remobjects.com/uploads/short-url/lN2nCIiauGWDhfa5CBft8LFwLxZ.zip) (18.9 KB)

---

<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: [July 22, 2020, 11:47am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/18 "2020-07-22T11:47:01Z")

</div>

> [@ryanriley](#):
>
> Out of curiosity, does EBuild support copying a file to the output directory based on its directory in the project? I added `HttpExample\function.json` to the project and set it to `PreserveNewest` , but it always copies `function.json` to the output root.

I think so, but I have to check. if not, I’ll log to add an option.

---

<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: [July 22, 2020, 11:51am UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/19 "2020-07-22T11:51:59Z")

</div>

Try adding `<FinalOutputFolderOverride>.\HttpExample\</HttpExample>` to the file, in the project.

---

<div class="post-metadata">

### Author: ![ryanriley](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ryanriley/32/13318_2.png) [@ryanriley](https://talk.remobjects.com/u/ryanriley)
#### Post date: [July 22, 2020, 4:38pm UTC](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635/20 "2020-07-22T16:38:07Z")

</div>

That worked great! Thanks! I even managed to convert this to something similar to Swift, which I’ll plan to blog about as soon as I’m able to verify I can publish it to Azure.

[Next page](https://talk.remobjects.com/t/elements-project-file-compatible-with-new-dotnet-proj-format/22635.md?page=2)
