.net-assembly

Using project references as assembly paths in T4

Deadly 提交于 2021-02-06 08:56:44
问题 I have a .tt script that needs to reference a couple of external assemblies. Is it possible for the T4 host to automatically include the assemblies referenced in the project - rather than me manually adding an assembly directive for each one? E.g. Referencing an assembly from a nuget is a moving target when using a path relative to $(ProjecDir) . Using assembly paths like $(Project)\bin\Debug\Example.dll also seems less than optimal - as it requires the build to have been successful

Using project references as assembly paths in T4

百般思念 提交于 2021-02-06 08:54:15
问题 I have a .tt script that needs to reference a couple of external assemblies. Is it possible for the T4 host to automatically include the assemblies referenced in the project - rather than me manually adding an assembly directive for each one? E.g. Referencing an assembly from a nuget is a moving target when using a path relative to $(ProjecDir) . Using assembly paths like $(Project)\bin\Debug\Example.dll also seems less than optimal - as it requires the build to have been successful

Loading plug-in DLL files, “The invoked member is not supported in a dynamic assembly.”

て烟熏妆下的殇ゞ 提交于 2021-02-06 07:57:09
问题 We have custom DLL's that are not included in our initial setup file. They are loaded at runtime. This process worked fine while using .NET 2.0, but we are getting the "The invoked member is not supported in a dynamic assembly" error message now that we are using .NET 4.0. try { assem = Assembly.LoadFrom(fi.FullName); //fi is FileSystemInfo } catch (FileLoadException) {} catch (BadImageFormatException) {} catch (System.Security.SecurityException) {} catch (ArgumentException) {} catch

Loading plug-in DLL files, “The invoked member is not supported in a dynamic assembly.”

不问归期 提交于 2021-02-06 07:56:21
问题 We have custom DLL's that are not included in our initial setup file. They are loaded at runtime. This process worked fine while using .NET 2.0, but we are getting the "The invoked member is not supported in a dynamic assembly" error message now that we are using .NET 4.0. try { assem = Assembly.LoadFrom(fi.FullName); //fi is FileSystemInfo } catch (FileLoadException) {} catch (BadImageFormatException) {} catch (System.Security.SecurityException) {} catch (ArgumentException) {} catch

Loading .NET Assembly From Memory Instead of Disk [closed]

荒凉一梦 提交于 2021-02-06 05:35:17
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Improve this question I am having a perplexing problem trying to load a .NET assembly from memory instead of from the disk. If I compile the assembly and then load it from disk (either using LoadFile or LoadFrom), then the application works just fine. However, if I include the compiled

Loading .NET Assembly From Memory Instead of Disk [closed]

人盡茶涼 提交于 2021-02-06 05:34:33
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Improve this question I am having a perplexing problem trying to load a .NET assembly from memory instead of from the disk. If I compile the assembly and then load it from disk (either using LoadFile or LoadFrom), then the application works just fine. However, if I include the compiled

C# Reflection - How to reload a class on runtime?

可紊 提交于 2021-02-05 09:13:06
问题 Currently I am working on a project in C# where I have to implement reflection. I have created a WPF application with a GUI. This GUI contains a combobox which contains all the classnames that implement a specific interface. The classes with the displayed classnames live in the same solution. Next to the combobox is a button to refresh the content in the combobox. However, when I run my application, modify a classname that implements the interface, and click on that refresh button the changes

C# Reflection - How to reload a class on runtime?

…衆ロ難τιáo~ 提交于 2021-02-05 09:12:06
问题 Currently I am working on a project in C# where I have to implement reflection. I have created a WPF application with a GUI. This GUI contains a combobox which contains all the classnames that implement a specific interface. The classes with the displayed classnames live in the same solution. Next to the combobox is a button to refresh the content in the combobox. However, when I run my application, modify a classname that implements the interface, and click on that refresh button the changes

.net core 1.1: Type.GetType from external assembly returns null

谁说我不能喝 提交于 2021-02-04 17:53:16
问题 I'm porting a console app to .NET core which load types from external libraries. In full .NET Framework using Type.GetType("typename, assemblyname") works when the assembly is located in the same folder that executable. In .NET Core, it returns null, wherever I place the library. As a workaround I've installed the System.Runtime.Loader package and attached to Resolving event to force the loading from a full path: AssemblyLoadContext.Default.Resolving += Default_Resolving; type = Type.GetType

How to create a Reference Assembly with Visual Studio 2017

痞子三分冷 提交于 2021-01-29 10:04:54
问题 I'm trying to create a Reference Assembly with Visual Studio 2017 and not with the command line. I've created a new class library project using Visual Studio 2017 and I've modified the constructor of the default class like this: using System; namespace ReferenceAssembly { public class Class1 { public Class1() { throw new Exception("Hello World"); } } } As I want a reference assembly, I hope the constructor's implementation like throw null and not throw new Exception("Hello World"); If I