.net-assembly

c# assembly, friend assembly

允我心安 提交于 2020-12-12 13:23:08
问题 The definition for C# internal access modifier is internal: Accessible only within containing assembly or friend assemblies. So my question is what is c# assembly? what does it mean to be within containing assembly or friend assemblies? Does it mean within same namespace or project? 回答1: An assembly is (in general) a single .dll or .exe file. A C# project (in general) compiles to a single assembly. You can mark a friend assembly using the [assembly: InternalsVisibleTo(...)] attribute. 回答2:

c# assembly, friend assembly

南楼画角 提交于 2020-12-12 13:22:45
问题 The definition for C# internal access modifier is internal: Accessible only within containing assembly or friend assemblies. So my question is what is c# assembly? what does it mean to be within containing assembly or friend assemblies? Does it mean within same namespace or project? 回答1: An assembly is (in general) a single .dll or .exe file. A C# project (in general) compiles to a single assembly. You can mark a friend assembly using the [assembly: InternalsVisibleTo(...)] attribute. 回答2:

How to use “InternalsVisibleTo” attribute with Strongly named assembly?

佐手、 提交于 2020-07-31 07:05:06
问题 I am using the "InternalsVisibleTo" attribute with an assembly to expose the internal methods/classes to my unit test project. I now need to install that assembly into the GAC, so I need to give it a strong name. When I try doing that, I get the following error in Visual Studio. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations A bit of Googling brought me to the article below: https://msdn.microsoft.com/en-us/library/bb763089.aspx This article

Using a resource image in a library different from the main project

一世执手 提交于 2020-05-24 04:27:36
问题 I have a WPF program with two libraries now inside I have a gray resource background both in the main program and HelperLib. But additionally in the HelperLib I have a red background I want to use. Now when I want to change the background of a window with: switch (bubbleType) { case eBubbleType.ERROR: bw.btText.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/Images/gradientWallpaper_RED.jpg"))); <-----I want to use this one break; default: bw.btText

How to share an object across app domains in c# if the class is not serializable

混江龙づ霸主 提交于 2020-05-17 08:49:22
问题 For context, this is a follow-up to this question: How can I reload a class in .net To save the trouble of re-reading that post, my "high-level" problem is I want to do this: while(true) { sleep(naptime); reload_code(); // use magic? do_something_useful(); } Where do_something_useful is compiled separately from the code in the while loop, and reload_code would pick up the latest (compiled) version. I was given a link to another answer on this site, which basically said do_something_useful

C# AppDomain: Execute assembly from entry point

亡梦爱人 提交于 2020-05-13 14:56:28
问题 I am trying to create a Windows sandbox application, building upon the "How to" found here: "https://msdn.microsoft.com/en-us/library/bb763046(v=vs.110).aspx" In the example it loads a specific type from a DLL whereas I would like to be able to execute an assembly from its entry point with restricted permissions. The program I am using for testing purposes is a simple hello world application. using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) {

Load assemblies with references from subfolders at runtime

白昼怎懂夜的黑 提交于 2020-05-13 06:02:45
问题 I am currently working on a project which is supposed to work as a framework for several Add-Ons, which should be loaded at runtime. I am tasked to have following structure in my application folder: 2 Directories with subfolders. One named " /addons " for Add-Ons and one named " /ref " for any additonal references these addons might use (like System.Windows.Interactivity.dll ) When selecting one of the Add-Ons from a menu in the applicaiton, the .dll is supposed to be loaded at runtime and a

Load assemblies with references from subfolders at runtime

一笑奈何 提交于 2020-05-13 05:59:32
问题 I am currently working on a project which is supposed to work as a framework for several Add-Ons, which should be loaded at runtime. I am tasked to have following structure in my application folder: 2 Directories with subfolders. One named " /addons " for Add-Ons and one named " /ref " for any additonal references these addons might use (like System.Windows.Interactivity.dll ) When selecting one of the Add-Ons from a menu in the applicaiton, the .dll is supposed to be loaded at runtime and a