cannot add cefsharp to wpf - c#

I installed cefsharp using nuget
and followed the tutorial on the link below
https://www.codeproject.com/Articles/881315/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part
but i can't make it work.
currently im using .net framework 4.5.2
i also build the program. i can also run the program, but it doesn't show the webbrowser.
i also add the namespace: xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
the screenshot of the error is below

This error only occurs when you have opened Visual Studio WPF designer (wiki CefSharp). When you run program everything will be ok.

it seems you didn't added referecnces to your project, first add references and then include them into your code.

Related

WinUI 3 xaml ABI.Microsoft.UI vs Microsoft.UI

I'm trying to use WinUI (3) for the first time.
I've followed the instructions at https://learn.microsoft.com/en-us/windows/apps/winui/winui3/#install-winui-3-preview-4 so installed vs 2019 preview (Professional Version 16.9.0 Preview 4.0) and installed the "WinUI 3 Project Templates via the Manage Extensions option.
Created a new solution, added project type "Blank app, Packaged (WinUI in desktop)" (C#) and this is the result:
I can start debugging and the window opens and can click the example button without any issues.
But when I open the xaml I have this issue:
And the intellisense doesn't give options like for example grid.
The imported namespaces in the code behind:
So all the basics of a new WINUI project on a clean vs 2019 preview installation. I've only installed Resharper and imported my settings from my regular vs 2019 installation (which I reset but to no avail).
When I choose for Microsoft.UI.Xaml.Window he changes the xaml to
And gives following errors:
When choosing ABI.Microsoft.UI.Xaml.Window the xaml changes in the same way as before but also gives exceptions on other properties like "The property 'HorizontalAlignment' was not found in type 'StackPanel'".
No idea if this matters but as I've never worked with WPF I don't have experience with xaml (always worked with winforms as frontend). So I also added a WPF project to this solution and this worked without any issue.
I can't find anything regarding this so please help me set my first steps in WINUI.
I've notificed it worked for a few seconds after reopening my solution. So prime suspect was Resharper. Disabled it, and problem is solved. Re-enabled it, updated to 2020.3.2 and it worked.
So lesson here: It's not because you just installed Resharper, that it also downloads the latest version ...

Visual Studio acting like a reference is missing, but it is clearly there,

I am using Visual Studios 2015 Community.
I was given this code to work on and improve, and I cant get any thing from MetroFramework to behave properly. This is my first time using VS, but my research has been extensive, and I am very stuck. Any time I try to open up a design, I am met with many many errors that you can see in the gallery.
So naturally I follow up and check my references. The references in this project clearly show MetroFramework.
And furthermore, Metroframework.Controls clearly shows the components it says are missing. I would post the pictures, but SO only lets me put two links right now.
What am I missing here? This is the first time I've found a problem I cant solve looking at answered questions, and I hope you all can help. Thank you.
Edit: I have metroframework in both my references node and in the header of my code. VS does recommend I remove it from my header, as it says it is not being used, but it is being used, its just throwing the errors.
I also seem to get a setup error, and I am not sure that I had it before. Image in gallery.
All images are in the folowing gallery.
Imgur Link
Visual Studio sometimes acts up. Try any of the following:
Building the solution even with errors. This can get NuGet packages to refresh and that may be your problem.
Cleaning the solution and then building.
Restarting Visual Studio.
You have the wrong project installed. To fix your problem install Metro Modern UI - Metro Framework by Dennis Magno from NuGet (I assume that's the correct one because it has MetroGrid and MetroDateTime). If you use gui search for metromodernui in search box, or execute this
Install-Package MetroModernUI
For the record
Here is original project which you probably had installed (now so that I looked at last screenshot). Installed using:
Install-Package ModernUI
Here is another project you don't want to install (I thought you had this one originally) because it also doesn't have neither of those controls. Installed using:
Install-Package MetroFramework -Version 1.2.0.3
Here is the project you probably want to install to resolve errors.
Install-Package MetroModernUI
"Conveniently", they all use the same namespace MetroFramework, hence the confusion.
Right click on the References folder on your project.
Select Add Reference.
Select the .NET tab (or select the Browse button if it is not a .NET Framework assembly).
Double-click the assembly containing the namespace in the error message.
Press the OK button.
Try this command from your Package Manager Console
Update-Package

c# missing namespace Windows

Visual Studio 2015 Community can not resolve
using Windows.Networking.Connectivity;
I tried different types of c# projects and different .Nets 3.5-4.5
This namespace is only available for Universal Windows Platform (UWP). As you can see it here: https://msdn.microsoft.com/library/windows/apps/br207308
I understand this question is very old, but I would like to help people who have the same issue as me. Contrary to Nasreddine's answer, it IS possible to get the windows namespace on platforms other than UWP.
To get the windows namespace, you must first unload your project in whatever IDE you are using. After that, open your .csproj file in your text editor. You should see and opening and closing <PropertyGroup> somewhere in the file, inside of there paste in the following line: <TargetPlatformVersion>8.0</TargetPlatformVersion> Save the file, then (re)load your project in your IDE. Right click on Refrences, and click Add Refrences. There should be a new Windows Tab, and inside of that, Core. (This would not appear without doing the previous steps.) You may or may not have a refrence option inside of there named Windows, if you do check the box, and you can now use the Windows namespace, if not, fully close your IDE, and install the Windows 8 SDK from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/, Once you have done that, start back up your IDE, and you should see the Windows namespace. If some some reason, you still do not see the namespace, click browse, and navigate to C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\ and select Windows.winmd.
Additional information: https://software.intel.com/content/www/us/en/develop/articles/using-winrt-apis-from-desktop-applications.html
Just to update in 2021, you can gain access to this api (and others) with the Microsoft.Windows.SDK.Contracts nuget package. You'll still run into issues in .NET 5, but .Net Core 3.1 works fine.

add ImageListView control to my toolbox in VS2010

I am trying to add ImageListView in my toolbox of VS2010 ,but I am not able to do so . When I right click on toolbox window -> choose Item option their I can see ImageListView checkbox selected ,I have also added ImageListView.dll file in my project folder but still nothing is working ,what can be the solution to fix this issue
I found the same problem while adding imagelistview.dll in my project. Finally I solved the problem with some solution.
Check your target framework in your project properties. If it is .Net Framework 4.0 client profile then change it to .NetFramework 4.0. And rebuild your project once. Then it will work fine.
ImageListView is now part of the NuGet Package Manager
Install it via the link, and go through the Visual Studio Extension Manager
http://docs.nuget.org/docs/start-here/installing-nuget.
When this is downloaded and installed, open your project solution and you should now see the Package Manager Console down the bottom. You the following link to add the tool to your solution:
http://www.nuget.org/packages/ImageListView/

Can't compile/use ObjectListView in VS 2010

I want to use ObjectListView in a project coded in VS 2010.
Therefore I did the following things:
Downloaded the project
Opened both ObjectListView.sln to convert it to a VS2010 project
Added one of them to my project-folder in VS 2010
Added the project-assembly to my project
Added the namespace xmlns:o="clr-namespace:BrightIdeasSoftware;assembly=ObjectListView"
It compiles but it doesn't find any of its classes in my project. That means after entering the namespace: "
Does anyone know what I can do about that?
The ObjectListView project in the solution is missing "Filters.cs". It's located in the directory, just not added to the project.
Add it to the project, and everything will build (using VS2010, and ObjectListView.sln).
EDIT:
It looks like you're creating a WPF project. ObjectListView is intended to be used in WinForms applications.

Categories