# File IO #32668

Merged
merged 121 commits into from Dec 18, 2018

## Conversation

Projects
None yet
7 participants
Contributor

### paul1956 commented Oct 7, 2018

 This added VB FileIO and MsbBox and support, on Windows it includes UI support on other OS's it throws exception on attempt to use UI.

### paul1956 added some commits Sep 24, 2018

 Baseline commit, get things back to state in original PR 
 b448fa1 
 Remove #Const that was left over from old PR 
 beb4fd7 
 Merge branch 'master' of https://github.com/paul1956/corefx 
 b37d54c 
 Update to lastest master, addd FileIO, MsgBox on Windows (throw on ot… 
…her)
 5c31e56 
 Minor cleanup to not require VB 15.5, fix Msgbox Ref, remove unnessar… 
…y Import
 578dc10 
 Resolve Conflict 
 d64039c 
 FIx some Unix configuration issues 
 0595054 
 Add manual Tests on Windows for MsgBox and automatic test for Unix 
 0e81bf6 

### paul1956 changed the title File io update1File IO and MsgBoxOct 8, 2018

Contributor Author

### paul1956 commented Oct 8, 2018

 Ping @333fred this is stable enough to review, there is also a Merge Conflict I am not sure what to do with. I just added lines to a file, I didn't delete or move any lines.

### paul1956 added some commits Oct 8, 2018

 Cleanup comments and Doc Comments in TextFieldParser and add addition… 
…al test for MsgBox
 a56a933 
 Cleanup formatting, dead comments... 
 8e986aa 
 Add missing license comments and more comment cleanup. 
 e3fc96f 
 Minor changes to make code more readable 
 0e94766 
Member

### 333fred commented Oct 8, 2018

 @paul1956 is there a bug associated with this change?
Contributor Author

### paul1956 commented Oct 8, 2018

 @333fred #31181 (comment) Port remainder of Microsoft.VisualBasic

### paul1956 added some commits Oct 9, 2018

 Modify to conform to Reference Source format and ordering 
 e6fd317 
 Move Constants out of Globals where they don't belong. Restore 3 Reso… 
…lution functions to unmodified state. Fix issues in Interaction Module.
 752e804 
 More code cleanup 
 f2f9681 
Member

### 333fred commented Oct 10, 2018

 @paul1956 is this ready for review? If you're still working on it I don't want to go through it. As a general comment though, you need to resolve the conflicts in Microsoft.VisualBasic.cs. Additionally, I started looking an immediately noticed some changes that are purely reformatting things, such as moving Microsoft.VisualBasic.CompareMethod around and making no other changes. Please make sure that you're not moving things around like that, as it will make it harder to track who actually wrote/changed a line.
Contributor Author

### paul1956 commented Oct 10, 2018 • edited

 @333fred I have no idea how to resolve conflicts in that file without some help, VS shows no conflicts, and all I did was add some lines which should not have caused any conflicts (which is what GitHub shows). I originally moved CompareMethod to try and resolve conflict with change that added ComClassAttribute. FileIO and MsgBox could be reviewed I don't have any tests for TextFieldParse and was hoping someone could point me at the original tests for that Module. Also some functions are just straight passthroughs to System.IO, how to I signify that? Do I include a empty test with a comment, leave it out or something else?

### paul1956 added some commits Oct 11, 2018

 Merge branch 'master' into FileIO1 
 603530c 
 Add tests framework for TextFieldParser 
 01a9637 
 Merge branch 'FileIO1' of https://github.com/paul1956/corefx into Fil… 
…eIO1
 6015255 
 Resolve conflicts 
 d3e594f 
Member

### danmosemsft commented Oct 11, 2018

 Also some functions are just straight passthroughs to System.IO, how to I signify that? Do I include a empty test with a comment, leave it out or something else? For each such APi I would add one trivial test just sufficient that if someone edited the VB implementation to remove that pass through to System.IO, the test would break. For example, if the VB function is calling System.IO.File to open a file, I would have a test that called the VB function with an invalid path, and check you get the appropriate exception.
