.net-assembly

Modify Compiled .Net Exe

↘锁芯ラ 提交于 2019-12-22 03:22:10
问题 I have an application written in C# (without the source of course), that needs to be changed a little bit. For example, I need to stop a few lines of code that create an unnecessary menu. So I think I should comment them out. The source code is not obfuscated. I know I can completely decompile, change, and compile again, using tools like Reflector/Reflexil. But everyone knows that by doing this, many parts of code won't compile again! Is there a way in Reflector (or any other product) that a

Could not load file or assembly 'log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies

爷,独闯天下 提交于 2019-12-22 02:02:54
问题 I found several threads relating this issue, but none of those solved my issue. I have been previously using log4net version 1.2.10.0 in my ASP.NET services. I have updated it to current version which is log4net v2.0.8.0 , due to some third party libraries I also added the following lines in my web.config to to support/redirect old versions. <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken=

How can I see the strong name of my assembly?

折月煮酒 提交于 2019-12-22 02:00:04
问题 I have a project, and I created a strong name key file for it. How can I tell what the strong name of my assembly is? It seems this should be obvious, but I can't find any reference to it. 回答1: You can get the Fully Qualified Name by using a tool like Reflector or ILSpy. Select the assembly and it should be in top of it. For XNA in ILSpy : // C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.dll // Microsoft.Xna.Framework, Version=4.0.0.0

Powershell unable to find type [System.Windows.Forms.KeyEventHandler]

江枫思渺然 提交于 2019-12-22 01:52:33
问题 This might be a pretty simple question but I'm totally lost and searching for an answer hasn't been helpful. I've got some powershell code to display a simple GUI with TextBoxes. Some of the textboxes allows the user to press Enter to run Button_Click code. When I try running the PS1 script, I get errors saying the following: Unable to find type [System.Windows.Forms.KeyEventHandler]. Make sure that the assembly that contains this type is loaded.At C:\Scripts\GUI-Testing.ps1:161 char:1

Creating an instance of a COM interop class

六月ゝ 毕业季﹏ 提交于 2019-12-21 17:32:04
问题 I am trying to open CorelDRAW from within my program using C#. So far I have been able to do so by referencing the appropriate com library and calling CorelDRAW.Application draw = new CorelDRAW.Application(); draw.Visible = true; However, I would like my program to work with any version of CorelDRAW that supports interop. I am attempting to use reflection to load the interop library at runtime, where the specific dll can be chosen for the correct version. From looking around I have tried the

Why is warning CS1607 “The version specified for the 'product version' is not in the normal 'major.minor.build.revision' format” generated?

时间秒杀一切 提交于 2019-12-21 12:16:04
问题 Today I'm getting a The version specified for the 'product version' is not in the normal 'major.minor.build.revision' format warning. It's related to the use of AssemblyInformationalVersionAttribute. My assembly attributes are: [assembly: AssemblyInformationalVersion("XXX 1.1.0")] [assembly: System.Runtime.InteropServices.ComVisible(false)] Basically the compiler complains about XXX 1.1.0 that doesn't look like x.y.z.r . From MSDN: The informational version provides additional version

project.json Equivalent of InternalsVisibleTo

假装没事ソ 提交于 2019-12-21 07:26:08
问题 .Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle, AssemblyCopyright, AssemblyVersion). However, one assembly property I haven't figured out how to set in project.json is InternalsVisibleTo. Is there a way to use project.json to indicate that another assembly should have internal visibility into the current

project.json Equivalent of InternalsVisibleTo

倖福魔咒の 提交于 2019-12-21 07:26:05
问题 .Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle, AssemblyCopyright, AssemblyVersion). However, one assembly property I haven't figured out how to set in project.json is InternalsVisibleTo. Is there a way to use project.json to indicate that another assembly should have internal visibility into the current

How do you reference the executing assembly in DNX Core 5.0 (ASP.NET 5)?

隐身守侯 提交于 2019-12-21 07:06:28
问题 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); 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?

Why are identical types not equal?

我只是一个虾纸丫 提交于 2019-12-21 05:15:19
问题 I was developing a small plugin framework and noticed that I couldn't successfully use Type.IsAssignableFrom() to check if a plugin class implements the type IPlugin . I had checked other SO questions (such as this) to see why the function returned false, but to my surprise, none of the suggestions worked. I had a class inside a plugin assembly which implements the PluginAPI.IPlugin class in a referenced assembly. When checking the AssemblyQualifiedName for both my PluginAPI.IPlugin type as