对.Net标准感到困惑 [英] Confused about .Net Standard
问题描述
首先,这是问有关使用.Net Standard开发的问题的正确地方吗?
First is this the right place to ask questions about developing with .Net Standard?
第二,我在VS 2017中使用.Net Standard创建了一个新的类库项目.
Second, I created a new Class Library project using .Net Standard in VS 2017.
在这里我想同时使用Environment.MachineName和ConfigurationManager(读取XML配置文件的那个).
In there I wanted to use both Environment.MachineName and the ConfigurationManager (the one that reads XML config files).
我不清楚如何处理环境类中没有MachineName属性的事实,我也不知道我是否可以访问ConfigurationManager.
I'm not clear on how to deal with the fact that there is no MachineName property in the Environment class and I have no idea if I even can access ConfigurationManager.
我在网上也找不到记录.Net标准环境类的信息.
I'm finding no info on the web that documents the .Net Standard Environment class either.
Thx
PS:我正在使用.Net Standard 1.4
PS: I'm using .Net Standard 1.4
推荐答案
是.我有时也会感到困惑.您可以期望,对于运行时提供的用于访问外部事物(线程,文件系统等)的所有内容,如果不能在所有平台上以相同的方式完成操作,则将使用替换库 需要.
Yes. It's something that I feel confused at times too. You can expect that for everything that the runtime provides to access external things (threads, filesystem, etc.), if it cannot be done in all platform in the same way, a replacement library will be needed.
安装 .NET标准库将为您提供大部分所需的库,供您开始使用为.NET标准编写的其他库.
Install the .NET Standard Library will get you most of the needed library for start using other libraries written for .NET Standard.
在中有关ConfigurationManager的问题 .NET标准,请阅读 本文是另一种实现方法.
For your question about ConfigurationManager in .NET standard, please read this article for another way to do it.
这篇关于对.Net标准感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!