WebView2 browser don't load the webpage, just a white window is shown - vb.net

I have built a program in Visual Studio 2019 where I use WebView2 as a browser. When I test the program on the computer where I have VS 2019 installed, it works as it should. But when I test it on another computer, I only get a white box. What am I doing wrong?
In VS 2019, I select "Build> Publish [My file]> Folder>" and click on "Publish". I copy the files and the "runtime" folder to another computer.
I have installed both "windowsdesktop-runtime-5.0.10-win-x64.exe" and "windowsdesktop-runtime-5.0.10-win-x86.exe" on the computer where it does not work.
Dim filePath1 As String
filePath1 = "https://stackoverflow.com/"
WebBrowser.Source = New Uri (filePath1)

To distribute your application that uses WebView2 you'll need to additionally distribute the WebView2 Runtime.
You can either use the evergreen installer which will install the runtime on that machine including an updater that will keep the runtime up to
date or you can use fixed version in which you ship a copy of the WebView2 Runtime with your application and you are responsible for keeping it up to date. You can read more about these options in the WebView2 distribution documentation

I had a similar issue after upgrading the WebView2 Runtime. Problem was eventually solved by deleting the C:\users<name>\appdata\local\EBWebView cache contents.

Related

XAML Designer System.Runtime.Remoting.RemotingException

I'm encountering the following
System.Runtime.Remoting.RemotingException error when I create a blank
Windows 10 Universal Application...
Following are event viewer screens...
I have checked online for other solutions and have already done the
following...
Uninstall/Repair Visual Studio 2015 Update 1
Reset my Windows 10 PC 1511 update
Cleared the Designer/ShadowCache folder
Target environment has been set to x86/x64
Target framework set to 10240
Developer mode enabled
Updated graphic drivers
Have cleaned and rebuilt solution
Updated to VS15 Update 2
Please let me know if you have been able to find a solution to the above
UWP applications fail to launch from Visual Studio if project location and Windows Store apps installation path are on a non-default drive. Also, the XAML Designer will crash if you install Visual Studio and Windows Store apps to a non-default drive
Windows 10 allows users to change the default storage location of Windows Store applications. If you select a non-default drive for your apps, and if you install Visual Studio 2015 onto this drive, the XAML designer will not start and Windows Store app projects built on this drive cannot be run from Visual Studio.
Note: the workaround below will make any Store apps installed to the secondary drive inaccessible until next restart.
The file system driver can be temporarily disabled by running the following command from an admin command prompt:
fltmc detach filecrypt :
This will enable both running apps from this drive as well as usage of the XAML designer until the machine is restarted.
For a longer term fix, move your app or Visual Studio install to your system drive, or a secondary drive that has never been the storage location for Windows Store apps.
I had the same problem. I started visual studio as an administrator and the designer came back.
You might want to try to clear the XAML Designer Shadow Cache. I've fixed al sorts of ailments with this process.
Its been a few months but I have finally been able to get the XAML Designer to work.
As #peterfaraday mentioned, the XAML Designer only works if you install Visual Studio on the System Drive (C: in my case) instead of using any other drive.
After uninstalling Visual Studio keep the following things in mind...
If your system partition is small, look to increase the space as the installation can take a lot of space based on the components selected.
If you had already installed VS on any other drive, while reinstalling you will not be able to change the default installation directory.
This is because your initial path of installation was saved as in the registry. I tried solving this issue by following these steps. In my case I had found multiple keys in the registry and hence "Reset this PC" (Windows 10) by allowing only for my personal files to remain. This cleared out all the registry keys and I was able to install VS back on the C: drive, resulting in the XAML Designer finally working (Please note that resetting your pc will remove any applications installed on your machine)
I got the same problem months ago. I Cleared the cache and Rebuild the solution. I got success.

Visual Basic SaveDialog missing dll

