Accessibility Insights for Windows flagging issues fixed in newer versions of .NET Framework - accessibility-insights

I am building an app that uses .NET Framework 4.5. One of the controls that I'm using is being flagged as an accessibility issue. That issue was fixed in .NET Framework 4.7.1, but I can't target a newer version now. Is there a workaround for this?

If you are unable to update your .NET Framework but want to take advantage of the accessibility improvements in the later versions, you can use Accessibility Switches to "configure your app to opt into accessibility features if it targets .NET Framework 4.7 or an earlier version but is running on .NET Framework 4.7.1 or later."

Related

ASP.NET Core Web Application with .NET Framework, I want to switch the target to .NET Core

I'm trying to change ASP.NET Core web application with .NET Framework as a target framework to use .NET Core 3.1.X
I try changing the target framework in the project file (.csproj), I encounter dependency issues, dependency conflict....
Is there any straightforward method to solve this issue?
Before you start your migration, you should know there’s several difference between .net framework and .net core, so please follow the official document to do some Pre-Migration steps.
Then you can follow this official document to migrate your application from framework to .net core 3.1.
Since your ideal .net core version is 3.1, still I suggest you can try to use .net 6. Also, you can use this upgrade tool to reach your goal. In fact, using this upgrade assistant is a batter choice than you doing it by yourself. Even if you are insisting using .net core 3.1, you can use this assistant to upgrade your version to 6 first then change it to 3.1.
Note:
Before you start your migration, please make a backup of your original project. That's because some packages in .net framework may be no longer available in .net core. So if there're some errors occur, you can go back to the original one.

How can I use VS2019 Files in VS2022 and vice versa?

