asp.net-core - is there any way to detect windows environment based function in our project?
问题描述
In my project i have to create platform independent code. My project(Based on .net framework 4.6.1 which i have convert it into .net core 3.1) was developed long ago and its based on windows environment now we convert it into Linux and Mc environment also. so is there any way to detect all windows specific classes so we can change it for Mc and Linux also or we just read the entire code and find each function and convert it. because its very time taken process to read entire code and change according to requirement so is there any other way to do it?
解决方案
首先查看这篇文章从 .NET Framework 移植到 .NET Core 的概述。
那么有什么方法可以检测所有特定于 Windows 的类,以便我们也可以为 Mc 和 Linux 更改它,或者我们只需阅读整个代码并找到每个函数并转换它。
.NET 可移植性分析器是一种分析程序集并提供有关 .NET API 的详细报告的工具,这些 API 是为了在您指定的目标上可移植的应用程序或库而缺失的。
try-convert是有助于将 .NET Framework 项目迁移到 .NET Core 的工具。
在 Linux 和 Mac 平台上运行
.NET Core
是跨平台的,它运行在macOS
、Linux
和Windows
. .NET Core
支持前面提到的操作系统作为您的开发工作站。有了.NET Core
您,您可以定位在任何平台上运行的任何应用程序类型。Visual Studio 为 Windows 和 macOS 提供集成开发环境 (IDE)。您还可以使用Visual Studio Code,它在macOS
、Linux
和Windows
.
推荐阅读
- javascript - 在表单上提交复选框值而不刷新页面 AJAX PHP
- selenium - 查找元素的 xpath 只知道 href 属性的一部分 selenium ide ui vision katalon recorder
- c# - Xamarin,XAML。帮助在 ListView 中绑定颜色
- python - pyinstaller --onedir 和 auto-py-to-exe 的问题
- echarts - 具有相同类别名称的多个条根据数组数组或对象数组显示不同
- css - 如何防止li的内部导航栏崩溃
- r - 枢轴更广泛的自定义格式
- c# - 无法跟踪实体类型“Outlet”的实例,因为已在跟踪具有键值的另一个实例
- redis - Redis Clustering 等待集群加入私有 VPC
- android - Android 中的透视 API