I have written a user interface in Visual Basic that sends commands to AutoDesk Inventor to create 3D CAD assemblies. Towards the end of my program, the CAD file is saved and a SaveDialog box comes up. It was working perfectly fine for a while, but now there is an error. Here is the relevant code segment:
SaveDialog.Filter = "Inventor Part | *.ipt|Step File | *.stp"
SaveDialog.DefaultExt = "ipt"
SaveDialog.ValidateNames = True
SaveDialog.ShowDialog()
On the last line shown, I get a run-time error as follows:
"The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is
missing from your computer. Try reinstalling the program to fix this
problem."
After closing this error message, the SaveDialog box comes up anyway and works perfectly fine. Of course, on the compiled version the error box never actually shows up and the program simply hangs up indefinitely.
I have search for solutions to this problem for two days. I used Dependency Walker and found a list of other dlls that are reportedly missing, most of them under the MSHTML.DLL
I figure there is probably something that is not referenced correctly in my program, but I'm not sure where to look. Thanks for any help!
The problem is that the KB2999226 (Universal CRT) which is part of the Visual C++ Redistributable failed to install. Is your automatic updates turned OFF?
Solution
Install Windows Updates:
Go to Start - Control Panel - Windows Update
and click on Check for updates. Install all available updates. After the updates are installed, restart your computer. After the restart repeat the steps above again until no more updates are available.
Download the Visual C++ Redistributable:
For Windows 64-bit
http://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe
For Windows 32-bit
http://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe
Run the vcredist_x64.exe (64-bit) or vcredist_x86.exe (32-bit) and select Uninstall. Run the .exe again and select Install

the application requires that assembly microsoft.reportviewer.processingObjectModel version 11.0.0.0 be installed in the global assembly cache first

I have a small windows forms application created in Visual Studio 2012 that uses ReportViewer version 11.0.0.0.
The application target framework is .NET 4.0 and its deployment method is ClickOnce
On my PC it installs but on client machines, intallation fails with error
the application requires that assembly microsoft.reportviewer.processingObjectModel version 11.0.0.0 be installed in the global assembly cache first.
On the client machines, i have installed
.NET 4.0
ReportViewer 2010
Microsoft Report Viewer 2012 Runtime CTP
SQLSYSCLRTYPES.msi
in the project application files settings, i have set microsoft.reportviewer.processingObjectModel publish status to Include(Auto), in the references i have also set its Copy Local property to True.
what am i missing?
I have even followed the instructions here http://msdn.microsoft.com/en-us/library/ms251723.aspx
Here is (arguably) the best way to deal with this issue... without downloading or installing any extras. This worked with Visual Studio 2012 (Ultimate)
Goto the main project within your solution(default/statup project)
Right Click and Click Properties / Select "Your Project">> Project>> Properties
Click on "Publish" Tab to see publishing options
Goto "Install Mode and Settings">> Click "Application Files" and Dialog opens
Go down and look for the items set with "Publish Status" > Prerequisite
You will find ReportViewer and Several Other Files set to Prerequisite
Change all the Publish Statuses to "Include" in the drop down
I know you only need the ReportViewer Only but this will eliminate other potential problems I came across
Now all the required files will be added to your installation setup good to go!
For interest, you can change include a desktop icon under "Install Mode and Settings">>Options>Mainfests>Create Desktop Short Cut
you are missing the ProcessingObjectModel.dll file find the version 11.0.0.0 in gac assembly C:\windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel and add it to bin dir.
We had the same issue, but the thing is, its automatically adding it to the references (microsoft.reportviewer.processingObjectModel), if u EXCLUDE it from the publishing properties(properties->publish->application files), It might fix it.
A better option would be to install the Microsoft Report Viewer 2010 SP1 Redistributable Package at:
http://www.microsoft.com/en-us/download/details.aspx?id=6610
Your users will need to have this package installed as well. If you just copy and paste a MS DLL, you'll have to redeploy it every time you upgrade your application.
If you are using WinForms, to me it seems pointless to worry about installing this DLL in the GAC when it's being used for a report viewer that is deployed via click-once. This isn't a big file and you're probably using it as a report viewer control on a form, nothing more. One possible solution is to do the following:
In Visual Studio, go to the reference in your project for the assembly Microsoft.ReportViewer.ProcessingObjectModeland locate the file path to the folder for that assembly. Mine was version 12 and so my file path was C:\windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\12.0.0.0__89845dcd8080cc91
Copy the file path of the folder the assembly is in and remove the reference from your project (right click the reference and select "Remove").
Win + R to get a 'Run' prompt. Paste that folder path in there and execute to jump right into the folder of that DLL.
Find the DLL, it should be the only file in that folder, and copy it to your Visual Studio project folder. You shouldn't care about 100kb of extra space on your drive consumed, and I don't think this DLL is one you'll need to update.
Back in Visual Studio, right click References, Add Reference, and browse for that DLL in your project folder. After adding the reference, make sure that the Copy Local property is set to true.
Clean and rebuild, test the application on your local computer, than Deploy your ClickOnce again.
Now when users install your application with ClickOnce, the reference will not refer to the GAC at all and there won't be any need to rely on the prerequisite check/installation process for this DLL because you have included it directly in your published application.
It depends on the setup type you are using but basically, it means the required library is missing from your server or computer. To enable the application to download from the server (In a client-server architecture), you need to include the file(s) in the project.
Go to your application option and locate the "Publish" tab
Click on "Application files"
In the ensuing dialog, select to include all the libraries you want included (or that are required to run your application on the client machine and click "Ok")
Build your application and then publish to the server.
I hope this works for you, it worked for me in Visual Studio 2010 Professional
In case of Windows 10 it won't work installing Microsoft Report Viewer 2010 SP1 as describe by user1236560. First you need to install Prerequisites for SQL Server Management Objects (SQLSysClrTypes.msi) need to choose between x86 and x64 depending on your hardware. You could find it on: http://origin.www.ms.akadns.net/downloads/en/details.aspx?FamilyID=16BC778C-357B-46E9-8356-D575903AC831
After that you need to install MICROSOFT® REPORT VIEWER 2012 RUNTIME that you could find on: https://www.microsoft.com/en-us/download/details.aspx?id=35747
Both of this package will have to be installed.
I encountered this error
System Update Required
Unable to install or run the application. The application requires that assembly
Microsoft.ReportViewer.ProcessingObjectModel Version 11.0.0.0 be installed in the Global Assembly Cache (GAC) first.
Please contact your system administrator.
this error popped out when installing an application made from Visual Studio
meaning I am one of the client
I have Visual Studio 2015 and a Microsoft SQL Server 2014 and didn't know about Crystal Reports and other related stuff to it. I do check the version of my .NET Framework which is version 4.6.2.
I have several extension files and distributable files downloaded and yet doesn't solve my problem.
I do not know if I solve the problem generally but I do become successful in installing the application
so I downloaded and installed the ff:
SAP Crystal Report for Visual Studio 2015(latest, just to make sure)
Microsoft System CLR Types for Microsoft SQL Server 2012
Microsoft Report Viewer 2012 Runtime.
the problem took me about 2 days to trouble shoot, Be careful on downloading and installing extension files and distributed files cause it will munch some space too.
The Best answer is:
Here is (arguably) the best way to deal with this issue... without downloading or installing any extras. This worked with Visual Studio 2012 (Ultimate)
Go to the main project within your solution(default/statup project)
Right Click and Click Properties / Select "Your Project">> Project>> Properties
Click on "Publish" Tab to see publishing options
Go to "Install Mode and Settings">> Click "Application Files" and Dialog opens
Go down and look for the items set with "Publish Status" > Prerequisite
You will find ReportViewer and Several Other Files set to Prerequisite
Change all the Publish Statuses to "Include" in the drop down.
I know you only need the ReportViewer Only but this will eliminate other potential problems I came across
Now all the required files will be added to your installation setup good to go!
For interest, you can change include a desktop icon under "Install Mode and Settings">>Options>Mainfests>Create Desktop Short Cut
It reduced all of my head aches.

How to detect if MS Runtime or Office is installed on computer on application stratup?

