Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Simple I/O does not work #828

Closed
Closed

Description

@jkotas
File.ReadAllBytes("foo.txt");
Console.WriteLine(Directory.GetCurrentDirectory());

There are a few missing P/Invoke marshallers for SafeHandle and StringBuilder.

Activity

  1. jkotas commented on Feb 8, 2016

    @jkotas
    MemberAuthor

    @tijoytom @yizhang82 This is blocking a number of simple tests. E.g. @bloudraak asked about this on gitter.

    When do you expect that the mcg is going to be properly hooked up to handle these?

    I am wondering whether we should add these missing cases to the temporary interop gen in the compiler in the mean time - it is trivial to do.

  2. tijoytom-zz commented on Feb 8, 2016

    @tijoytom-zz
    Contributor

    @jkotas @yizhang82 The recent CLI changes broke mcg , I have a fix which is not yet merged since CLI folks are moving dotnet compile native as a standalone command.Given this is blocking i will merge the changes today and will update the documentation on how to enable mcg.

  3. tijoytom-zz commented on Feb 8, 2016

    @tijoytom-zz
    Contributor

    Sorry , I did not mean to close it.

  4. jkotas commented on Feb 8, 2016

    @jkotas
    MemberAuthor

    Could you please verify that your change makes the end-to-end work for the above simple test (ideally on both Windows and Unix)?

  5. yizhang82 commented on Feb 8, 2016

    @yizhang82
    Contributor

    @tijoytom Can you also see if we can add a simple test in there to avoid future regressions?

  6. self-assigned this
    on Feb 9, 2016
  7. tijoytom-zz commented on Feb 10, 2016

    @tijoytom-zz
    Contributor

    @yizhang82 @jkotas I merged the changes to CLI and verified that Console.WriteLine(Directory.GetCurrentDirectory()) work , but File.ReadAllBytes throw FileNotFound since System.IO.FileSystem is not included in compilation.We need to get pass along the app references to ilc.exe , guess there's workitem for this?.I will verify some other simple scenarios on Windows and then on Linux.

  8. jkotas commented on Feb 10, 2016

    @jkotas
    MemberAuthor

    We need to get pass along the app references to ilc.exe , guess there's work item for this?

    @schellap is working on this.

  9. jkotas commented on Feb 10, 2016

    @jkotas
    MemberAuthor

    @tijoytom I have looked at your CLI change dotnet/cli#1293. It looks like it is generating the interop for .exe only - it is nice, but it won't help the framework where all interop is. Do you have things in place to generate the interop code for the framework as well (so that the temporary interop generator in ilc can be disabled)?

  10. tijoytom-zz commented on Feb 10, 2016

    @tijoytom-zz
    Contributor

    @jkotas @yizhang82 By framework you mean ILSDK?We have two options , one is to generate the interop for them during app compile time another is to run mcg as a post build process and add *.interop.dll to ILSDK package.As obvious the first option is redundant , but can be a stop-gap measure till i hook up the post build and generate the package.

  11. jkotas commented on Feb 10, 2016

    @jkotas
    MemberAuthor

    Senthil is almost done with trimming the temporary AppDeps package to bare minimum (to just .dlls that we do not have packaged properly yet). We are about to start getting most of the framework (e.g. System.Console.dll, System.IO.*.dll, etc.) via regular nuget packages. So adding *.interop.dll to AppDeps package does not really work well.

  12. jkotas commented on Feb 22, 2016

    @jkotas
    MemberAuthor

    We need to add .NET Native version of System.Threading.Overlapped.dll to appdeps package to make this work out of the box (the CoreCLR version of this .dll that we are picking up right now does not work because of it depends on mscorlib). @schellap Could you please do it when you get a chance?

    The other part needed to make this work out of the box is to pick up a updated System.IO.FileSystem.dll - it will solve itself over time.

    In the meantime, the workaround is to manually pick up right System.Threading.Overlapped.dll and System.IO.FileSystem.dll from corefx. E.g. build corefx repo and change the paths in ilc response file to:

    -r:C:\corefx\bin\Windows_NT.AnyCPU.Debug\System.Threading.Overlapped\netcore50\System.Threading.Overlapped.dll
    -r:C:\corefx\bin\Windows_NT.AnyCPU.Debug\System.IO.FileSystem\System.IO.FileSystem.dll
    
  13. assigned and unassigned on Feb 22, 2016
  14. schellap commented on Feb 22, 2016

    @schellap

    @jkotas, I had added the Threading.Overlapped with dotnet/cli#1470 using the DLL you had shared. Does FS dll need update as well from same location?

  15. jkotas commented on Feb 22, 2016

    @jkotas
    MemberAuthor

    Cool - I have not realized that there is updated package available. I am fixing up the CoreRT repo to pull it down as well: #914

  16. jkotas commented on Feb 22, 2016

    @jkotas
    MemberAuthor

    This works now with most recent package versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions