• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

.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
 
Hello,
our team is experiencing the same problem.
Either we publish the API via vs22 or by using GitHub actions workflow we lose our variables every time the API gets updated.
We even tried to bypass that by creating our own web.config file hoping it won’t get overwriten, but that does not solve the issue.
What can we do to fix that?
Kind regards
 
@povodnikt, that would be the indented behavior. You add variables to the web.config file in the source to retain them after publishing.

image.png
 
Back
Top