assemblies

Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version

六月ゝ 毕业季﹏ 提交于 2019-11-27 06:53:35
Visual Studio 2008 did let you reference an assembly A from an Assembly B when A was targeting .NET 3.5 and B was targeting .NET 2.0. Visual Studio 2010 doesn't allow for this any more. The full issue is described on MSDN : You can create applications that reference projects or assemblies that target different versions of the .NET Framework. For example, if you create an application that targets the .NET Framework 4 Client Profile, that project can reference an assembly that targets .NET Framework version 2.0. However, if you create a project that targets an earlier version of the .NET

Can strong naming an assembly be used to verify the assembly author?

五迷三道 提交于 2019-11-27 06:45:57
I have been reading the proper article in MSDN, Strong-Named Assemblies and a related Stack Overflow question, Checking an assembly for a strong name . To which extent can a strong-named assembly be verified to avoid tampering? Is it possible to use strong-naming to verify an assembly author? The first question arises after reading the CSharp411 article .NET Assembly FAQ – Part 3 – Strong Names and Signing , which mentions this, among other problems of using strong names: " Cannot Stop Full Replacement. Strong names cannot prevent a hacker from removing the strong name signature, maliciously

Load assembly from network location

北战南征 提交于 2019-11-27 06:42:18
问题 I am trying to load assembly by : Assembly component = Assembly.LoadFrom(componentPath); where componentPath is a full path of network location and get the the following error: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly,

.NET Cross-Assembly Performance Hit

只谈情不闲聊 提交于 2019-11-27 06:40:12
问题 I am reading Bill Wagner's book Effective C# . In Item 32 he is advocating for developers to create smaller, more cohesive assemblies that can be reused more readily. However, in that same item he says: ... Extra Security checks also are done across assembly boundaries. All code from the same assembly same has the same level of trust (not necessarily the same access rights, but the same truth level). The CLR performs some security checks whenever code flow crosses an assembly boundary. The

mscorlib.dll & System.dll

北战南征 提交于 2019-11-27 06:33:13
Why did MS originally make the decision to maintain these two separate core libs? Maybe they had some scalability issue in mind, but nowadays I never see an application, of any type, that doesn't need both. Does anyone have any inside information on this? It's not really important, but been on my mind for years. PS. I know what's in the two libs, I know the difference - I'm a big fan of Reflector :) Just wondering what practical use the separation of the two has. Scott Wisniewski Mscorlib does contains both native and managed code. Amongst other things it contains the System.Object

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

我与影子孤独终老i 提交于 2019-11-27 06:32:17
问题 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>

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

浪子不回头ぞ 提交于 2019-11-27 06:22:02
问题 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() {

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

帅比萌擦擦* 提交于 2019-11-27 05:57:01
问题 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? 回答1: A scenario can be that you have separation of logic between assemblies

How do I create and use a .NET metadata-only 'Reference Assembly'?

此生再无相见时 提交于 2019-11-27 05:37:22
问题 Since version 3.0, .NET installs a bunch of different 'reference assemblies' under C:\Program Files\Reference Assemblies\Microsoft...., to support different profiles (say .NET 3.5 client profile, Silverlight profile). Each of these is a proper .NET assembly that contains only metadata - no IL code - and each assembly is marked with the ReferenceAssemblyAttribute . The metadata is restricted to those types and member available under the applicable profile - that's how intellisense shows a

Using the Web Application version number from an assembly (ASP.NET/C#)

若如初见. 提交于 2019-11-27 05:16:20
问题 How do I obtain the version number of the calling web application in a referenced assembly? I've tried using System.Reflection.Assembly.GetCallingAssembly().GetName() but it just gives me the dynamically compiled assembly (returning a version number of 0.0.0.0). UPDATE: In my case I needed a solution that did not require a reference back to a class within the web application assembly. Jason's answer below (marked as accepted) fulfils this requirement - a lot of others submitted here don't.