Error CS1562

tmag84's Avatar


01 Jul, 2016 10:25 PM


I'm trying to deploy my .NET ASP WebAPI to AppHarbor, but I keep getting the error CS1562 during compilation...but this is only happening on AppHarbor, because when using VisualStudio the problem doesn't happen.

This is the log I'm getting:

2016-07-01T22:11:50.415+00:00 app worker.1 ProcessManager: Started "csc.exe"

2016-07-01T22:11:50.415+00:00 app worker.1 ProcessManager: Process "VBCSCompiler.exe" was terminated with exit code "1"

2016-07-01T22:11:50.759+00:00 app worker.1 ProcessManager: Restarting 'VBCSCompiler.exe' in 600 seconds

2016-07-01T22:11:53.228+00:00 app worker.1 csc.exe: Microsoft (R) Visual C# Compiler version

2016-07-01T22:11:53.228+00:00 app worker.1 csc.exe: Copyright (C) Microsoft Corporation. All rights reserved.

2016-07-01T22:11:53.228+00:00 app worker.1 csc.exe:

2016-07-01T22:11:53.806+00:00 app worker.1 csc.exe: warning CS2008: No source files specified.

2016-07-01T22:11:53.806+00:00 app worker.1 csc.exe: error CS1562: Outputs without source must have the /out option specified

2016-07-01T22:11:53.806+00:00 app worker.1 csc.exe:

2016-07-01T22:11:53.806+00:00 app worker.1 csc.exe:

2016-07-01T22:21:50.780+00:00 app worker.1 ProcessManager: Started "VBCSCompiler.exe"

2016-07-01T22:21:50.780+00:00 app worker.1 ProcessManager: Process "VBCSCompiler.exe" was terminated with exit code "1"

I can't seem to understand how to fix this error, as I don't even understand what's happening.

  1. Support Staff 1 Posted by rune on 02 Jul, 2016 01:24 PM

    rune's Avatar


    You can likely ignore those errors as they're just related to how the background worker runs executables -- in short, background worker will try and run all executables in a compiled build artifact. Since you're using the new Roslyn compiler, which includes executables such as the csc.exe those will be built too.

    That being said you won't currently be able to run a website in a background worker as no HTTP traffic is routed to those. The app would need to be able to run in IIS -- note that support for the new .NET Core type projects is on the way, so you might want to hold off fixing this for the time being.

    If you're not using .NET Core (but only Roslyn, C# 6.0 etc) you can run the app on AppHarbor already. You'll likely need to make a couple of changes to make sure that the Roslyn compiler platform is used and included in the compiled build artifact for running the application on the worker servers, and that the web project is configured as a web project (rather than being self-hosted). Take a look at this thread (and perhaps the thread I link to in the first comment) for a couple of tips and tricks.


  2. 2 Posted by tmag84 on 02 Jul, 2016 06:46 PM

    tmag84's Avatar


    Thanks for the reply, I've used your sample to try the WebAPI to work, but it didn't, so I'm guessing the problem might be somewhere else.

    I created a .ASP NET project with empty template, and I'm using Owin Hosting. When I use it locally, with Visual Studio, the Web API works without any problem...but when I deploy to AppHarbor, it doesn't work, and I get the nginx page.
    I don't know if I'm doing something wrong, or if it's just a lack of proper configuration.

    I'm using the following code:

    If you can give it a look, I'd appreciate it...otherwise, I guess I'll just create a MVC template and work from there.

  3. Support Staff 3 Posted by rune on 05 Jul, 2016 03:41 AM

    rune's Avatar


    Ok I'm not sure I understand the first part fully -- did you try and deploy the Roslyn sample app where it didn't work? If yes it'd be great if you could point me to a build where this didn't work as it should work "out of the box" (unlike a new MVC template app which will require the modifications outlined in the discussion I linked to earlier).


  4. 4 Posted by tmag84 on 06 Jul, 2016 03:34 PM

    tmag84's Avatar

    I'll divide the issue in two parts:

    1 - Regarding the Roslyn Sample, I used it as base for my WebAPI. However, even though there's no error now, when I try to access the application through the hostname, I get the ngix page error. Even if I use the Rosyln Sample without any change, I still get that page error.

    2 - Regarding my actual code, my group created a web-api self-hosted with OWIN, so we could run it locally for build and tests, and we built it from an Empty Template. Everything worked fine on VS.
    When we tried to deploy it to AppHarbor, we did all the changes that are required, we set up assembly startup, created default routes, etc...and we got that error that I linked in the first thread, and also ngix error.

  5. Support Staff 5 Posted by rune on 08 Jul, 2016 02:00 AM

    rune's Avatar

    Ok is this issue related to the DAWApi application by any change? That application was allocated a background worker rather than a web worker when it was initially deployed, so that would explain why you'd see the logs referenced earlier. You can change this simply by changing the subscription to have 1 web worker and 0 background workers instead.


Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac