Adding a Flask web project to a docker-orchestration results in WebRole.dll error.
@bschnurr is already working on this.
Since Jan 21, 2025.
- 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
- Create a blank solution and give it a proper name (for example
MyApp). - 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'. - Right click on the
MyApp.APIproject, go to 'add' and click onAdd orchestration support.
3.1. Just let it create thedocker-compose.ymlfile and it should contain the code that is visible in Sample Code [1]. - 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 theMyApp.Flaskproject, go to 'add' and click onAdd Dockerfile(note that this also gives me the error visible in screenshot [1]). - Complete the
docker-compose.ymlfile with the code from Sample Code [2]. - Run the
docker-composeby 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:
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]
[2]
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:
- Open the File Explorer on your computer.
- In the address bar at the top of the window, type %TEMP% and press Enter.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.