Code Monkey home page Code Monkey logo

windows-desktop's Introduction

Windows Desktop Application Modernization Guidance

This repo contains information to help you modernize your .NET desktop applications. We are prioriizing the following high level topics to document and provide samples, but feel free to suggest new topics in our issues section.

Porting WPF and WinForms apps to .NET Core 3

Samples, options, tips and tricks to convert WPF and WinForms projects based on .NET Framework to .NET Core 3.

Using Windows 10 features in WPF and WinForms apps

Windows 10 include a number of APIs that are accessible from Windows 10 SDKs. You can use these APIs in .NET apps by using the Microsoft.Windows.SDK.Contracts NuGet package. More information

Data Access

ADO.NET can be used in .NET Core 3 applications, however not all data source providers are available.

We have plans to support Entity Framework 6 in .NET Core, and Entity Framework Core is already supported.

Other non-relational data stores (such as CosmosDB) are also available to .NET Core.

Connecting to Services

WCF has been partially ported to .NET Core 3; however, there is no support for WCF server. WCF clients features are documented here. Additional services that support .NET Core will be included as well.

Deployment

.NET Desktop applications can be deployed with MSIX. To create MSIX packages you can use the Windows Application Packaging Project available in Visual Studio 2019.

Note: To package .NET Core 3 applications you must use Visual Studio 2019 Update 1 Preview or later.

Known issues

  • AppDomains
  • Remoting
  • WCF Server
  • WCF Client supported features
  • Non-String Resources

Samples

  • BeanTraders
  • WPF Concepts
  • Memory Game

windows-desktop's People

Contributors

fredrikhr avatar kevinlams avatar mjrousos avatar rido-min avatar ridomin avatar terrajobst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-desktop's Issues

[SDKContracts] ApplicationData.Current.LocalFolder

I'm trying out Microsoft.Windows.SDK.Contracts v10.0.18362.2002-prevew on a .NET Framework 4.8 Windows Forms app and can't seem to get past this exception for code like below

private async static void Test()
{
        StorageFolder localFolder = ApplicationData.Current.LocalFolder;
        StorageFile sampleFile = await localFolder.GetFileAsync("dataFile.txt");
        IPropertySet values = ApplicationData.Current.LocalSettings.Values;
        //…
}

I've attempted adding System.Runtime, System.Runtime.WindowsRuntime, System.Runtime.WindowsRuntime.UI.Xaml and downgrading specifically to 4.1.2.0

Exception:

Could not load file or assembly 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

ArgumentException when calling GattDeviceService.GetCharacteristicsAsync

Hallo everyone, I'm currently playing around with Bluetooth LE and observing this strange behavior when probing a device and calling GattDeviceService.GetCharacteristicsAsync on a service:
System.ArgumentException: 'Value does not fall within the expected range.'

My code:

var serviceId = Guid.Parse("04313ed3-8c7e-4e2e-9771-a415cd2b4623");
var bleDevice = await BluetoothLEDevice.FromBluetoothAddressAsync(228844339811492);
var gatt = await bleDevice.GetGattServicesAsync();
var service = gatt.Services.Single(e => e.Uuid == serviceId);
var accessStatus = await service.RequestAccessAsync(); // Allowed
var openStatus = await service.OpenAsync(GattSharingMode.SharedReadAndWrite); // Success
var characteristics = await service.GetCharacteristicsAsync(); // Crash

Using the Android BLE Scanner app I can clearly see the service and related characteristics:
image

I can also reproduce this issue when using the Bluetooth LE Explorer Windows app which is using the same API:
image

I can probe other devices (eg. my Bluetooth mice) without any problem so something must be special here.

I'm using the .NET SDK 6.0.400 with a console application targeting net6.0-windows10.0.19041.0 from within Visual Studio 2022 17.3.1.
I tested it on a Windows 11 (22000.856) notebook with an embedded Intel Bluetooth card and a Windows 10 (19044.1889) desktop using a generic USB Bluetooth dongle.

readme.md for project should be updated to point at latest information for consuming Modern Windows APIs from .NET

The readme.md for the project is outdated and doesn't contain information about later versions of .NET and how to consume Modern Windows APIs. This can result in compilation errors, runtime errors, etc. Search engines also point to this Website as a way of calling Modern Windows APIs.

Suggestion: update the readme.md to point to: https://github.com/MicrosoftDocs/windows-dev-docs/blob/docs/hub/apps/desktop/modernize/desktop-to-uwp-enhance.md. The documentation available there breaks down how to call Modern Windows APIs from various versions of .NET.

Using UI Automation without installing Desktop Runtime

Hi,
We need to use UI automation, and in order to run this code (just a simple example):

static void Main(string[] args)
{
   AutomationElement currentProcessWindow =
      AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition)
          .OfType<AutomationElement>()
          .Single(a => a.Current.Name.Contains(Process.GetCurrentProcess().ProcessName));

   Console.WriteLine(currentProcessWindow.Current.ControlType.ProgrammaticName);
}

we need to reference Microsoft.WindowsDesktop.App.Wpf:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <FrameworkReference Include="Microsoft.WindowsDesktop.App.Wpf" />
  </ItemGroup>

</Project>

This requires to install Desktop Runtime on the machine.

Regardless of the reason, is there a way to use UI automation without having to install Desktop Runtime?

Thanks.

Netfx solution does not start

when running BeanTraderServer (clicking "Start" in Visual Studio), I get:

System.ServiceModel.AddressAccessDeniedException: 'HTTP could not register URL http://+:8080/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

when running BeanTraderClient, I get:

System.ArgumentNullException: 'Value cannot be null.
Parameter name: accentName'

NuGet site no longer points to this Website as the source for "Microsoft.Windows.SDK.Contracts"

Most NuGet packages contain a link to the underlining GitHub repo/Project Website that backs the NuGet. This behavior no longer works for the Microsoft.Windows.SDK.Contracts NuGet.

Issue:
When you click on the Project Website link for Microsoft.Windows.SDK.Contracts. The Project Website link "https://aka.ms/WinSDKProjectURL" on the right-hand side of NuGet for Microsoft.Windows.SDK.Contracts NuGet package redirects back to NuGet.

Expected behavior:
I would expect the link to navigate me to this Website: https://github.com/dotnet/windows-desktop or wherever the Website is now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.