- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
WinRT 中的 Assembly 类不再有静态方法来访问当前正在执行的程序集? WinRT 中的方法是什么?
最佳答案
这应该可以解决问题:
using System.Reflection;
...
typeof(Class).GetTypeInfo().Assembly
Class
通常是您在其中编写此代码的类。
关于c# - WinRT 中的 System.Reflection.Assembly.GetExecutingAssembly(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7451703/
我有一个插件架构,其中在主应用程序中定义了一个抽象基类。它使用反射来加载具有基类的派生实现的程序集。我想获取包含派生对象的程序集的版本信息。这是我的基类: namespace My.AppNameSp
我正在尝试将单声道嵌入到 C++ 可执行文件中,但单声道在 Assembly.GetExecutingAssembly 上崩溃。知道我错过了什么吗? 编辑:使用单声道 3.0.3 嵌入式单声道测试.c
我正在尝试使用反射获取当前正在执行的程序集的路径以用于注册某些类型。这是在静态/共享方法中调用的 Dim Path = System.Reflection.Assembly.GetExecutingA
我在 VB、VS2012 中设置了一个 PCL,并将其设置为 Profile 78(WinRT、WinPhone8、.NET 4.5)。我没有 GetExecutingAssembly可在 Assem
我正在研究创建一种自动方式来检查我们系统的运行版本。每当我们发布代码进行测试时,我们的版本都在使用 [assembly: AssemblyVersion("1.21.0.13329")] [assem
我很新,所以这可能是一个“愚蠢的问题”,或者可能不适合在这里,请酌情提出建议。 我正在探索 C# 的一些功能,这周我正在研究反射。当我读到 http://msdn.microsoft.com/en-u
我正在使用 xml 文件作为嵌入资源来加载 XDocument。我们正在使用以下代码从程序集中获取适当的文件: XDocument xd = new XDocument(); Assembly ass
我正在尝试使用 Xamarin.Forms(可移植类库)创建移动应用程序,在以下代码中,我无法使用 `GetExecutingAssembly: using System; using
在 Visual Studio 2010(和 .Net 4)中的 Node.js native 插件中,我可以使用 System::Reflection::Assembly::GetExecuting
目前,我正在使用 UWP 平台将 Windows Phone Silverlight 应用程序移植到 Windows Mobile。 在我的旧代码中,我使用一个函数以下列方式获取 ExecutingA
请建议哪个最适合获取执行程序集位置。 Assembly.GetAssembly(typeof(NUnitTestProject.RGUnitTests)).Location 或 Assembly.Ge
我尝试在我的 xamarin.forms 项目中包含一个 .csv 文件。问题是,当我将文件用作嵌入式资源时,我认为它只能同时适用于所有平台。我的程序集只有三种方法: Equals() Load()
有 Assembly.GetExecutingAssembly()和 Assembly.GetCallingAssembly() .请注意 GetCallingAssembly() 有一个 Remar
WinRT 中的 Assembly 类不再有静态方法来访问当前正在执行的程序集? WinRT 中的方法是什么? 最佳答案 这应该可以解决问题: using System.Reflection; ...
当使用 GetTypes 执行 GetExecutingAssembly 时,它会检索带有奇怪的“+<>c”后缀的额外类型。我假设这可能是一些特殊字符或其他什么?如下图所示。预期结果应该只是列表中的
需要在我的 .NET Core 应用程序中嵌入一个 json 文件作为测试源。本文作者 http://codeopinion.com/asp-net-core-embedded-resource/提供
Assembly.GetExecutingAssembly() 和 typeof(program).Assembly 有什么区别? 最佳答案 假设 program 在执行程序集中,它们应该返回相同的值
我正在使用反射为控制反转注册默认实例。我需要扫描所有加载的程序集,然后遍历每个类型并注册。问题是,在我的 visual studio 代码文件中,我没有方法 Assembly.GetExecuting
我修改了我的 assemblyinfo.cs: [assembly: AssemblyVersion("1.0.*")] 我把它放在 _layout.cshtml 上,这样我就可以识别我正在测试的版本
如标题所示,这两者如何区分?我们可以肯定地说它们是一样的吗?我们什么时候选择一个而不是另一个是最好的情况?我只是碰巧遇到它,我不太确定。我希望有人能消除我的疑虑。提前致谢。 最佳答案 this.Get
我是一名优秀的程序员,十分优秀!