Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

.NET 7 wasm does not see file in Linux

$
0
0

I was trying to set up running .NET from node.js using the Microsoft guide via dotnet workload install wasm-experimental and dotnet new wasmconsole.

I want to read the vsdx file from .NET, but I have the error:

Error reading file: Could not find a part of the path'/home/user/project/src/file.vsdx'

The .Net application:

using System;using System.IO;using System.Runtime.InteropServices.JavaScript;using System.IO.Packaging;using System.Linq;return 0;public partial class MyClass{  [JSExport]  internal static string Greeting()  {    try {      string filePath = "/empty-template.vsdx";      if (File.Exists(filePath))      {        Console.WriteLine("Файлсуществуетпопути: " + filePath);      }      else      {        Console.WriteLine("Файлнесуществуетпопути: " + filePath);      }      try {        File.ReadAllBytes(filePath);      }      catch (Exception ex) {        Console.WriteLine($"Error reading file: {ex.Message}");      }    } catch (Exception ex) {      Console.WriteLine($"Error opening package: {ex.Message}");    }    return "filePath";  }

The file exists by path.


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>