Updated wikipage Eiffel for .NETCore execution. (Signed-off-by:jocelyn).

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2423 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2023-10-02 10:19:30 +00:00
parent c76b947f4f
commit b828af3867

View File

@@ -1,33 +1,44 @@
[[Property:modification_date|Mon, 02 Oct 2023 10:06:45 GMT]]
[[Property:modification_date|Mon, 02 Oct 2023 10:19:30 GMT]]
[[Property:publication_date|Mon, 02 Oct 2023 10:00:56 GMT]]
[[Property:uuid|1838ECEC-F411-46C7-926B-204ED0ACD0C6]]
[[Property:weight|0]]
[[Property:title|Eiffel for .NETCore execution]]
[[Property:link_title|NETCore execution]]
__TOC__
At the moment, the EiffelStudio '''debugger has no support''' Eiffel .NET Core.
It is, however, possible to execute most of the Eiffel .NET Core application from the IDE using the `Run` command. The execution will be outside EiffelStudio.
{{note|The generated executable can not be executed by itself and requires to be launched using the `dotnet` tool from the command line. Using the the syntax: `dotnet <app_name>` or `dotnet run <app_name>`.}}
The generated executable can not be executed by itself and requires to be launched using the `dotnet` tool from the command line.
{{note|Use the command: `dotnet <app_name>` or `dotnet run <app_name>`.}}
{{tip|In addition, it is possible that an application requires additional setting (for example web APIs application), in this case the `dotnet run` tool can use a specific profile using the syntax `--launch-profile <NAME>`.}}
== Wrapper project ==
To help the user, the EiffelStudio compiler also generates a C# wrapper project (in W_code or F_code directories). See the `wrapper_*.cs` and `wrapper_*.csproj` files.
This simple C# '''wrapper''' project is simply a way to include and instantiate the Eiffel .NETCore code.
{{info|Read more about the `dotnet` tool, and especially the `run` command at [https://learn.microsoft.com/fr-fr/dotnet/core/tools/dotnet-run] .}}
This "wrapper" project is useful for:
* [[#Executing]] using profile
* [[#Publishing|publishing]] the executable
* [[#Debugging_in_VisualStudio|debugging]] using VisualStudio.
* any specific tool working with a C# project ...
To help the user, the EiffelStudio compiler also generates (in W_code or F_code directories) a C# wrapper project. See the `wrapper_*.cs` and `wrapper_*.csproj` files.
This "wrapper" project will be useful for specific execution, but also [[#Publishing|publishing]] the executable, or even [[#Debugging_in_VisualStudio|debugging]] using VisualStudio. See the next sections for more information.
See the next sections for more information.
==Execution==
It is possible that an application requires additional setting (for example web APIs application), in this case the `dotnet run` tool can use a specific '''profile''' using the syntax `--launch-profile <NAME>`.
Read more about the `dotnet` tool, and especially the `run` command at [https://learn.microsoft.com/fr-fr/dotnet/core/tools/dotnet-run] .
==Publishing==
This '''wrapper''' project is helpful to '''publish''' the executable to the current or other platforms, and have an executable that does not require the `dotnet` command. It is also possible to include all dependencies (i.e: self contained) to ease deployment on machine without any dotnet runtime installed.
The '''wrapper''' project is helpful to '''publish''' the executable to the current or other platforms, and have an executable that does not require the `dotnet` command.
It is also possible to include all dependencies (i.e: self contained) to ease deployment on machine without any dotnet runtime installed.
{{note: use the `dotnet publish` tool on the generated C# wrapper project. See the documentation about `dotnet publish` at [https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish] .}}
==Debugging in VisualStudio==
Even if EiffelStudio does not provide any support for debugging Eiffel .NETCore directly from the IDE.
It is possible to use VisualStudio to debug the generated Eiffel .NETcore application thanks to the wrapper C# project.
It is possible to use, for instance, '''VisualStudio''' to debug the generated Eiffel .NETcore application thanks to the wrapper C# project.
A solution is to use the C# wrapper project generated by the Eiffel compiler (in W_code or F_code directory) within VisualStudio.
* Open the C# `.csproj` file with VisualStudio (it includes the associated Eiffel output dll or exe)
@@ -36,8 +47,11 @@ A solution is to use the C# wrapper project generated by the Eiffel compiler (in
==Limitations==
In the current version, the EiffelStudio compiler will always generate a Microsoft.NET.Sdk C# wrapper project. But this is not always the expected type SDKs.
For instance when using ASP.NETCore, it is expected to use `Microsoft.NET.Sdk.Web`.
In such case, the generated `.csproj` file needs to be manually modified to set the expected SDK, and also the various package dependencies.
This allows the application to be run and, if necessary, debugged using VisualStudio.