dotnet / dotnet/dotnet-api-docs

WriteAllText does not work for VB Console App .Net Core

Open
#5,124 3 comments 0 reactions 0 assignees View on GitHub
area-System.Console Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

---
**Issue moved from MicrosoftDocs/feedback#3274**
- Please respond to @winf3.

---

_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](https://user-images.githubusercontent.com/36789179/99256962-83c43e80-2816-11eb-80dc-e1de2c17292c.png)

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.

Contributor guide

Open the contributing guide

Research direction

Start with the linked Microsoft.VisualBasic.FileIO.FileSystem.WriteAllText API page and reproduce the example in a Visual Basic Windows Console App (.NET Core) project. Check the reported missing My.Computer.FileSystem member and the template/setup requirements; done when the documentation explains the supported project setup and provides a working example or accurate requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
visualbasic
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.