assemblies

Serialization Assembly. Is it needed or not?

ε祈祈猫儿з 提交于 2019-11-28 11:55:29
I have a .net 2.0 c# ClickOnce app and it connects to its data via Web Services. I've been told that one way to potentially speed up the application is to generate a serialization assembly beforehand. I have several questions on this front. The default setting to whether to generate a serialization assembly is Auto. What criteria does VS2005 use to decide whether to generate a serialization assembly or not? It seems like it does not generate under Debug configuration, but it does under Release configuration, but I can't tell for sure and can't the information anywhere. Does serialization

Project reference work-around .net 4.5 and .net 3.5

∥☆過路亽.° 提交于 2019-11-28 11:41:30
In continue for this thread: Mixing .NET 3.5 with 4/4.5 assemblies in the same solution/project I found a workaround: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/36b1a209-55d5-4323-91dc-0919ba2e1d03/ What it basically do, get my solution compile and determine each project under what CLR to run. Does anyone see disadvantage to this ? It builds the projects, on my 3rd party api that must run on .net 3.5, i explicity write on its App.config to run with CLR 2.0 and not 4.0 <startup> <supportedRuntime version="v2.0.50727"/> <!--<supportedRuntime version="v4.0"/>--> </startup> EDIT: My

C# - Cannot getting a string from ResourceManager (from satellite assembly)

人盡茶涼 提交于 2019-11-28 11:38:29
I'm developing a localisable application. In my "local" resource file, I've the language used by default (english) and if possible, I load the user's preference and culture and load strings translated in is language. So what I've done : private static CultureInfo _culture = CultureInfo.CurrentUICulture; private static ResourceManager _manager; private static void ToNeutralCulture() { while (!_culture.IsNeutralCulture) { _culture = _culture.Parent; } } private static void LoadCulture() { ResourceManager manager = Properties.Resources.ResourceManager; try { ToNeutralCulture(); string assembly =

When should [assembly: InternalsVisibleTo()] be used?

不问归期 提交于 2019-11-28 10:55:53
I understand that the InternalVisibleTo attribute is used to expose types and methods with the internal access modifier to a specified assembly. I have only ever used this for exposing internal methods to a separate assembly containing a suite of unit tests. I am struggling to think of another scenario when this should be used. Was this attribute introduced specifically to aid unit testing or was there another reason? A scenario can be that you have separation of logic between assemblies (like internal data objects and the logic layer). You don't want to expose the classes to your users, but

Get paths of assemblies used in Type

Deadly 提交于 2019-11-28 10:15:32
I need a method that takes a Type and returns the paths of all assemblies that used in the type. I wrote this: public static IEnumerable<string> GetReferencesAssembliesPaths(this Type type) { yield return type.Assembly.Location; foreach (AssemblyName assemblyName in type.Assembly.GetReferencedAssemblies()) { yield return Assembly.Load(assemblyName).Location; } } Generally this method do the job, but have some disadvantages: I didn't found how to get the referenced assemblies/types from the type itself, so i used type.Assembly.GetReferencedAssemblies() and got the references of the whole

A procedure imported by {myassembly} could not be loaded

余生长醉 提交于 2019-11-28 09:01:40
when running a prorgam, it seems that I am missing a library, when I launch the output of my project I get an exception at startup. A first chance exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll Additional information: A procedure imported by 'my assembly, Version=xx.1.1.0, Culture=neutral, PublicKeyToken=7292581204d9e04a' could not be loaded. 'ScriptX.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',

Strange Error - CS0012: The type x is defined in an assembly that is not referenced

六眼飞鱼酱① 提交于 2019-11-28 08:56:06
The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the correct(same) version. The rest of application has no issues except for one .aspx page. The page in question has a repeater that displays a user control as one of its "fields". Upon binding a list of type y to the repeater I pass the user control a list of type x (a property of y) as shown here: <uc1:usercontrol id="ucusercontrol " runat="server"

Is it possible to execute a .NET dll without an exe to load it?

核能气质少年 提交于 2019-11-28 08:09:34
I'm curious if there's a way to execute a static .DLL method in a new process without having to create an .EXE for it? AFAIK, this isn't possible with native Win32/64 DLLs. How about .NET DLL assemblies? UPDATE : I forgot to mention I'm primarily interested in doing this programmatically (from C# code, to be specific). Thanks! CONCLUSION : Although no one "dared" to spell it out, the answers all seem to lean towards 'no'. One needs to start a process through one of the conventional ways (EXE, PowerShell, etc.) then convince that process to load the DLL and execute the code within. I guess I

How to find out which assembly handled the request

风格不统一 提交于 2019-11-28 07:45:15
I have a Web solution which contains two projects ( A and B ) with B referencing A . In A I have an Html extension method that obviously can be called from either A or B . My question is once the method is called (usually from a partial view) is there a way inside the method to figure out whether the call came from Assembly A or Assembly B without passing anything to it? I tried to see if I can do anything with HttpContext.Current.Request but could not find anything useful. I can get the URI but that still does not tell me which assembly the file that originated the Request is in. Thanks for

How do I add an assembly to a Visual Studio project and reference it?

若如初见. 提交于 2019-11-28 07:21:04
问题 I've compiled an assembly for MySql.Data.dll and would like to add it to a new Visual Studio Project. I'm lost on the correct terminology and how best to go about this, but the end goal is to distribute this dll so that it's included with the application when the application runs. This is to avoid having to GAC the dll on the end user's machine. I've tried simply copying the assembly into the project folder: However, I can't figure out how to add a reference to that dll in the current project