How to determine if a .NET assembly was built for x86 or x64?

I've got an arbitrary list of .NET assemblies. I need to programmatically check if each DLL was built for x86 (as opposed to x64 or Any CPU). Is this possible? Look at System.Reflection.AssemblyName.GetAssemblyName(string assemblyFile) You can examine assembly metadata from the returned AssemblyName instance: Using PowerShell : [36] C:> [reflection.assemblyname]::GetAssemblyName("$

如何确定.NET程序集是为x86还是x64构建的?

我有一个.NET程序集的任意列表。 我需要以编程方式检查每个DLL是否为x86构建(而不是x64或任何CPU)。 这可能吗? 看看System.Reflection.AssemblyName.GetAssemblyName(string assemblyFile) 您可以从返回的AssemblyName实例中检查程序集元数据: 使用PowerShell : [36] C:> [reflection.assemblyname]::GetAssemblyName("${pwd}Microsoft.GLEE.dll") | fl Name : Microsoft.GLEE Version

AutoMapper flattening of nested mappings asks for a custom resolver

I'm somewhat new to AutoMapper and wanted to map a POCO-ish object to a perhaps more complex DTO, the latter tries to be a representation of a Google Books API's Volume resource: Book.cs public class Book { public string Isbn10 { get; set; } public string Isbn13 { get; set; } public string Title { get; set; } public string Author { get; set; } public string Publishe

嵌套映射的AutoMapper扁平化要求定制解析器

我对AutoMapper有点新,并且想将POCO-ish对象映射到更复杂的DTO,后者试图成为Google Books API的Volume资源的代表: Book.cs public class Book { public string Isbn10 { get; set; } public string Isbn13 { get; set; } public string Title { get; set; } public string Author { get; set; } public string Publisher { get; set; } public DateTime Publication { get; set; } public int

.NETPlatform vs .NETStandard

I'm really confused about the terminology around the platforms in .NET these days - I used to understand it up until we had the PCLs. I found the following documents: .NET Platform Standard .NET Standard Library For starters, the first document refers to the conceptual platform with the moniker "netstandard" as ".NET Platform Standard". The latter calls it ".

.NETPlatform与.NETStandard

我现在对.NET平台中的术语感到非常困惑 - 直到我们有了PCL之前,我才了解它。 我找到了以下文件: .NET平台标准 .NET标准库 对于初学者来说,第一篇文档是指“netstandard”这个绰号为“.NET平台标准”的概念平台。 后者称它为“.NET标准”(同时它引入了一个新的“.NET标准库”)。 我真的不明白为什么第一份文件的顶部有一个免责声明,第二份文件描述了继任者的概念:至少在第一份文件中至少显示版本释放的表格更新。 那

How I can adjust the screen resolution on my WPF application?

I have an application made with .NET (WPF Application), which works with screen resolutions equal to or greater than 1280 x 720, there is a quick way to adjust it to operate in a screen resolution of 1024 x 768. Thank you for your help

我如何调整我的WPF应用程序的屏幕分辨率?

我有一个使用.NET(WPF应用程序)制作的应用程序,该应用程序的屏幕分辨率等于或大于1280 x 720,因此可以快速调整屏幕分辨率为1024 x 768的分辨率。 感谢您的帮助

Interview questions: WPF Developer

What should every WPF developer know? Entry Level Strong .NET 2.0 Background & willing to learn! Explain dependency properties? What's a style? What's a template? Binding Differences between base classes: Visual, UIElement, FrameworkElement, Control Visual vs Logical tree? Property Change Notification (INotifyPropertyChange and ObservableCollection) ResourceDiction

面试问题:WPF开发人员

每个WPF开发人员应该知道什么? 入门级 强大的.NET 2.0背景和愿意学习! 解释依赖属性? 什么是风格? 什么是模板? 捆绑 基类之间的差异:Visual,UIElement,FrameworkElement,Control 视觉vs逻辑树? 属性更改通知(INotifyPropertyChange和ObservableCollection) ResourceDictionary - 由a7an添加 UserControls - 由a7an添加 泡沫和隧道路线策略之间的区别 - 由Carlo添加 为什么微软推出另一

MVC 4 Post not hitting controller/action

I'm getting a really annoying issue in MVC 4 where my form posts aren't hitting the action I've specified. I've done this loads of times before and it worked fine but in my new project it doesn't seem to work at all. It's a simple login page, with nothing fancy, just a user name and password field. Here's my code HTML/Razor: @model XYZ.Models.PageModels.LoginPag

MVC 4发布不会触及控制器/操作

我在MVC 4中遇到了一个令人讨厌的问题,那就是我的表单帖子没有达到我指定的操作。 我已经完成了这些工作,并且工作正常,但是在我的新项目中,它似乎根本无法工作。 这是一个简单的登录页面,没有任何花哨,只有用户名和密码字段。 这是我的代码 HTML /剃刀: @model XYZ.Models.PageModels.LoginPageModel <div class="login"> <form class="left form"> @using (Html.BeginForm("Login",

checking logic occur in MSIL or machine code

I've just started to dabble in the wonderful world of MSIL, but I can't seem to find any answers here about where bounds-checking occurs. Does the C# compiler insert MSIL instructions that perform bounds-checking, or does the MSIL JIT compiler insert them for all applicable MSIL instructions when translating those to machine code? The reason I ask is because I need to know whether or n

检查逻辑发生在MSIL或机器代码中

我刚刚开始涉足MSIL的奇妙世界,但我似乎无法在这里找到关于边界检查发生的任何答案。 C#编译器是否插入执行边界检查的MSIL指令,或者MSIL JIT编译器是否将所有适用的MSIL指令转换为机器代码时插入它们? 我问的原因是因为我需要知道当我直接使用MSIL生成函数时是否需要添加这些指令。 编辑:收到一个答案并尝试验证后,它似乎是不正确的。 下面的代码实际上失败了。 单步执行调试器会发现第二个测试的写入超出了数组范

Linking a precompiled MSIL file into an assembly?

Is there any way to precompile an MSIL file and then have the .net linker link that into a .net assembly at compile time? So, for example. I have a project. I compile it, decompile it to MSIL, and tweak the msil. Now then, I'd like to compile and link that tweaked msil file into another project. Yes, I +COULD+ recompile it as a seperate assembly and just reference it, but in this part

将预编译的MSIL文件链接到程序集中?

有什么方法可以预编译MSIL文件,然后在编译时将.net链接器链接到.net程序集中? 所以,例如。 我有一个项目。 我编译它,反编译为MSIL,并调整MSIL。 现在,我想编译和链接那个微调的msil文件到另一个项目中。 是的,I + COULD +将它重新编译为一个单独的程序集并仅供参考,但在这种特殊情况下,我无法做到这一点。 MSIL的内容实际上需要在目标程序集中。 任何想法,如果这是可能的? 到目前为止,我没有找到任何运

how do you invoke a private method from MSIL?

I'm writing a "weak event factory" - code which converts any Delegate into a new delegate with an identical signature, but with implementing a WeakReference on the target. I'm using MSIL to avoid calls to Delegate.CreateDelegate (which performance have shown to be slow). The weak reference delegates work perfectly as long as the underlying method (the Method of the original d

你如何从MSIL调用私有方法?

我正在编写一个“弱事件工厂” - 将任何代表转换为具有相同签名的新代表的代码,但是要在目标上实现WeakReference。 我正在使用MSIL来避免调用Delegate.CreateDelegate(性能显示很慢)。 只要底层方法(原始代理的方法)被声明为公开,弱引用委托就完美地工作。 只要使用私有或匿名方法,MSIL就会在运行时使用MethodAccessException方法炸弹。 使用编译的表达式树,我已经能够调用私有方法,所以必须能够动态地发出调用私有

Clean up Excel Interop Objects with IDisposable

In my company the common way to release Excel Interop Objects is to use IDisposable the following way: Public Sub Dispose() Implements IDisposable.Dispose If Not bolDisposed Then Finalize() System.GC.SuppressFinalize(Me) End If End Sub Protected Overrides Sub Finalize() _xlApp = Nothing bolDisposed = True MyBase.Finalize() End Sub where _xlApp was created in

使用IDisposable清理Excel互操作对象

在我的公司中,发布Excel Interop对象的常见方式是使用IDisposable以下方式: Public Sub Dispose() Implements IDisposable.Dispose If Not bolDisposed Then Finalize() System.GC.SuppressFinalize(Me) End If End Sub Protected Overrides Sub Finalize() _xlApp = Nothing bolDisposed = True MyBase.Finalize() End Sub 其中_xlApp是通过以下方式在构造函数中创建的: Try _xl