.net-assembly

Replacing dll to a newer version

那年仲夏 提交于 2019-12-29 09:27:07
问题 I have a Caliburn.Micro application with many projects. Several projects refer to the same dll in a separate folder. Now I needed to replace that dll with a newer version. I removed the reference from all projects and added it again. But I am getting a runtime error: Could you please help? P.S. I tried to use fuslogvw.exe, but it shows up empty: 回答1: I think you're using Visual Studio. First of all, check in the properties of all that FileHelpers referenced if the Specific Version is set to

How to load an assembly as reflection-only in a new AppDomain?

梦想与她 提交于 2019-12-29 09:14:08
问题 I'm experienced in C# but relatively unfamiliar with the concepts of AppDomain and the like. Anyway, I'm trying to get an assembly to load in a reflection-only context so I can grab all of its namespaces. Here is the code I have right now (warning: PowerShell): function Get-Namespaces($assembly) { $assemblyClass = [Reflection.Assembly] $winmdClass = [Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata] $domain = [AppDomain]::CurrentDomain # Since desktop .NET can't work with winmd

Newtonsoft.Json Assembly Conflict

橙三吉。 提交于 2019-12-28 01:56:27
问题 I use Netonsoft.Json in my project. It works fine until I start integrating Paypal SDK in my Project. My code is as below. String AccessToken = new PayPal.OAuthTokenCredential("", "").GetAccessToken(); ---->>>> This Line Throwing An Error PayPal.Api.Payments.Address add = new PayPal.Api.Payments.Address(); add.city = TextBoxCity.Text; add.line1 = TextBoxAddress.Text; add.phone = TextBoxPhoneNumber.Text; add.postal_code = TextBoxZipcode.Text; add.state = TextBoxState.Text; PayPal.Api.Payments

Microsoft.Owin error after deploying in test server

和自甴很熟 提交于 2019-12-25 19:04:35
问题 Am getting this error after deploying .net MVC application into my test server. In dev machine its working fine Server Error in '/' Application. Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current web

Creating a dynamic fake class inside of an assembly

不想你离开。 提交于 2019-12-25 18:32:29
问题 Probably what I am asking is impossible, but nevertheless here is my problem and question. First of all this is C# and .NET. I would like to define an empty implementation (empty methods, functions returning defaults) of a class to an interface in such a way if I change the interface I will not need to adapt the code. Unfortunately I can not generate the implementation containing assembly and I can not define a dynamical mock on it because instantiation is done automatically via reflection.

Assembly.Load duplicates the Assembly when loaded into a new AppDomain

谁说胖子不能爱 提交于 2019-12-25 14:39:16
问题 I currently have a problem where if I set up a new App Domain and use AppDomain.Load , The Assembly gets loaded twice (Once into the new App Domain, and once into the default App Domain) The code I am using to load the Assembly is as follows: AppDomain dom = AppDomain.CreateDomain(_dllname); AssemblyName assemblyName = new AssemblyName(); assemblyName.CodeBase = directory + _dllname; Assembly a = dom.Load(assemblyName); When I use this code the Assembly loads correctly into my new AppDomain

Get methods and attributes from dll assembly

强颜欢笑 提交于 2019-12-25 09:19:46
问题 I'm trying to get a small plugin mechanism running by reflecting an dll file providing my class Plugin (implementing my Plugin -Interface shared among dll and main project / sorry for naming both the same) offering an attribute of type string and a main-method activate : Interface: public interface Plugin { string pluginName{get;set;} void activate(System.Windows.Forms.Form main); } dll class: public class Plugin : WhiteA.Plugin { public string pluginName{get;set;} public void activate(System

Is it possible to keep precompiled symbols in C# assemblies for use in a referencing program?

孤者浪人 提交于 2019-12-25 09:08:04
问题 I know that the C# preprocessor will generally eliminate the precompiled symbols. Can the rule be broken a bit? For example, I have a C# dll A , which I wanna use in another C# program B . In B I have different precompiled symbols X , Y , Z . If X is defined, I need a version of A . Else if Y is defined, I need another version of A . And similar for Z . To implement this, I want to write precompiled directives in A 's source code, like public static class MyClass { public static void MyMethod

How to compute a hash of assembly, so that this hash could be used to tell if the code in the assembly has changed?

断了今生、忘了曾经 提交于 2019-12-25 09:06:19
问题 The problem is that rebuilding exactly the same code generates a different assembly when compared with the result of the previous build. Why do I need this? I have a T4 template that generates certain source code from the given contract assembly. That source code is checked in into VCS, even though it is generated. This is because the contract assembly changes relatively infrequently. However, when it does change, I would like to fail the build as long as the aforementioned T4 template is not

Unexpected result of Reflection.AssemblyName().Version

末鹿安然 提交于 2019-12-25 07:59:21
问题 Recently, I had to check assembly version of certain DLL, let call it AAA.BBB.dll and I decided to use a simple Powershell command to get it, namely: [Reflection.AssemblyName]::GetAssemblyName('AAA.BB.dll').Version I realized that this command does not display the version that I want. Most of the time it displays one fixed version which does not match the version of the dll in the current directory. Even providing an some invalid inputs to GetAssemblyName method (e.g. 'AAA.BB.dll123') showed