.NET Core 中的 Assembly.GetEntryAssembly() 等价物是什么? [英] What is the equivalent of Assembly.GetEntryAssembly() in .NET Core?

查看:30
本文介绍了.NET Core 中的 Assembly.GetEntryAssembly() 等价物是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 .net 框架中,我们可以使用:

In .net framework we could get the starting assembly using:

Assembly.GetEntryAssembly();

但这已从 .NET Core 中删除.也没有 AppDomain.如何访问 .NET Core 和 Windows 通用应用程序中的入口程序集?

But that is removed from .NET Core. Also there is no AppDomain. How can I get access to the entry assembly in .NET Core and Windows Universal applications?

(我需要找到它所有嵌入的资源键)

(I need to find all of its embedded resource keys)

推荐答案

Assembly.GetEntryAssembly().NET Standard 1.5 中可用,但在 1.0 到 1.0 版本中不可用1.4.如果您只开发 .NET Core 和Universal Windows 应用程序,1.5 版应该足以满足您的需求.

Assembly.GetEntryAssembly() is available in .NET Standard 1.5, but not in versions 1.0 through 1.4. If you are only developing .NET Core and Universal Windows applications, version 1.5 should be sufficient for your needs.

如果我没记错的话,AppDomain 注定会出现在 .NET Standard 2.0 中.它现在不可用.

If I remember correctly, AppDomain is destined to appear in .NET Standard 2.0. It is not available now.

这篇关于.NET Core 中的 Assembly.GetEntryAssembly() 等价物是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