Member

### 333fred commented Oct 11, 2018

 I don't have any tests for TextFieldParse and was hoping someone could point me at the original tests for that Module These are the old tests we know about: https://github.com/danmosemsft/corefx/tree/old.vb.tests. If there are others that are open source, we're not aware of them. Also @cston.

### cston reviewed Nov 26, 2018

 Enum FormatType ErrorFormat = 0 StdFormat = 1 End Enum

#### cston Nov 26, 2018

Member

Consider replacing with simple useErrorFormat As Boolean in MultiFormatTest.

#### paul1956 Dec 5, 2018

Author Contributor

Again this was an original Framework test from MSDN but I will change.

 Address all PR Feedback 
 84953b2 

### paul1956 changed the title File IO and MsgBoxFile IODec 5, 2018

Contributor Author

### paul1956 commented Dec 5, 2018

 I have removed MsgBox and it can be in a separate PR

### paul1956 added some commits Dec 5, 2018

 Fix helper function WriteFIle, remove left over code, fix off by 1 
 b3185fd 
 Fix test for Wildcard Match 
 dbb5762 
 Fix more off by 1 and some comments 
 2bb4445 
 Add comment to reflect source of MultiFormatTest 
 85c8ddd 

### jaredpar approved these changes Dec 14, 2018

Contributor Author

### paul1956 commented Dec 14, 2018

 @cston Thanks, I would like to start another PR to update this to use Windows.Forms so that the functions I disabled would will work but not sure how to include Windows Forms since it is a separate solution. Any guidance would be appreciated.
 Merge branch 'master' into FileIO1 
 0e9977e 
Member

### cston commented Dec 14, 2018

 @danmosemsft is the failure of the packaging build expected? Thanks.
Member

### danmosemsft commented Dec 14, 2018

 D:\j\workspace\windows-TGrou---0d2c9ac4\.packages\microsoft.dotnet.build.tasks.packaging\1.0.0-beta.18613.4\build\Packaging.targets(420,5): error : Package contains two files with same targetpath: ref/netstandard2.0/Microsoft.VisualBasic.dll, items:D:\j\workspace\windows-TGrou---0d2c9ac4\artifacts\bin\ref\Microsoft.VisualBasic\netstandard-Windows_NT\Microsoft.VisualBasic.dll, D:\j\workspace\windows-TGrou---0d2c9ac4\artifacts\bin\ref\Microsoft.VisualBasic\netstandard-Unix\Microsoft.VisualBasic.dll. [D:\j\workspace\windows-TGrou---0d2c9ac4\src\Microsoft.VisualBasic\pkg\Microsoft.VisualBasic.pkgproj] D:\j\workspace\windows-TGrou---0d2c9ac4\.packages\microsoft.dotnet.build.tasks.packaging\1.0.0-beta.18613.4\build\Packaging.targets(420,5): error : Package contains two files with same targetpath: ref/netstandard2.0/Microsoft.VisualBasic.pdb, items:D:\j\workspace\windows-TGrou---0d2c9ac4\artifacts\bin\ref\Microsoft.VisualBasic\netstandard-Windows_NT\Microsoft.VisualBasic.pdb, D:\j\workspace\windows-TGrou---0d2c9ac4\artifacts\bin\ref\Microsoft.VisualBasic\netstandard-Unix\Microsoft.VisualBasic.pdb. [D:\j\workspace\windows-TGrou---0d2c9ac4\src\Microsoft.VisualBasic\pkg\Microsoft.VisualBasic.pkgproj] D:\j\workspace\windows-TGrou---0d2c9ac4\.packages\microsoft.dotnet.build.tasks.packaging\1.0.0-beta.18613.4\build\Packaging.targets(420,5): error : Package contains two files with same targetpath: ref/netstandard2.0/Microsoft.VisualBasic.xml, items:D:\j\workspace\windows-TGrou---0d2c9ac4\.packages\microsoft.private.intellisense\3.0.0-preview1-27128-0\xmldocs\netcoreapp\1033\Microsoft.VisualBasic.xml, D:\j\workspace\windows-TGrou---0d2c9ac4\.packages\microsoft.private.intellisense\3.0.0-preview1-27128-0\xmldocs\netcoreapp\1033\Microsoft.VisualBasic.xml. [D:\j\workspace\windows-TGrou---0d2c9ac4\src\Microsoft.VisualBasic\pkg\Microsoft.VisualBasic.pkgproj] 

