Skip to content

Add requirements for .NET - #570

Closed
joaoasrosa wants to merge 3 commits into
aws:developfrom
joaoasrosa:develop
Closed

joaoasrosa wants to merge 3 commits into
aws:developfrom
joaoasrosa:develop

Conversation

@joaoasrosa

Copy link
Copy Markdown
Contributor

This PR is related to #558, requested by @heitorlessa comment.

The PR adds the Cake requirements, .NET 4.6.1 on Windows, and Mono on Linux & macOS.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@heitorlessa

Copy link
Copy Markdown
Contributor

hey @joaoasrosa, if I were to install Mono, would it simply be able to do sam init --runtime dotnetcore and run the build.sh for either MacOS and Linux?

I remember I tried that in Cloud9 (easiest way for me to start fresh) but it failed

@joaoasrosa

Copy link
Copy Markdown
Contributor Author

Hi @heitorlessa,

Let me try in a fresh Cloud9 environment. Recently I changed my laptop (MBP) and I installed Mono and .NET Core, and I was able to build the solution.

@heitorlessa

Copy link
Copy Markdown
Contributor

Cooolio! I seem to have lost my notes on issues I encountered (something around an Empty Array when trying to run the build.sh).

I will build everything from scratch again in my laptop this time using Visual Studio (noticed it installs Mono) and also on Cloud9 and will script it to share here so we can have consistent results :)

If you're on the SAM Dev Slack Channel ping me over and we can post the results here later

* [DotNet Core installed](https://www.microsoft.com/net/download)
* [.NET Core installed](https://www.microsoft.com/net/download)

The sample template for {{ cookiecutter.project_name }} uses Cake. The Cake dependencies are listed below, per Operating System.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Cake really necessary? Can't we just use dotnet CLI's native commands instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sanathkr ,

To answer your question, no is not absolutely necessary. However, from a dev perspective, it is a useful abstraction since gives you the ability to use the same commands to build your solution as the CI server.

Using Cake in .NET is similar to use Maven in Java (although Maven as the package manager component, where Cake uses NuGet, Paket, ..., for .NET dependencies). However, comparing to SAM Java version, it uses Maven to run the tests, where it also could use java CLI.

Does it make sense?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, this is quite useful as its also cross platform.

@mikemorain mikemorain Nov 5, 2018 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this thread, Cake can run on .NET Core without Mono. They also link this script for bootstrapping Cake and getting the Cake.CoreCLR as opposed to relying on the broader .NET Framework (which Mono provides).

They've also released it as a .NET CLI tool, as of v0.30.0 (blog post here). I'm thinking with this new info and the improvements to Cake, we can remove the reliance on Mono and clean up this experience.

Thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikemorain you are correct, Cake no longer requires Mono, and we should probably remove that section. I'd still like to put something here about Mono as many tools we use for cross platform development and IDE support (VS Code and Rider for example) rely on it for debugging purposes.

@sanathkr

Copy link
Copy Markdown

We are working on a sam build support for dotnet. So when it lands this will not be necessary. I am closing it for now.

@sanathkr sanathkr closed this Feb 19, 2019
@sanathkr

Copy link
Copy Markdown

#890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants