Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 215 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MSBuild Unhandled Exception: The FileName property should not be a directory unless UseShellExecute is set

#1
**Versions**

- dotnet core sdk: 2.1.403
- docker: 18.09.7
- Linux Kernel: 5.0.0-27
- Ubuntu: 18.04.3

**Problem**

I am running a ASP.NET Core project in docker. When I docker-compose up, I get the following:

```
Unhandled Exception: Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
--- End of inner exception stack trace ---
at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
```

The error seems to occur when it hits the `dotnet restore` line in the dockerfile.

After checking for permissions, it seems that docker has read/write permissions to all the files/folders directly involved

There were some updates this morning that others on this post have said they also had. Whether they were the same updates is unknown. But there were a couple updates. [Here is my update log from the morning that this all started happening][1].

My Dockerfile is like so:
```bash
FROM microsoft/dotnet:2.1.403-sdk as dotnet

WORKDIR /vsdbg

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSL

[To see links please register here]

| bash /dev/stdin -v latest -l /vsdbg

WORKDIR /ProjA

# Install TRX -> JUnit log file converter
#

[To see links please register here]

RUN dotnet tool install -g trx2junit
RUN export PATH="$PATH:/root/.dotnet/tools"

COPY ProjA.sln .
COPY ProjA/ProjA.csproj ./ProjA/
COPY ProjA.Tests/ProjA.Tests.csproj ./ProjA.Tests/
COPY ProjB/ProjB.csproj ./ProjB/
COPY ProjC/ProjC.csproj ./ProjC/

RUN mkdir ProjA.Tests/tmp

RUN dotnet restore # ******* Error seems to happen here...

COPY . .

WORKDIR /ProjA/ProjA/

CMD ["dotnet", "run"]
```


[1]:

[To see links please register here]

Reply

#2
I ran into the same problem today, with docker files that were working fine for months.
There were some repos that worked, but others simply didn't. Without ANY changes. Docker files failed to run and got this same error "MSBuild Unhandled Exception: The FileName property should not be a directory unless UseShellExecute is set".
I was originally using docker 18.09.7 and upgraded to 19.3.2, but that didn't help.

I was running Ubuntu 18.04.3 and had noticed some updates installing in the morning.
This is a simple build system, with very little installed (VS Code, Gitkraken, docker, docker-compose)

Since some of my builds were failing and I couldn't find a culprit, I reinstalled
and downgraded to Ubuntu 18.04.2 and reinstalled the few things I need to build. And everything was working again.
I suspect the updates in the morning broke things. Unfortunately I didn't keep the upgrade log :-(
Reply

#3
We run Ubuntu 18.04 on Azure as our Docker hosts. Azure recently pushed out kernel version 5.0.0-1018, which caused the issue in our Linux containers. Downgrading to kernel version 4.18.0-1025 fixed it for us.
Reply

#4
Same problem here. Update Ubuntu kernel to last version (5.0.0-27-generic) solve the problem.
Reply

#5
I have been struggling with the same problem since yesterday, but the problem stems from ubuntun, because I created and worked without problems from kali linux, but I continued to receive errors despite my attempts at 18.04 and 19.04.

**Docker version**

Version: 19.03.2
API version: 1.40
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:29:11 2019
OS/Arch: linux/amd64
Experimental: false

**Dockerfile**

FROM microsoft/dotnet:2.1-sdk AS build
COPY . project/
WORKDIR /project
run dotnet restore dotnet.sln

FROM build AS publish
WORKDIR /Project/
RUN dotnet publish dotnet.sln -c Release -o /app

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
COPY . Project/
WORKDIR /app
EXPOSE 8003

FROM runtime AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "dotnet.dll"]
Reply

#6
This bug has been confirmed on Ubuntu:

[To see links please register here]


Relevant .net Core issue:

[To see links please register here]

Reply

#7
Solutions

<br> apt-add-repository -y ppa:teejee2008/ppa
<br> apt-get update
<br> apt-get install ukuu
<br> ukuu --install-latest
<br> reboot
<br> uname -sr
Reply

#8
I ran into the same issue and **downgrading** the linux kernel **from 5.0.0-27-generic to 5.0.0.-25-generic** fixed it.

A simple way to downgrade the linux kernel is to use the package **Uku**, which license costs 12$.

The **free alternative** is described [here][1].

Another possibility is to **increase the GRUB Timeout** and choose the desired kernel version in the boot menu on every system start manually, which is described [here][2].


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#9
I had the same issue on ubuntu 9.04. I made the downgrade to `linux-generic=5.0.0.13.14` and it's working now!

Just run the following command :


`sudo apt install linux-image-generic=5.0.0.13.14 linux-headers-generic=5.0.0.13.14 linux-generic=5.0.0.13.14`

Then restart using "Ubuntu Advanced options" and then choose the `linux-generic_5.0.0.13.14`opton.
Reply

#10
The **simplest solution** is for `.Net Core 2.1 and 2.2` is using lower Ubuntu version.

on: [push]

jobs:

build:

runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yourtagname:$(date +%s)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through