Arto Kilponen
ViewFeatures, but something that isn't deprecated?
Trying to use this kind of code line:
public IEnumerable<SelectListItem> AuthorList { get; set; }
Works fine, if I have:
using Microsoft.AspNetCore.Mvc.Rendering;
and have installed:
Microsoft.AspNetCore.Mvc.ViewFeatures
This Microsoft.AspNetCore.Mvc.ViewFeatures is deprecated (All versions).
What should I use to replace it? Obviously the key being that I need that SelectListItem (or a replacement) from somewhere.
7 replies
✅ How to read Environment Variables in VS Code ?
Edit. Solved. Code was correct, but had to run from ".NET Core Launch (Console)" and not from "Debug project associated with this file"
Using .Net 8.0.402 and Visual Studio Code 1.94.0
I'm trying to get pretty simply a value from a file named launch.json in .vscode folder. The path is:
.vscode\launch.json
and the path of the file I'm calling from is:
Program.cs
Program.cs has:
private static void Main(string[] args)
{
string a = Environment.GetEnvironmentVariable("API_ENDPOINT");
And the launch.json has:
{
"version": "0.2.0",
"configurations": [
{
...
"env": {
"API_ENDPOINT": "europe-west2-aiplatform.googleapis.com",
And string a gets a value of null. What's the correct way to receive it?
I feel like this is something very, very simple to solve.
15 replies