'Blazor error Could not find NativeFileReference

I am watching this Steve Sanderson's Video titled New Blazor WebAssembly capabilities in .NET 6.

I Cloned the git hub repo and tried to build the BlazeOrbital solution inside of it.

I am getting the following errors

Severity Code Description Project File Line Suppression State Error Could not find NativeFileReference ..\rustqr\target\wasm32-unknown-emscripten\debug\librustqr.a BlazeOrbital.ManufacturingHub C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.1\Sdk\WasmApp.Native.targets 228

Severity Code Description Project File Line Suppression State Error MC3066 The type reference cannot find a public type named 'Inventory'. Line 12 Position 51. BlazeOrbital.Accounting E:\Vivek\Trials\WebApps\Blazor\BlazeOrbital\BlazeOrbital\Accounting\Inventory.xaml 12

Certainly I am missing something here as I am new to Blazor.

Can someone please nudge me whats happening here?

When I look at Solution Explorer, I see a missing file librustqr.dll

Visual Studio Solution Explorer with missing librustqr.dll

Where do I get that from, or how do I build that? Rust is Greek and Latin to me, so please help.

But the other solution Satellite Simulator runs fine.

Satellite Simulator in Action

Update

I followed the steps @Janus1986. I downloaded the rustup-init.exe as mentioned. Also installed C++ Build tools. Then installed emscripten

Visual Studio 2022 C++ Build Tools

Then I ran cargo build from the this rustqr folder.

Now I get this error.

warning: unused manifest key: build Compiling bmp-monochrome v1.0.0 error[E0463]: can't find crate for std | = note: the wasm32-unknown-emscripten target may not be installed = help: consider downloading the target with rustup target add wasm32-unknown-emscripten

For more information about this error, try rustc --explain E0463. error: could not compile bmp-monochrome due to previous error

cargo build error for rustqr

:(

Stuck.

Can someone elaborate what steps are need to get this up and running.



Solution 1:[1]

Encountered the same problem, the repository don't have all libraries you have tou build it, it's a simple rust library. You'll have to install rust https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe then emscripten (I installed it from chocolatey) https://chocolatey.org/install

choco install emscripten

then go to the rust folder to build the libs

cargo build

change the target to x86_64-pc-windows-msvc

rustup update
rustup install x86_64-pc-windows-msvc

and change the inside config.toml:

[build]
target = "x86_64-pc-windows-msvc"

and change in cargo.toml

[lib]
crate-type = ["cdylib"]

cargo build

you should have all libraries

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1