### danmosemsft reviewed Dec 14, 2018



#### danmosemsft Dec 14, 2018

Member

I don't believe there should be an explicit project reference, it's implicitly referencing the implementation. Having said that though this project is in a non standard location.

#### paul1956 Dec 15, 2018

Author Contributor

It doesn't build if you can't include the explicit reference, I reported this when I started also the non-standard location causes some issues also reported. I was unable to move it without causing new problems that I filed. The C# and test VB files should probably be in the same directory with 2 project files but this goes against being able to build based on the directory structure without listing the files.

Member

### danmosemsft commented Dec 14, 2018

 @cston I'm not sure but my guess is that it's because of the project references in the test projects. Our test projects should have implicit references to the implementation. Note that you can test this leg locally with build -BuildAllConfigurations (of course it takes a long time)
Member

### danmosemsft commented Dec 14, 2018

 @ericstj does that sound right? Note it is a bit fiddly because the test .vbproj is not in the "standard" location for a test project. However @cston it should be easy to see whether it builds OK without that project reference.

### ericstj reviewed Dec 14, 2018

 @@ -2,7 +2,8 @@ netstandard; netstandard-Unix;

#### ericstj Dec 14, 2018

Member

Reference assemblies cannot differ by runtime. Runtime is never considered when resolving files that get passed to the compiler.

Member

### ericstj commented Dec 14, 2018

 The packaging build is broken by the configurations for the ref project: #32668 (comment). References cannot have a RID so the two configurations get packed at the same path.

### ericstj reviewed Dec 14, 2018

 @@ -2,7 +2,8 @@ netstandard; netstandard-Unix;

#### ericstj Dec 14, 2018

Member

We want to keep a RID-less implementation since this goes into a package. Can we rename this configuration from netstandard-Unix to just netstandard? Then below give the FileSystem.Unix.vb file a different name.

Member

### cston commented Dec 14, 2018

 I would like to start another PR to update this to use Windows.Forms @paul1956 please hold off on additional PRs. We expect to rename the Microsoft.VisualBasic package and that may affect the directory structure. And we may move the tests written in VB to C# to simplify the structure.
Contributor Author

### paul1956 commented Dec 15, 2018

 If you want/expect VB developers to contribute the tests should be in VB, this was also discussed below #31181 (comment)

### cston added some commits Dec 17, 2018

 Update Configuration.props 
 5cdc4d1 
 Update proj files 
 eef3cb7 
 Exclude Windows implementation from package 
 7946e18 

### cston merged commit 87089ef into dotnet:master Dec 18, 2018 13 checks passed

#### 13 checks passed

Linux arm Release Build Build finished.
Details
Linux arm64 Release Build Build finished.
Details
Linux x64 Release Build Build finished.
Details
Linux-musl x64 Debug Build Build finished.
Details
NETFX x86 Release Build Build finished.
Details
OSX x64 Debug Build Build finished.
Details
Packaging All Configurations x64 Debug Build Build finished.
Details
Tizen armel Debug Build Build finished.
Details
UWP CoreCLR x64 Debug Build Build finished.
Details
UWP NETNative x86 Release Build Build finished.
Details
Windows x64 Debug Build Build finished.
Details
Windows x86 Release Build Build finished.
Details