I have a WinForm program developed in VB.Net with Visual Studio 2005. The program needs Microsoft Office Runtime installed atleast on the computer to allow the application to run without any errors.
Is their a way to check the computer to see if the minimum of the Runtime or Microsoft Office is installed on the computer? If either isn't I would like to display a message to the user on the startup of the application that states to atleast go to Microsot's site (I have full link to Runtime Download) and download the runtime for free.
Or is their a way to include the runtime as a component with my install for the application so if it isn't installed on the computer already it will install when the application is installed?
Thanks
If you more specific details please specify the exact runtime you are interested in. Office has lots of them.
For a launch condition you can try this approach:
select your setup project in solution explorer
go to its Launch Conditions Editor
create a registry search which determines if the runtime is installed or not
create a new launch condition
add the registry search property as the condition
This way the installation stops and shows the message you specify if the search doesn't find anything.
Another approach is to include the runtime as a prerequisite:
select your setup project in Solution Explorer
right-click it and select Properties context menu
click Prerequisites button in the property page
check the prerequisite you want
If the prerequisite you want is not in this list, you will have to configure it manually.

My VSTO 3.0 Outlook addin doesn't load

I'm trying to diagnose why my Outlook plugin written in C#/VSTO 3.0/VS 2008 doesn't load after being installed.
The plugin works awesomely on my development machine, which has Visual Studio 2008 installed. I can't expect all my users to have all the prerequisites though so I went through these steps to write an installer:
http://msdn.microsoft.com/en-us/library/cc563937(loband).aspx
I installed the add-in on a fresh Windows XP SP 2 machine with a fresh install of Outlook 2007. It installs all the prereqs ok (.NET 3.5, VSTO 3.0 runtime, Windows Installer 3.1, 2007 PIAs). Outlook starts but the add-in isn't run. If I go to the Add-ins tab in the Trust Center, I see my add-in in the "Inactive Application Add-ins" section with the message "Not loaded. A runtime error occurred during the loading of the COM Add-in.".
Not sure how to find the specific error so I can fix it.
The reg keys look ok. Under HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\BlahAddin I see Description, FriendlyName, LoadBehavior (set to 3 until it fails after which if becomes set to 2), and Manifest.
Tried the VSTO_SUPPRESSDISPLAYALERTS environment variable trick and then launched Outlook from the command line but no output came out.
I have remote debugging more or less working but I'm not sure what to look for. I don't see my DLL loaded when I attach to Outlook, but then again maybe managed DLLs don't show up the same way in VS.
Any other ideas on next steps I could follow to produce a specific error I can diagnose?
Solved my problem after weeks of pain. The "Manifest" reg key was getting corrupted to some junk value during the setup build. It was a known Visual Studio bug that supposedly got fixed in Visual Studio 2008 SP 1, but apparently wasn't for me. Renaming the project name to be different from the plugin name fixed the problem. Random, huh?
Make sure you have try-catch handlers at the top level of all methods called by Outlook and log any exceptions you are unable to handle in some way. Focus your troubleshooting on methods like the Startup method and other methods called during initialization.
You probably want to debug this using the remote debugger. Share out the MSVCMON.EXE folder from your developer machine (in your Visual Studio folders in Program Files) on your test machine (share it with a UNC path), and launch Outlook under the debugger trapping (.NET) exceptions in your modules and putting breakpoints in your methods.
If you need to clean your test computer each time before you install your solution, you should probably run XP under a Virtual PC 2007 VM (free download) and switch to a differencing HD after setting up everything but your plugin to snapshot your pre-installed state once so you don't have to keep uninstalling/reinstalling as you make changes to your program to fix bugs.
Are you installing Debug builds or Release builds? Perhaps one flavor has different requirements. Just guessing.
-Mike [MSFT Office Dev]
On your machine, when you run the addin from Visual Studio, it should create a registry key in HKEY_CURRENT_USER\Software\Microsoft\VSTO\Security\Inclusion{SomeGuid}. Make sure that these registry settings are also being deployed with your addin. They are the ones that allow your code to be trusted.