您如何在 DNX Core 5.0 (ASP.NET 5) 中引用执行程序集? [英] How do you reference the executing assembly in DNX Core 5.0 (ASP.NET 5)?
本文介绍了您如何在 DNX Core 5.0 (ASP.NET 5) 中引用执行程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从 .NET 3.5 - 4.5 移植一些代码.在我的程序集中,我有一些代码可以从当前正在执行的程序集中读取资源.但是,GetExecutingAssembly()
不是 DNX 核心 5.0 中 Assembly
类型的方法.
I am porting some code from .NET 3.5 - 4.5. Inside of my assembly, I have some code that reads the resource from the currently executing assembly. However, GetExecutingAssembly()
isn't a method on the Assembly
type in DNX core 5.0.
var xsdStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(xsdPath);
DNX 核心 5.0 中 Assembly.GetExecutingAssembly()
的等价物是什么?或者,如果我需要一个命名空间来获取该方法(也许是一个扩展方法?),命名空间是什么?
What is the equivalent of Assembly.GetExecutingAssembly()
in DNX core 5.0? Or if I need a namespace to get that method back (an extension method perhaps?), what is the namespace?
推荐答案
typeof().GetTypeInfo().Assembly
这篇关于您如何在 DNX Core 5.0 (ASP.NET 5) 中引用执行程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文