In my school they use VS 2019. I installed the same because that was what was available at the time (community version for me, I think the same for my school).
I had a couple of issues with VS2019 so I uninstalled everything and installed 2022 version instead. I then began to use this for the last 2 weeks but when I tried to open my old files, I couldn't.
I did install framework 3.1 again and the code will enter runtime successfully, but I still can't see the code that I wrote. I don't want to re-install VS2019 because it kept on giving me issues with intellisense which I just couldn't fix.
Is there any way I will be able to open my old 2019 files in 2022? Also, will 2019 be able to open 2022 files?
The generic answer to this is mostly yes but maybe no depending on your specifics. That's not a helpful sentence, so let me explain.
For the most part, Visual Studio solutions and projects are cross-compatible1. This means that if you have a project from one version, you can usually open it in another version without issue. The major caveat to this is the range of frameworks supported by each VS version may be different. VS will often be able to open the project, but might not be able to build and run it.
(Because you tagged this with vb.net, I'm limiting this to .NET versions. The same concepts may apply for other platforms.)
For example, VS2019 supports:
.NET version 5 (Visual Studio 16.8 or later)
.NET Framework versions 4.8, 4.7.2, 4.7.1, 4.7, 4.6.2, 4.6.1, 4.6, 4.5.2, 4.5.1, 4.5, and 4.0
.NET Core 3.1, 3.0, 2.2, 2.1, and 1.1.
And VS2022 supports:
.NET Framework versions 4.8, 4.7.2, 4.7.1, 4.7, and 4.6.2
.NET Core 6.0 Preview, 5.0, 3.1, 3.0, 2.2, and 2.1.
Note how VS2022:
DOES NOT support .NET Framework versions 4.0-4.6.1, or .NET Core 1.1
DOES support .NET (Core) 6.0 - which VS2019 does not
It is reasonable to expect that the next version of VS will stop supporting some versions while it adds support for new ones again, so this compatibility range will change with each VS release.
1: Each different type of project requires a Project System to support it. Occasionally, these may be dropped out of support like with the frameworks described above, but with the more severe consequence that VS will not be able to open the project at all. Some examples over time: Silverlight and Windows Phone projects, Setup projects, DNX (early .NET Core) projects, etc.

Azure Function Targeting .NET Standard Showing Warning

Just installed Visual Studio 15.5 Preview so that I can create an Azure Function targeting .NET Core. Without making any changes, I'm seeing a warning -- see below -- that reads:
Package Microsoft.AspNet.WebApi.Client 5.2.2 was restored using .NET
Framework version 4.6.1 instead of the project target framework .NET
Standard version 2.0. This package may not be fully compatible with
your project.
Any idea how to fix this or do I ignore this warning? As I said, this is a brand new Azure Function project I created with no changes at all.
Here's what the warning looks like:
You can pretty much ignore it, in this case.
Microsoft.AspNet.WebApi.Client targets "Portable Class Library (.NETFramework 4.5, Windows 0.0, WindowsPhone 8.0, WindowsPhone 8.1, WindowsPhoneApp 8.1)" (or net45+win8+win81 as it's the target framework moniker called), which means it's fully compatible with .NET Core and .NET Standard (>= 1.2).
The warning comes, because it do not target the netstandard1.x or netstandard2.x moniker specifically. It just tell you "this might not be compatible on .NET Core/.NET Standard".
Yes, you did nothing wrong: this is to be expected for now. Functions v2 are in beta now, so you'd have to live with this warning for a while. It should give you no functional issues.

Portable F# library references .NET 4.5 (but not 4.0)

I'm trying to create portable F# library but it needs to target .NET 4.0 (company policy is that all portable libraries need to be compatible with Windows XP).
When I create (Visual Studio 2013) new project there is an option "Portable Library (Legacy)" with description saying "A project for creating an F# library (.dll) that can run on .NET Framework 4.0 and higher, Windows Store and Silverlight 5".
The problem is, when the project is actually created. When I go to project's properties "Target Framework" is set to ".NET Portable Subset (.NET Framework 4.5, Silverlight 5, Windows 8)".
I tried changing F# runtime version from 3.1 to 3.0 but it does not change anything. "3.0" and "3.1" are the only options. What happened to "2.0"?
Am I missing something?
EDIT: It seems like Grzegorz is right. I've created this F# PCL which is saying ".NET 4.5" and referenced it from .NET 4.0 C# application. No problems were reported.
Then, to be sure, I also referenced it from 3.5 application and... no problems were reported during compilation either, but it was crashing on runtime. So to be sure, I ran the "potentially 4.0" application on XP and it worked, which may be interpreted as: "Yes, F# PCL does not depend on 4.5 even it it says so".
Make it an answer so I can tick it.
The template file for "Portable Library (Legacy)" has TargetFrameworkVersion hardcoded as v4.0. If You'll create a project with this template it'll in fact target 4.0 version.
Probably, there's a bug in UI that keeps displaying target framework as 4.5 while in reality it uses previous one.
To be strict, the issue is related to legacy Portable Library. The non-legacy version seems to work correctly in forcing framework to be in 4.5 version.
update:
I submitted an issue about this to Visual F# Tools team:
https://visualfsharp.codeplex.com/workitem/95

Building 4.5 code without the 4.5 runtime installed on the machine?

We have a large & complex system running under .Net 4.0. We want to start introducing code written for .Net 4.5, but can't (yet) assume that .Net 4.5 is installed on all the developer machines, build machines and test labs. So I'm looking for a way to compile certain projects in MSBuild using assemblies which are available on disk, on machines which have only .Net 4.0 installed.
Per the documentation it seems possible. The 4.5 reference assemblies are available in the msbuild environment, and I've been experimenting with the TargetFrameworkVersion, FrameworkPathOverride and TargetFrameworkMoniker attributes, but so far without success.
Any hints, suggestions or working samples would be most helpful.
To build a .NET Framework 4.5 application, you must also have the .NET Framework 4.5 reference assemblies.
Installation
The .NET Framework 4.5 replaces the common language runtime (CLR), targets, tasks, and tools of the .NET Framework 4 without renaming them. Essentially, it creates a modified and improved .NET Framework 4.