Add System.Web Reference To A Windows 10 Universal App - c#

I download a project on Gitgub Basically is a Console Application.
But I want to translate this C# Console Application to a Universal Windows App.
I want to use HttpUtility.UrlEncode in a windows 10 universal, but I can not find System.Web in .NET (Add Reference) How can I add this assembly to my project?
Error: The "HttpUtility" Does not existin the current context.
Im using Visual Studio 2015
I try with this question:
How Add System.Web Reference To A Windows Form Application
But doesnt work for the Universal 10 app.
Thanks in advance!

The System.Web assembly is a huge monolith that Microsoft themselves seem to be moving away from.
Usually, for any functionality found within System.Web, there's a modern equivalent that can be found elsewhere.
In this case, you'd be looking for WebUtility.UrlEncode instead, which is found in the System.Net assembly and is listed as supported on the Universal Windows Platform.

Related

How to fix "System.Management is supported on Windows Desktop Apps only" Exception

The Issue:
Our application is a .NET 5 Windows Desktop application. The licensing capability requires the application to use the System.Management component from NuGet to create a unique device ID from the system processor ID, MAC Address and BIOS serial number.
This all worked great when testing it from Visual Studio debugger. However, when adding System.Management.dll to the application installer (InstallShield installer) I naturally selected the version of System.Management.dll that was in the app's build target folder. It turns out that the version of the DLL that ends up in that folder is a no-op version that throws not supported exceptions saying "System.Management is supported on Windows Desktop Apps only".
The Solution:
I found the correct version of System.Management.dll in the build TargetFolder\runtimes\win\lib\netcoreappX.x folder. In my case, since I'm using System.Management version 6.0, it is in the "netcoreapp3.1" folder.
Conclusion
There are many cases where Microsoft doesn't do the right thing. In this case, my application was specifically a .NET 5 Windows Desktop application, so we would all think that msbuild could figure out the correct thing to do. Not so. In such a case, I would have at least hoped that .NET Foundation would have provided information on this. Well, now you all know now, as well!
Cheers

Is there a project type for classic assembly + universal Apps

I'd like to create a small Web-Service on my Raspberry Pi2, which uses the Project Types "Universal Windows".
The Problem is, I'd like to contact this Web-Service via an App running on my PC. Since this is using the LyncSDK, it has to be a Classic Windows App.
My problem: I'd like to have a shared Model-Assembly to assure I use the same Objects for the Serialization.
In this Assembly I'd need to use the Windows.UI.Color-Enum: https://msdn.microsoft.com/en-us/library/windows/desktop/bb189018.aspx
The closest Project-Type I found so far, was the "Class Library (Portable for iOS, Android and Windows), but I can't use the mentioned Enum.
Is there some Project, which bridges this Gap? The other Workarround I see so far is to save the RGB-Values.

How do I include a timer in a universal windows app with c#

I need a timer in my universal windows app. I have read that the only one available for universal windows apps is System.Windows.Threading.DispatcherTimer. In order to use this I manually added the WindowsBase.dll to my app's references in the solution explorer in visual studio. Now I get the following error:
Error 3 Cannot find type System.ComponentModel.TypeConverter in module System.dll. Game.Windows
The error goes away if I delete the WindowsBase reference. What am I doing wrong?
The assemblies you can add to a Universal app are listed in the Project + Add Reference, Assemblies, Framework list.
Yes, it is empty.
That was intentional.
Because you already have a reference to all possible .NET assemblies in a Universal app project. Using the Browse button is not a workaround. And causes the kind of misery you describe, WindowsBase has types that can only work in a WPF app. The kind that runs with the full .NET Framework you've got installed on a desktop. Not the kind that a user has on his phone, called .NETCore. It is small, phones are small.
You already have the Windows.UI.Xaml.DispatcherTimer available in a Universal app project, no need to add a reference.
I think the one that windows store apps use is located in Windows.UI.Xaml namespace
I have been using ThreadPoolTimer, in Windows.System.Threading.

Mix two .NET frameworks in Windows Mobile 8

I am creating a Windows Phone application with Visual Studio 2013 Premium.
I have an older version of this project built for the old Windows Mobile platform.
The old project contains proxy classes used with the "Add Service Reference" functionality, ie classes and references from a WSDL file.
The new Visual Studio 2013 does not give the capability to add web service reference, unless you specify an older .NET framework.
My question is the following: Can I combine somehow the new UI capabilities with my old code?
Is it possible for a example to have a dll with the old web references (.NET 3.5) and link it with a project with target the "Windows Mobile 8"?
Windows Phone 8 available APIs don't allow you to handle anything about connection parameters, so proxy address as well.

use Reactive Extensions (Rx) but can't Found System.Observable.DLL File in Windows phone Application?

well.
i was use Reactive Extensions (Rx) package async Request,Before you can start writing code you need to include the two dll’s required for reactive programming in Windows Phone.
it was:
using Microsoft.Phone.Reactive
using System.Observable
But i can't found System.Observable.DLL file in 。Net Framework 4?
anybody have some suggestion?
The references you need should be installed with the Windows Phone SDK. If you select "Add Reference" in a Windows Phone project you should see System.Observable and Microsoft.Phone.Reactive in the .NET tab. It's important you reference these assemblies as they match the ones already installed on the phone and therefore reducing the size of your application.

Categories

Resources