System.DllNotFoundException: Unable to load DLL 'WebView2Loader.dll' The specified module could not be found. (0x8007007E) - .net-5

We are using webview2 to launch browser window.
At design time webview2 is working fine and we see browser window, but at runtime webview2 is not getting initialized. For the design time only x64 Webview2Loader.dll working, but x64 webview2Loader.dll is not working for runtime, I manually copied x86 Webview2Loader.dll into nuget folder - still it is throwing same exception and not able to load Webview2Loader.dll.
.NET Framework = .net5
Webview2 version = 1.0.1072.54
"message": "System.DllNotFoundException: Unable to load DLL 'WebView2Loader.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2EnvironmentWithOptions(String browserExecutableFolder, String userDataFolder, ICoreWebView2EnvironmentOptions options, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environment_created_handler)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(String browserExecutableFolder, String userDataFolder, CoreWebView2EnvironmentOptions options)
at Microsoft.Web.WebView2.Wpf.WebView2.<>c__DisplayClass27_0.<<EnsureCoreWebView2Async>g__Init|0>d.MoveNext()

As written in the documentation in this paragraph Files to ship with the app the dlls of webview2 must be present in the application folder.
For .NET managed apps, you also need to include the WebView2 .NET
assemblies for the core WebView2 functionality
(Microsoft.Web.WebView2.Core.dll) and for the WPF/WinForms-specific
functionality (Microsoft.Web.WebView2.Winforms.dll or
Microsoft.Web.WebView2.WPF.dll).
Example managed app folder structure:
\<myApp>
\Microsoft.Web.WebView2.Core.dll
\Microsoft.Web.WebView2.Winforms.dll
\Microsoft.Web.WebView2.WPF.dll
\runtimes
\win-arm64\native\WebView2Loader.dll (arm64)
\win-x64\native\WebView2Loader.dll (x64)
\win-x86\native\WebView2Loader.dll (x86)

Related

Visual Studio 2017 and Windows App Certification Kit: test errors

I'm trying to publish my app on the Microsoft Store. When I run the Windows App Certification Kit I receive for each action an error related with Microsoft.Windows.SoftwareLogo.TestBase.
I'm using Visual Studio 2017 Version 15.9.3
Bytecode generation
Error Found: The bytecode generation test detected the following errors:
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Windows.SoftwareLogo.Tests.Utility.IsPackageWWA(AppXPackage package) at Microsoft.Windows.SoftwareLogo.Tests.BytecodeGenerationCheck.BytecodeGenerationCheck.ExecuteSharedValidation(String manifestFilePath, String packageFullName) at Microsoft.Windows.SoftwareLogo.TestBase.TestBase.ExecuteTest()
Impact if not fixed: As a performance optimization to accelerate JavaScript execution time, JavaScript files ending in the ".js" extension generate bytecode when the app is deployed. This optimization significantly improves start-up and ongoing execution times for JavaScript.
How to fix: You may need consider one or more of these steps to fix the issue:
- Avoid deploying the app by pressing F5 in Visual Studio, create an app package instead
- Ensure that event logging is enabled
- All JavaScript files are syntactically valid; otherwise exclude the respective files from the package
- Please note that you should uninstall all previous versions of the app before deploying
Otherwise exclude the respective files from the package.
I verified in my Visual Studio Installer and the Windows SDK in installed.
Also, I checked the targeting version of the project:
Target version: 1809 (10.0; Build 17763)
Min version: November Update (10.0; Build 10586)
There is not SDK for this build...

How to Fix: An assembly specified in the application dependencies manifest was not found:package: 'System.Data.SqlClient'

We are new to .Net Core and are trying to deploy our first application that uses it. We are deploying to a Windows server which has .NET Core Windows Server Hosting Module (2.2.0), the .NET Core Runtime (2.2.0) and I even installed the SDK (2.2.103) to see if that could solve the problem, which it did not.
Error:
An assembly specified in the application dependencies manifest (accesslog.deps.json) was not found:
package: 'System.Data.SqlClient', version: '4.5.1'
path: 'runtimes/win/lib/netcoreapp2.1/System.Data.SqlClient.dll'
So, here is my issue...the above error is being generated when we try to run a .NET Core application via the "dotnet filename.dll" method. We "publish" the application to generate all needed dependencies, or so I thought. The publish (and thus application) folder contain "A" version of this file (System.Data.SQlClient.dll), but apparently not the right one (version in publish path shows 4.6.26606.5), but yet that is the one being generated by Visual Studio.
Oddly, we also have an ASP.NET application on this same server which runs fine and references the same file.
Any help, guidance, troubleshooting steps, etc would be GREATLY appreciated.

Visual studio deploys wrong file

I have raspberry PI project on Windows IoT which have one main UWP app and couple .NET Standard 2.0 assemblies. Couple of assemblies have reference to HTTPnet nuget and this nuget internally have version for full framework, UWP and .NET Standard. In Visual studio when I expand Dependencies for HTTPnet it shows everywhere that it is using .NET standard but after deploy and run I have exception that HTTPnet.Netstandard.dll file is not found. After investigating RPI filesystem I noticed that deployed dll is HTTPnet.UniversalWindows.dll and HTTPnet.Netstandard.dll is missing.
The question is how to force using .net standard on deploy?
For now I added HTTPnet.Netstandard.dll to my UWP references but this is not good solution in long terms.

mfc120.dll missing for an application built in VS2013

I have a VC++ based application developed in VS2010 which uses some of the win32 component. I ported the code in VS2013 and I built the code after removing all compilation error in Release Mode. Now when I am trying to run the exe in Computer where VS2013 is installed it is working fine where as it is giving an error of mfc120.dll is missing where only VS2010 is installed. I don't think after building the code in Release mode I should get an error of missing dll. I have not tried to run the exe where no Visual Studio is installed.
If you are using the DLL version of the MFC you also need to install the corresponding VS-2013 runtime DLLs vsredist_x86
Or you switch to a complete static build.
I have found out the solution for this problem. Basically the win32 code I was building was using the Configuration Properties->General-> 'Use MFC in a Shared DLL' which I changed to 'Use MFC in a Shared DLL'. All working fine there after

Windows RT 8.1 Sharpdevelop Issue (MSB3644) (MSB3248)

I've signed the Windows RT Desktop version of Sharpdevelop, but I continuously get this error
Build started.
Warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
Error MSB3248: Parameter "SearchPaths" has invalid value "{CandidateAssemblyFiles}%3b
%3b
{HintPathFromItem}%3b
{TargetFrameworkDirectory}%3b
{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}%3b
%3b
{GAC}%3b
{RawFileName}%3b
bin\Release\System.winmd". Illegal characters in path.
Build failed. (00:00:01.5781253)
All I need to do is get the exe compiled. I can sign it separately.

Resources