microsoft / microsoft/PTVS

Adding a Flask web project to a docker-orchestration results in WebRole.dll error.

Open
#8,143 0 comments 0 reactions 1 assignee View on GitHub

@bschnurr is already working on this.

Since Jan 21, 2025.

needs repro
Dominant language
C#
Stars
2.6k
Forks
680
Avg merge
39m
Merged PRs (30d)
1

Description

Describe the bug
Adding a Flask web project to a docker-orchestration results in WebRole.dll error.

Steps to Reproduce

  1. Create a blank solution and give it a proper name (for example MyApp).
  2. Add a new project in the form of a ASP.NET Core Web API and give it a proper name (for example MyApp.API).
    2.1. Place the project within the solution.
    2.2. Check 'enable container support'.
    2.3. Click 'create'.
  3. Right click on the MyApp.API project, go to 'add' and click on Add orchestration support.
    3.1. Just let it create the docker-compose.yml file and it should contain the code that is visible in Sample Code [1].
  4. Add a new project in the form of a blank Flask project and give it a proper name (for example MyApp.Flask). You may edit your Visual Studio installer to enable the creation of these projects.
    4.1. Place the project within the solution.
    4.2. Click 'create'.
    5 Right click on the MyApp.Flask project, go to 'add' and click on Add Dockerfile (note that this also gives me the error visible in screenshot [1]).
  5. Complete the docker-compose.yml file with the code from Sample Code [2].
  6. Run the docker-compose by clicking the play-button that is visible in screenshot [2].

Expected behavior
I expect the docker containers to run without any issues. In a success scenario even the API could pop-up in the browser.

Actual behavior
The program does not run, due to errors. The following image describes the error I receive:
Image

Note: I can resolve this error by adding a bin folder and adding that WebRole.dll file to it (https://github.com/microsoft/PTVS/blob/main/Python/loc/lcl/PLK/Microsoft.PythonTools.WebRole.dll.lcl). Yet I expect that this should run out of the box.

Additional context and screenshots
[1]
Image
[2]
Image

Sample Code
[1]

services:
  myapp.api:
    image: ${DOCKER_REGISTRY-}myappapi
    build:
      context: .
      dockerfile: MyApp.API/Dockerfile

[2]

services:
  myapp.api:
    image: ${DOCKER_REGISTRY-}myappapi
    build:
      context: .
      dockerfile: MyApp.API/Dockerfile
  myapp.flask: #Newly added service for the Flask project
    build:
      context: .
      dockerfile: MyApp.Flask/Dockerfile

Configuration information (If you are providing a diagnostics file (see below), skip this section)
VS Version: Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.12.4
PTVS version: 17.0.24269.5
Python version:
Debugger Type (if applicable): New debugger I would assume.

Diagnostics file
The diagnostics file contains information such as the Python version, environments, loaded assemblies, configuration options, etc. This file makes it easier for us to reproduce and fix bugs, so we would really appreciate it if you could provide it to us. To locate the logs, you can can follow these steps:

  1. Open the File Explorer on your computer.
  2. In the address bar at the top of the window, type %TEMP% and press Enter.
  3. The %TEMP% folder should open, look for file named PythonToolsDiagnostics_*.log, where * represents a series of numbers.

This file contain the diagnostic information that can help us diagnose and resolve the issue you're experiencing.
Please note that the %TEMP% folder is a hidden system folder, so you may need to enable the display of hidden files and folders in File Explorer to see it. To do this, click on the "View" tab in File Explorer, then check the "Hidden items" box in the "Show/hide" section.
You can attach the file to this issue or email it to us at ptvshelp@microsoft.com. If you email it, please add a link to this issue.

Could not find this file on my system, and can thereby not send it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.