Can't install Microsoft.Toolkit.Uwp NuGet package in WPF app - wpf

I'm losing my mind here trying to install the Microsoft.Toolkit.Uwp NuGet package into a WPF app (need the toast notifications and possibly some more stuff from UWP), but I always get the following error, no matter which version of the toolkit I'm trying to install and no matter which .NET version I target:
Could not install package 'Microsoft.Toolkit.Uwp XXX'. You are trying to install this package into a project that targets '.NETFramework,Version=ZZZ', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The weird thing is that Microsoft actually sends you to the Toolkit to do the exact thing I'm trying: get toast notifications from a WPF app, as can be seen here:
https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop
Excerpt from Microsoft's website
Tried downloading the NuGet package and install it from the local source, tried downloading the whole GitHub project, but to no avail. What am I doing wrong here, guys? I can't seem to figure it out.
P.S: I can't use UWP directly, because this will be an internal company app which needs to do lots of stuff not supported by UWP.

The documentation tells you to download the Notifications library. The Microsoft.Toolkit.Uwp package is not compatible with WPF but the Microsoft.Toolkit.Uwp.Notifications package is.

Related

Why does my Windows Application Packaging project think my solution is a net 6 solution?

My solution is a net 5 solution. I've been through all of the nuget packages to make sure they are all 'net5' compatible and checked that all the .csproj target frameworks do indeed say net5.0 yet when I go to package my application (MyProj.Installer - Windows packaging application) it shows me a warning:
Warning NU1702 ProjectReference 'C:\Users\rich-\source\repos\MyProjGit\MyProj\MyProj.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. MyProj.Installer C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 1718
I have no idea where it is getting .NETFramework,Version=v4.5.1 from as the oldest version my project has ever been is 4.7.2 but more to the point it thinks it is a net6 application when it is a net5 application.
It goes through and packages the app as an msix file and I can install it after signing of course however the app fails to launch and I believe the reason is down to the warning I describe above. Am I missing any steps for packaging a net 5 application? I've taken the exact steps I have for a net framework application that have worked in the past.
So the app not loading was two fold. The app primarily didn't load as Entity Framework core 5 is referencing the wrong version of SQL Client. See https://github.com/dotnet/SqlClient/issues/652.
The second reason why the app wouldn't load was because the msix was trying to access a file I had open on another networked computer. See the section common problems https://learn.microsoft.com/en-us/windows/msix/packaging-tool/tool-known-issues.
Still no idea why the packaging project think it is net6 howwever.

Incorporate react scheduler into my existing web application

I am very new to React, so please bear with me. I have an existing web application created in Visual studio 2017. It's not MVC project. I have found this react calendar
https://github.com/hiramzamorano/react-big-scheduler
And I would like to use it with my project. But I am not sure how to reference the library. Firstly, this link tells me how to add React library to my page
https://reactjs.org/docs/add-react-to-a-website.html#add-jsx-to-a-project
Now I am stuck when I keep reading the calendar documentation about running:
npm install scheduler-react --save
After running the command, literally there are hundreds of files being saved into node_module folder. How could I reference them all? A lot of tutorial online for React and Visual Studio is mostly related to MVC project. I could not find much information dealing with web application.

How to access UWP devices from C# Winforms App in .Net 5

I downloaded some great code from https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/barcodescanner/ which accesses my barcode scanner really well . I would like to use this functionality from within a Winforms app but I can't seem to load the right library. If I just add the nuget package I get the following error:
Error NU1202 Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with net5.0-windows7.0 (.NETCoreApp,Version=v5.0).
Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
Any thoughts/help is appreciated.

How to I update my React version in the ASP.NET Core React/Redux template project?

I've started learning React with Redux and part of my development has seen me want to use the Material UI to make my application more interesting. I created my project in Visual Studio 2017 using the React with Redux template for ASP.NET Core.
I followed the documentation presented at the MatrialUI site and opted to use the CDN option for delivery of the MaterialUI library.
I started creating a few elements and was quickly confronted with the message that I needed to upgrade my react installation to use the Toolbar.
My question is, when we use the Visual Studio React/Redux ASP.NET Core template, how do I update my react installation? Is that carried out via NPM? I can't see any nuget packages relating to React.
Many thanks
Hey not sure if you found an answer yet but here is my take:
I tried using npm update inside the "ClientApp" folder, but that didn't seem to work. Something that did work though was manually updating each package. So open up a separate terminal -> cd into the ClientApp directory and then
npm i <package name>#<newest version>
so an example would be
npm i react#16.8.6
Some packages you will definitely need to update are React, React-DOM and rimraf. But you might choose to just update all of them while you're at it. When you're using ASP.NET Core try and go for the 2.2 version, which at least already has Bootstrap 4 installed.
Another tip: With Visual Studio, if you hover over the package names in the package.json file inside, it will show you the latest version. That's gonna make it a bit easier to find out what version you want to update to.
Hope that helped! And if anyone has a better solution please let me know.

SimpleIoc missing from MVVM Light Nuget package

I'm unable to find the SimpleIoc type within the Nuget MVVM Light assemblies for WP71 has it been removed
Which version of MVVMLight did you install?
From what I understand, SimpleIoc is only available in the MVVMLight 4 preview package. It wasn't included in MVVMLight 3.
I verified that it's available in the MVVMLight Preview by installing the package in a demo project and opening the .dlls in ILSpy.
Probably a better place to ask would be on the project's site:
http://mvvmlight.codeplex.com/workitem/list/basic
*EDIT
It seems like the NuGet package you installed was for V3.
Check this post: http://blog.galasoft.ch/archive/2011/12/18/mvvm-light-installers-and-nuget-including-silverlight-5-mvvmlight.aspx
You should probably install "MVVM Light [Preview]" if it becomes available, but I do not see it now.
For now I think you will need to do without NuGet and just install it manually or get the sources.
Here is the link to get the installer:
http://mvvmlight.codeplex.com/releases/view/73208

Resources