Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: SOLVED - Re: WinSCP process terminated with exit code -1073741515 (C0000135)

@ryanhenderson: Thanks for sharing your findings.
ryanhenderson

SOLVED - Re: WinSCP process terminated with exit code -1073741515 (C0000135)

I'm not OP, but we were running into this same issue and found a fix that works for us.

The issue appears to be that WinSCP does not work on the Nano Server images. You must use Windows Server Core.
https://hub.docker.com/_/microsoft-dotnet-aspnet

Does Not Work: mcr.microsoft.com/dotnet/aspnet:7.0
Does Work: mcr.microsoft.com/dotnet/aspnet:7.0-windowsservercore-ltsc2019
mfuscolin

WinSCP process terminated with exit code -1073741515 (C0000135) ECS Farget Windows Container

I have the same problem in windows container ECS Fargate. I using .NET Core 3.1.
niltonwjr

Martin, I'm using Visual Studio to run and debug the app, the LaunchSettings has a profile to run it using Docker, just select it and run in a container.

As @abraham.dominic mentioned, your Docker Desktop need to be set to run Windows containers.
ps: If your Docker Desktop is configured to run Linux containers it will ask to you if you want to change to Windows container when your start the app.
martin

Thanks. Though, can you guide me further? I've very little experience with Docker. How do I run your project? What command do I use? Or should I be able to use it from Visual Studio?
niltonwjr

@martin, i'm using the same example that you posted in the link, the only thing that i made diferent is using a .ppk file instead of password for openning the connection.

the sample project is published in this repository:
https://github.com/niltonwjr/WinSCPTest/tree/master/WinSCPTest
ps: I removed the sftp credentials I'm trying to connect because they are from a private company
martin

@niltonwjr: I do not think there's any code to show. I've actually posted a link to a code I've used in my previous post. But again, the code is hardly relevant. The error is unrelated to the code. It's rather about the environment. Can you post complete sample project including your Docker container setup?
niltonwjr

Martin, could you share a example of this project running .NET Core + WinSCP NuGet on Windows container with this simple code?

I'm having the same issue reported by @abraham when I try run a Windows container using Docker Desktop. If you need a example I can post a GitHub repo to reproduce the error. I tried using .NET Core 3.1, 5.0 and 6.0 and in all of those I get the same error.
martin

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Sorry, it took me while to test this. After switching to Windows containers, everything works. I do not get the error your are describing. I've used very basic WinSCP .NET code, like the one here:
https://winscp.net/eng/docs/library#csharp
I did not need to set any permissions or anything else.
abraham.dominic

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

you might need to change the docker desktop setting to switch to Windows containers and build it.
martin

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

When I build your Dockerfile, I get "Linux 5.10.16.3-microsoft-standard-WSL2" system. Not a Windows system.
abraham.dominic

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Created .NET 5 project. Referenced WinSCP NuGet package and upload a file to SFTP location. Application is deployed to Docker Desktop and to Windows container. Docker Desktop is running under WSL2 mode. Attached here with the docker and WinSCP xml log file for your reference.
martin

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Please give us instructions for reproducing the problem. How exactly did you deploy your project and WinSCP to that system?
abraham.dominic

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

It is throwing the error
Exception occurred while downloading file from sftp server dev.sftp.xyz.com/sftp-bucket-dev/ - EDI_Deals ErrorMessage: Unable to connect FTP location , WinSCP.SessionLocalException: WinSCP process terminated with exit code -1073741515 (C0000135). There was no output. Response log file c:\app\jobapi\logs\ was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.

when checked all components are included in the package built and deployed. is there any way to understand which component is missing?
martin

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Why do you think it's an "access denied" issue? The C0000135 seems to mean "Unable to locate component".
abraham.dominic

WinSCP process terminated with exit code -1073741515 (C0000135)

While a session is opened and trying to upload or download a file from SFTP, it does not work. Instead, an error message pops up saying:
System.Exception: Unable to connect FTP location , WinSCP.SessionLocalException: WinSCP process terminated with exit code -1073741515 (C0000135). There was no output. Response log file C:\Windows\Temp\wscp660C.001DC84D.tmp was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself. at WinSCP.Session.Open(SessionOptions sessionOptions) at

The .NET component is hosted on mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 containers and recently migrated to .NET 5 and is running on mcr.microsoft.com/dotnet/aspnet:5.0. the containers are hosted on AWS EKS windows nodes. the application is working locally when debugged using Visual Studio.

Since it is an access denied issue, I ran container under USER ContainerAdministrator and also tried to provided explicit access using corresponding folders using icacls from docker file; still issue persist. pls note that component it self has access to write to temp folder but WinSCP.exe.
RUN c:\windows\system32\icacls "c:\app" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\windows\temp" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\app\jobapi\temp" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\app\jobapi\WinSCP.exe" /grant "everyone":(OI)(CI)F

Using WinSCP 5.19.2 NuGet package. Application is developed on .NET 5.

Has any one encountered such an issue? kindly support.