assemblies

Cannot add assemblies to .Net Core application in Visual Studio 2019

最后都变了- 提交于 2020-08-10 04:05:38
问题 When I try to add a missing assembly to my project (for unit testing specifically) I noticed that the Assemblies tab is missing in the "Add Reference" dialog , see: Is this a bug or a expected behavior? If it's expected how we are supposed to add the missing assemblies. Note that I already tried through Nuget package manager and still didn't work. 回答1: It is correct behaviour. The Assemblies tab is not available for Net Core projects. You wont be able to add assemblies from your system,

T4 template VS2010 get host assembly

不问归期 提交于 2020-07-05 03:34:09
问题 I want to get a reference to assembly of a project in which T4 template is. I know I can get path to the project with, for example Host.ResolveAssemblyReference("$(ProjectDir)") and I could maybe add bin\\debug\\{projectName}.dll because my assembly names are named by project name, but that is not always the case and I'm creating reusable template, so I need path to dll or most preferably Assembly instance. I have also found how to get reference to the Project as explained here in method

Visual Studio '17 not showing assemblies in reference manager

冷暖自知 提交于 2020-06-17 03:11:35
问题 I've the issue that I can't seem to figure out how to add references to certain solutions. In most of the solutions I start in Visual Studio '17 I see "References" in my solution explorer, but e.g. for a asp.net core web api I get "Dependencies" instead. Whenever the solution shows the "References" I can view the "assemblies" tab in the "Reference Manager", but for solutions that have the "Depedencies" I can't see it ( as shown in example below ). 回答1: .Net core only works with NuGet packages

Visual Studio '17 not showing assemblies in reference manager

隐身守侯 提交于 2020-06-17 03:08:08
问题 I've the issue that I can't seem to figure out how to add references to certain solutions. In most of the solutions I start in Visual Studio '17 I see "References" in my solution explorer, but e.g. for a asp.net core web api I get "Dependencies" instead. Whenever the solution shows the "References" I can view the "assemblies" tab in the "Reference Manager", but for solutions that have the "Depedencies" I can't see it ( as shown in example below ). 回答1: .Net core only works with NuGet packages

GetEntryAssembly for web applications

若如初见. 提交于 2020-03-30 04:37:08
问题 Assembly.GetEntryAssembly() does not work for web applications. But... I really need something like that. I work with some deeply-nested code that is used in both web and non-web applications. My current solution is to browse the StackTrace to find the first called assembly. /// <summary> /// Version of 'GetEntryAssembly' that works with web applications /// </summary> /// <returns>The entry assembly, or the first called assembly in a web application</returns> public static Assembly

Hooking into an “OnLoad” for class library

荒凉一梦 提交于 2020-02-11 08:26:47
问题 Does anyone know if there's a way to hook into an "OnLoad" event to run some operations when an assembly loads? Specifically, I am creating a plug-in for an application. The plug-in's DLL gets loaded and objects start being used, but the problem is I need to load another assembly dynamically before anything happens. This assembly can't be copied to the application's directory and must remain invisible to it. 回答1: You need to hook on to AssemblyLoad event. Refer- http://msdn.microsoft.com/en

StructureMap - Ability to replace an assembly at runtime

与世无争的帅哥 提交于 2020-02-08 02:42:07
问题 Example: Console application: class Program { static void Main(string[] args) { var calculator = ObjectFactory.GetInstance<ICalculator>(); for (var i = 0; i < 10; i++) { Console.WriteLine(calculator.Calculate(10, 5)); Console.ReadLine(); } Console.ReadLine(); } } Assembly "Interface": public interface ICalculator { int Calculate(int a, int b); } Assembly "Implemenation": internal class Calculator : ICalculator { public int Calculate(int a, int b) { return a + b; } } Assembly "Implemenation",

StructureMap - Ability to replace an assembly at runtime

a 夏天 提交于 2020-02-08 02:42:07
问题 Example: Console application: class Program { static void Main(string[] args) { var calculator = ObjectFactory.GetInstance<ICalculator>(); for (var i = 0; i < 10; i++) { Console.WriteLine(calculator.Calculate(10, 5)); Console.ReadLine(); } Console.ReadLine(); } } Assembly "Interface": public interface ICalculator { int Calculate(int a, int b); } Assembly "Implemenation": internal class Calculator : ICalculator { public int Calculate(int a, int b) { return a + b; } } Assembly "Implemenation",

fsi.exe Assembly: Anyone know how to embed it?

北城余情 提交于 2020-02-03 05:14:05
问题 Long time reader, very first question. fsi.exe is a .NET executable and therefore contains its own assembly complete with all the yummy methods and whatnot fsi uses to execute F# scripts. Looking at the assembly in .NET Reflector (pick your class, but Shell is the best example) reveals a bunch of garbage* names that look like decorated C++ functions (say, from Dependency Walker). Incidentally and slightly beside the point, F# assemblies compile in much the same way, with lots of garbage*

ILMerge and localized resource assemblies

一曲冷凌霜 提交于 2020-01-29 04:38:24
问题 We have an application whose structure when compiled looks something like this: Foo nb-NO Text.resources.dll sv-SE Text.resources.dll Bar.dll Foo.exe Text.dll Is it possible to use ILMerge on this? How would you do that? 回答1: I asked my own variant of this question and eventually got/implemented an answer: Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) - possible? Hope this helps. 回答2: Disclaimer: I work for the company that makes