.net-assembly

Assembly Version numbers, signed assemblies Why do I get a FileLoadExceptions

只愿长相守 提交于 2019-12-24 00:48:27
问题 My Problem: I have a signed assembly A.dll that it versioned as 1.0.0.0 I have another assembly (lets say B.dll) that references A.dll. Once both assemblies both assemblies load fine without any problem. Now if the version for A.dll changes to 1.0.0.1 and is recompiled Does B.dll have to be recompiled? I asking because I have this exact scenario where after A.dll had it's version changed I now receive the following Exception trying to load B.dll: Unhandled Exception: System.IO

Compile IL code at runtime using .NET 3.5 and C# from file

左心房为你撑大大i 提交于 2019-12-24 00:38:39
问题 I would like to take a file that is an IL file, and at run time compile it back to an exe. Right now I can use process.start to fire off the command line with parameters (ilasm.exe) but I would like to automate this process from a C# service I will create. Is there a way to do this with reflection and reflection.emit? While this works: string rawText = File.ReadAllText(string.Format("c:\\temp\\{0}.il", Utility.GetAppSetting("baseName")), Encoding.ASCII); rawText = rawText.Replace("[--STRIP--]

Special characters in a Namespace

牧云@^-^@ 提交于 2019-12-23 16:11:33
问题 I am considering using a character with a diacritical mark (e.g., ō) in a namespace for a custom framework. This idea has come up as a way to distinguish a product, but I want to to be sure this isn't a bad idea, and if there is anything about it that will come back to bite me later. I have not seen other examples of namespaces that use special characters in my searching, nor any similar discussion on this topic, which gives me pause in continuing down this path. I was initially considering

The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'System.Web.UI.WebControls'

孤者浪人 提交于 2019-12-23 10:57:41
问题 I am getting the following errors The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?) The type or namespace name 'ModalPopupExtender' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?) The type or namespace name 'Accordion' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?) I have installed

Error: Could not load file or assembly 'Oracle.ManagedDataAccessDTC' or one of its dependencies

江枫思渺然 提交于 2019-12-23 10:54:43
问题 Background I have a solution containing a Console project and an MVC4 Webapp. Both Reference Oracle.ManagedDataAccess (the managed ODP.NET data access provider). The reference is to the same file. Neither reference Oracle.ManagedDataAccess DTC. In VS Configuration Manager, the platform is listed as "Any CPU" for all configuration options. The platform target for both is "Any CPU" Problem The console application executes perfectly fine. When I try to use the MVC4 application, I see: Could not

Making binding redirects work for office add-ins

拥有回忆 提交于 2019-12-23 10:49:31
问题 I'm using Microsoft.Bcl.Async in my Word addin, my addin is compiled as an exe (test_addin.exe) file, that is loaded as an assembly from Microsoft Word, when I start the executable directly, everything's working fine, but when I run it from Word, I'm getting an error saying that it failed to load the Systems.Threading.Tasks assembly. Could not load file or assembly System.Threading.Tasks... It looks like that its related to the binding redirects, when I try to run the application from Word it

Exception while dynamically creating assemblies using DefineDynamicAssembly on non-current AppDomain

拟墨画扇 提交于 2019-12-23 10:18:43
问题 I want to dynamically create assemblies in the integration tests for the purpose of testing some assembly manipulation classes. If I use the following code to create the testing assemblies: var domain = AppDomain.CurrentDomain; var builder = domain.DefineDynamicAssembly( new AssemblyName(assemblyName), AssemblyBuilderAccess.Save, directory); builder.Save(fileName); then everything runs ok, the assemblies are created in the required location, but as part of this they are also loaded to the

Renaming of .Net assemblies

[亡魂溺海] 提交于 2019-12-23 10:11:24
问题 We get an assembly from a third party, e.g. Example.dll . Recently the supplier introduced some breaking changes, but didn't change the name of the assembly. Can I rename the new assembly to e.g. Example2.dll and load it dynamically using reflection? It is not strongly named. 回答1: Yes, you can rename it, since it's not strongly named, However, that won't change the namespaces the assembly uses, and it will conflict with the other assembly if they are loaded in the same AppDomain. The only

Assemblies not unloading after AppDomain unload?

不想你离开。 提交于 2019-12-23 09:47:27
问题 I'm using an AppDomain in order to load assemblies and then unload them. However, I'm having a very strage problem. After the AppDomain is unloaded - I can still see in process explorer that some assemblies are loaded multiple times! Why are there remainders of the loaded assemblies? Doesn't an AppDomain.Unload frees all the AppDomain's loaded memory? You can see in the attached image: Total AppDomains are 3 (I created 3 AppDomains in the process's life-cycle) AppDomains: 1 (Currently only 1

Attaching an existing method to a dynamic assembly instead of generating IL for it

微笑、不失礼 提交于 2019-12-23 06:20:09
问题 I am new to the Reflection.Emit API and have generated a bare minimum assembly with an entry point that returns an exit code based on a few simple I/O checks. The reason for creating an external assembly is that a piece of code needs to run outside the current process space and will be transient itself. It will eventually be deleted by the creating app. Having said that, the code to be generated is quite complex and I would rather avoid creating a separate project for a transient assembly. I