Closed ghost closed 4 years ago
Did you select x64 as your target platform? As @SteveSandersonMS has mentioned in his blog post it will not compile with Any CPU, at least the native part.
Interesting. I don't know why this would happen.
Can anyone else confirm whether the VueFileExplorer
works or doesn't work for them on Windows?
It does work, however the WebWindow.Native needs to be built first, since it is a dependency. Oddly I can't break the build anymore. It builds and runs with all platforms... Not sure what did I do...
Same error, I am unable to get it working.
I did
dotnet new console --name Test1
cd Test1
dotnet add package WebWindow -v 0.1.0-20191118.2
Edit Program.cs paste into Main(...)
:
var window = new WebWindow("My super app");
window.NavigateToString("<h1>Hello, world!</h1> This window is from a .NET Core app.");
window.WaitForExit();
dotnet run
PS C:\Users\me\Desktop\Test1> dotnet run
Unhandled exception. System.TypeInitializationException: The type initializer for 'WebWindows.WebWindow' threw an exception.
---> System.DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: The specified module could not be found. (0x8007007E)
at WebWindows.WebWindow.WebWindow_register_win32(IntPtr hInstance)
at WebWindows.WebWindow..cctor()
--- End of inner exception stack trace ---
at WebWindows.WebWindow..ctor(String title)
at Test1.Program.Main(String[] args) in C:\Users\me\Desktop\Test1\Program.cs:line 10
OS Name Microsoft Windows 10 Enterprise Version 10.0.18362 Build 18362 Processor Intel(R) Core(TM) i7-8650U
Are you running an x86 version of .NET Core?
Yes 64 bit
OK, I don't know what the issue is then. If you find out, it would be great if you could let us know, especially if you also know how this can be fixed in the library.
Adding more info. Just tried it on my home PC and same error. dotnet --info
output:
PS C:\Users\me\Downloads\Test1> dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33
.NET Core SDKs installed:
1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.0.3 [C:\Program Files\dotnet\sdk]
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.105 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.502 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.604 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.100 [C:\Program Files\dotnet\sdk]
2.2.101 [C:\Program Files\dotnet\sdk]
2.2.105 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
OS Name Microsoft Windows 10 Pro Version 10.0.18362 Build 18362 Processor Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz, 3401 Mhz, 4 Core(s), 8 Logical Processor(s)
@arpadbarta I didn't build the WebWindow project. I used the NuGet package for the samples solution. I'm home now and will try again on my home system.
See the attached image. I tried building and publishing on Windows 10 x64. No joy. I don't know how to debug C++ and have not installed that workload. I'm sure there is an explanation. Wish I knew more. Hope this helps.
I had the same issue. I had to install MSVC v142 - VS2019 C++ x64/x86 build tools (v14.23) to get this to work.
You can do this from VS 2019 Installer > Modify > Individual Components.
@Code-DJ did you rebuild WebWindow or do you need the tools to build the Samples apps?
The line of code pointed to by the arrow is where the exception is being thrown.
@kdawg1406 I just created a test .NET Core Console app. Added the WebWindow package, put the following lines in Main:
var window = new WebWindow("My super app");
window.NavigateToString("<h1>Hello, world!</h1> This window is from a .NET Core app.");
window.WaitForExit();
Didn't try the sample apps but looks like we need the build tools even for your own sample/test apps.
@Code-DJ thank you, I'm installing the build tools now.
@Code-DJ @SteveSandersonMS I'm still getting the same exception after installing the build tools and creating a .NET Core Console app. I added the NuGet package as Code did.
I built using x64.
ConsoleApp3.exe Unhandled exception. System.TypeInitializationException: The type initializer for 'WebWindows.WebWindow' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: The specified module could not be found. (0x8007007E) at WebWindows.WebWindow.WebWindow_register_win32(IntPtr hInstance) at WebWindows.WebWindow..cctor() --- End of inner exception stack trace --- at WebWindows.WebWindow..ctor(String title) at ConsoleApp3.Program.Main(String[] args) in C:\Code\vs2019\ConsoleApp3\ConsoleApp3\Program.cs:line 7
[YOLO] Mon 11/18/2019 18:59:04.60 C:\Code\vs2019\ConsoleApp3\ConsoleApp3\bin\Debug\netcoreapp3.0
@SteveSandersonMS the date difference on these files is 2 months. Is there a chance one of them is incorrect?
@kdawg1406 the dates are the same on my machine.
Both Any CPU and x64 works for me. I think the x64 build requirements are for building the WebWindow.Native project not for projects that use it.
Just to confirm:
OK, I tracked down the issue. It's because the windows DLL had been built in Debug mode, not Release mode. In Debug mode, it can only run if you have some VC++ DLLs on your machine (specifically, the Windows 10 SDK).
I'm changing the prebuilt binary to be a Release build now so it won't require you to have extra stuff on the machine.
@SteveSandersonMS you are the MAN! I'm doing a Lunch and Learn at work Wednesday and am JUICED to show off this work.
You'll let us know when the NuGet package is updated?
@Code-DJ that is exactly the steps I followed. No clue why it didn't work for me.
This is great feedback for Steve, love Blazor!
Got the latest package update that @SteveSandersonMS just pushed. Uninstalled the build tools. Verified that it works correctly.
Great! The new version is 0.1.0-20191119.2 BTW.
Closing now as fixed. Thanks for reporting it.
@SteveSandersonMS now getting this exception with two of my projects:
An unhandled exception of type 'System.AccessViolationException' occurred in WebWindow.dll Attempted to read or write protected memory. This is often an indication that other memory is corrupt. occurred
Not sure what is going.
This is what happens when I launch the Console App Code-DJ recommend in the above thread.
@SteveSandersonMS this is what the Sample Vue app does on start up.
@Code-DJ what version of .NET Core are you targetting. I'm targetting the .NET Core 3.0 RTM release.
I'm using Visual Studio 2019 16.3.9
I've un-stalled the build tools.
I wonder what the differences are between our systems???
@Code-DJ @SteveSandersonMS I just installed the Chrome Edge browser beta and it's now working!
Just had the same problem as @kdawg1406, and the same fix (installing Edge beta) worked for me. Might be worth adding to the readme that the Edge beta needs to be installed on Windows.
@distantcam I went back and re-read @SteveSandersonMS blog post. It's here, I missed it too, Chromium-based Edge is required on Windows.
So it sounds like the chromium-based edge is not installed by default yet? I assumed that edge was chromium-based from it's inception? We might have to see about fast tracking the fallback feature if 95% of Windows boxes don't have it.
I just published my Blazor Budget app using WebWidow.
Thank you @SteveSandersonMS for writing this product! If you read my below readme, you'll notice what I had to do to get the 3rd Party NuGet package JavaScript files to load when the app is running in Visual Studio. The hack is not required when running from the publish directory. No biggie.
https://github.com/Oceanware/BlazorBudgetWebWindow
Sorry to write on a closed issue, but I'm trying this on a mac, targeting the new nuget package 0.1.0-20191119.2, and I'm getting the same error "System.DllNotFoundException: Unable to load shared library 'WebWindow.Native' or one of its dependencies."
- anyone have any ideas? I'm assuming I don't have to install MS Edge Chromium on mac?
Edit: Some more info - all I did was as the blog post stated: new .net core 3 app, add reference, add code to program.main
webview dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.0.100/
@mika76 I'm not entirely familiar with the way nuget resolves dependencies and stuff, but I was getting the same error (also on Mac) and could narrow it down to not having the correct runtime folder under bin (I was getting win-x64 instead of a osx-x64). I managed to solve that by manually building the WebWindows repo and copying the osx-x64/native/WebWindow.Native.dylib file under my bin folder (and also updating the .deps.json file)
@alexphi yeah I just cloned and built the whole repo, and the only project which runs straight after a build is the HelloWorldApp in testassets, the other's just don't get the .dylib file (although they do get the WebWindow.dll file) - seems copying it over manually makes them work...
So package 0.1.0-20191118.2
has all three runtimes in the nupkg, but 0.1.0-20191119.2
only has win-x64
. Downgrading to 0.1.0-20191118.2
on mac worked.
@distantcam @mika76 Thanks for spotting this, and sorry for the inconvenience!
This is fixed now - please try updating to the latest build 0.1.0-20191120.3
. The build now correctly inserts the native assets for all platforms.
I have the same error on Windows 10
System.DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies
I have Edge Chrome Beta and Dev installed and I'm using 0.1.0-20191120.6
I'm on Windows 10 2004 (Insider fast ring build 19033.1) and using .NET Core 3.0.1
Running my app under WSL2 works fine (with XWinrc) but never works on Windows 10
(BTW I don't have Visual Studio installed, just VS Code)
Also tried a publish I'm seeing the WebWindow.dll and WebWindow.Native.dll in my publish folder but the exe won't run (same error)
Same problem here on multiple machines, my main dev machine it runs fine on. It even fails on a machine with Visual Studio Code and running from source code. Only latest version of the library: 0.1.0-20191120.6
Installing "Build Tools for Visual Studio 2019 (version 16.4)" on the machines helped and it works fine. Installed the "MSVC v142 - VS2019 C++ x64/x86 build tools (v14.23)" which is mentioned by @Code-DJ
This must be fixed, perhaps the published package changed from release to debug again?
WebView: 0.1.0-20191120.6 .NET Core 3.1 Visual Studio 2019 16.4
When running any of the sample apps on Windows 10 I'm getting this exception:
System.TypeInitializationException HResult=0x80131534 Message=The type initializer for 'WebWindows.WebWindow' threw an exception. Source=WebWindow StackTrace: at WebWindows.WebWindow..ctor(String title) at VueFileExplorer.Program.Main(String[] args) in C:\repos\Karl Personal\WebWindow\samples\VueFileExplorer\Program.cs:line 14
Inner Exception 1: DllNotFoundException: Unable to load DLL 'WebWindow.Native' or one of its dependencies: The specified module could not be found. (0x8007007E)
Thank you for looking into this.