• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs .NET Core Toolkit Environment Variables get lost

Paul Hermans

Basic Pleskian
Username:

TITLE

.NET Core Toolkit Environment Variables get lost

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Windows Server 2022, Plesk Obsidian 18.0.54

PROBLEM DESCRIPTION

When using Environment Variables within .NET Core Toolkit.
Every time you publish a new version of the .NET application via "Web Deploy Publishing" all Environment Variables are gone.

STEPS TO REPRODUCE

1) Download and install Visual Studio Download Visual Studio Tools - Install Free for Windows, Mac, Linux
2) Open Visual Studio
3) Create new project (Template ASP.NET Core Web App (Model-View-Controller)
4) Click in the menu: Build > Publish
5) Choose "Web Server (IIS)" > "Web Deploy"
6) IIS Connection:
Server = plesk hostname
Site name = yourtestdomain.com
Destination URL = yourtestdomain.com
User name = plesk subscription FTP username
Password = plesk subscription FTP password
7) Click Publish to push application to server

8) Now open Plesk > .NET Core
9) Under "Environment variables" click button EDIT...
10) Create a new test variable en click "Save"

11) Go back to Visual Studio and Publish your application again (step 7)

12) Now go back to Plesk > .NET Core > "Environment variables" and see your variable is gone.

ACTUAL RESULT

Environment variables are flushed when publishing via "Web Deploy Publishing"

EXPECTED RESULT

Environment variables should be persistent

ANY ADDITIONAL INFORMATION

Doesn't matter if IIS application pool "load user profile" is set to True or False.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
I see Environment Variables are added to the Web.config file by Plesk and this file gets overwritten each time you publish.

Possible solutions:
1) Plesk can automatically re-add the Environment Variables to the web.config file after each deployment
2) Plesk can store Environment Variables somewhere outside of the webroot
 
Back
Top