Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WriteAllText does not work for VB Console App .Net Core #5124

Open
@gewarren

Description

@gewarren

Issue moved from MicrosoftDocs/feedback#3274


From @winf3 on Monday, November 16, 2020 1:28:02 PM

Problem:
I create a testprogram according to your page
https://docs.microsoft.com/de-de/dotnet/api/microsoft.visualbasic.fileio.filesystem.writealltext?view=net-5.0#-berl-dt

For that purpose I created a project in Visual Studio 2019 based on the Visual Basic, Windows Console App (.NET Core) template

  1. Problem: There seems to be no Visual Basic, Windows Console App (.NET Standard) template any more. Why ?

  2. Problem: When I add the example lines to the new project, I get the following Error:
    image

Fehler BC30456 "FileSystem" ist kein Member von "Computer". TestFilewrite

To Reproduce
Sourcecode:
Imports System

Module Program
Sub Main(args As String())
Console.WriteLine("Hello World!")
My.Computer.FileSystem.WriteAllText("C:\TestFolder1\test.txt", "This is new text to be added.", False)
End Sub
End Module

Expected behavior
I would expect, that I can use the WriteAllText function in an VB Console App when it is described in a current tutorial.
I also would expect that I find a description what would be the installation and setup requirements to use this function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions