.Net Core 3.1 run published EXE file run with error on run from other directory

Itay Zemah 116 Reputation points
2021-02-11T12:41:01.277+00:00

Hi all,
I build a .net cor e3..1 console app with Oracle managed data access for Core.

The app run fine in debug and also in release, but only from the contained directory.
The app should run by Control-M with 'wakes up' from his dir on the server like 'C:\Program Files\cmt'
The CTM has all the premissions he needs.
The problem is that when I run from the contained dir the app works perfect. when I call it from another dir with it full path, it faild with OracleConnection.ConnectionString is invalid.

the Conn String is in appsettings.json file which readen fine by the console app (this is how it looks)
I cant find any solution in the whole web

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
336 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,159 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Adam Jachocki 46 Reputation points
    2021-09-09T10:00:47.24+00:00

    I don't know how you run your app, but as from you have written I assume that you do some kind of batching or run using Processinfo.
    I think that you are not setting the working directory. Try to set working directory and then your exe should see the appsettings file.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.