.net-assembly

Getting the System.Type from an assembly loaded at runtime

夙愿已清 提交于 2020-01-06 03:30:13
问题 As a followup to this question I have now come to the problem of being able to get the Type of a type that is defined by the user in his own solution. Using the standard mscorlib types, everything works. The question is very easy: how can I get this type from an assembly that I will only know at runtime? As described in the comments here: Also, what do you mean by "extracting the type"? You mean getting the Reflection type? There's no good helper, partly because (typically) you can never

Getting the System.Type from an assembly loaded at runtime

大兔子大兔子 提交于 2020-01-06 03:30:04
问题 As a followup to this question I have now come to the problem of being able to get the Type of a type that is defined by the user in his own solution. Using the standard mscorlib types, everything works. The question is very easy: how can I get this type from an assembly that I will only know at runtime? As described in the comments here: Also, what do you mean by "extracting the type"? You mean getting the Reflection type? There's no good helper, partly because (typically) you can never

How to hide the entire class?

喜夏-厌秋 提交于 2020-01-06 02:41:10
问题 Lets imagine: // assembly 01 abstract class Foo { abstract void Bar(); } class AdvancedFoo : Foo { override void Bar() { base.Foo(); ... } } sealed class SuperiorFoo : AdvancedFoo { override sealed void Bar() { base.Foo(); } } And then I want to reference that assembly 01 from my 02 asm and replace the intermediate base class (and only it) so the instances of a SuperiorFoo were acting like they are inhereting from assembly 02 's AdvancedFoo . // assembly 02 class AdvancedFoo : Foo { override

Could not load file or assembly 'System.Web.Helpers' or one of its dependencies [duplicate]

Deadly 提交于 2020-01-05 18:14:34
问题 This question already has answers here : Could not load file or assembly 'System.Web.Helpers, error on IIS 8 (11 answers) Closed 5 years ago . The web application is working fine in my VS2010, but when I hosted it on server it shows error below Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. 回答1: Sounds as MVC has not been installed on the server. and The dll is

Could not load file or assembly 'System.Web.Helpers' or one of its dependencies [duplicate]

我们两清 提交于 2020-01-05 18:14:28
问题 This question already has answers here : Could not load file or assembly 'System.Web.Helpers, error on IIS 8 (11 answers) Closed 5 years ago . The web application is working fine in my VS2010, but when I hosted it on server it shows error below Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. 回答1: Sounds as MVC has not been installed on the server. and The dll is

ASP.NET - How to get assembly from virtual path in custom IResourceProvider implementation

心不动则不痛 提交于 2020-01-05 08:11:32
问题 I'm developing custom local resource provider implementation, which should supply resource values from resources located in App_LocalResources folders, but the resources should be compiled as embedded. So no resx files will stay in web app folder, which default LocalResXResourceProvider expects. The problem is I need to get to assembly with the embedded resources from virtual path and I'm not able to figure out what ASP.NET class use to translate virtual path to corresponding assembly. I was

ASP.NET - How to get assembly from virtual path in custom IResourceProvider implementation

杀马特。学长 韩版系。学妹 提交于 2020-01-05 08:11:04
问题 I'm developing custom local resource provider implementation, which should supply resource values from resources located in App_LocalResources folders, but the resources should be compiled as embedded. So no resx files will stay in web app folder, which default LocalResXResourceProvider expects. The problem is I need to get to assembly with the embedded resources from virtual path and I'm not able to figure out what ASP.NET class use to translate virtual path to corresponding assembly. I was

How can I check for an InternalsVisibleTo attribute on an assembly?

坚强是说给别人听的谎言 提交于 2020-01-05 08:07:10
问题 I've used ILMerge to merge a secondary assembly that is itself merged with Castle.DynamicProxy, having set most if not all of the normally-public Castle types to internal. When I use the code from the secondary assembly that is dependent on the Castle types, I get a TypeLoadException saying that access is denied. The first step to check is that my merged assembly has the InternalsVisibleTo attribute still set for the DynamicProxy2 assembly. Any way to check this? 回答1: DotPeek shows this by

Microsoft.SqlServer.Types assembly causes problems with geography datatype. How to fix?

早过忘川 提交于 2020-01-05 07:13:53
问题 After upgrading and changing my project to target network .NET 4.8 and upgrading used Nuget packages to the latest version in package manager. This brought up a host of problem. Most pressing was the inability to use Geography data type in DataReader and Entity Framework. The error in data reading components was: System.InvalidOperationException: DataReader.GetFieldType(x) returned null. The Entity Framework just swallowed the exception (which is an extremely bright idea in itself) and

Microsoft.SqlServer.Types assembly causes problems with geography datatype. How to fix?

故事扮演 提交于 2020-01-05 07:13:23
问题 After upgrading and changing my project to target network .NET 4.8 and upgrading used Nuget packages to the latest version in package manager. This brought up a host of problem. Most pressing was the inability to use Geography data type in DataReader and Entity Framework. The error in data reading components was: System.InvalidOperationException: DataReader.GetFieldType(x) returned null. The Entity Framework just swallowed the exception (which is an extremely bright idea in itself) and