2
I am developing a console application, where I read a file . txt and perform some routines of INSERT my database.
The application running on my machine works normal, but when running my . exe on another machine, it opens the console and closes immediately.
Note: all machines have version 3.1 of . NET core
consoleApp1.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>refresh_106672.ico</ApplicationIcon>
<RuntimeIdentifiers>win10-x64;osx.10.12-x64;debian.8-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
</ItemGroup>
Did you check if the records were recorded? The console application closes after execution, unless you give some command to wait for an action. here has an example of how to use ESC to close application.
– Gabriel Braga
Check if the machine has dotnet hosting: https://download.visualstudio.microsoft.com/download/pr/beca42b0-54a8-4364-86b8-a3d88003fbb7/592e0eec1e5e53f78d9647f7112cc743/dotnet-hosting-3.1.9-win.exe
– Vinícius
Create a log file, every step. With this you will find out where the problem is.
– rysahara
See in the Event Viewer exactly what the error is
– Leandro Angelo