assemblies

What are the best practices for using Assembly Attributes?

喜夏-厌秋 提交于 2019-11-28 14:55:32
I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific? Edit: If you are interested there is a follow up question What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? JRoppert We're using a global file called GlobalAssemblyInfo.cs and a local one called AssemblyInfo.cs. The global file contains the following attributes: [assembly:

AssemblyResolve event is not firing during compilation of a dynamic assembly for an aspx page

末鹿安然 提交于 2019-11-28 14:04:16
This one is really pissing me off. Here goes: My goal is to load assemblies at run-time that contain embedded aspx,ascx etc. What I would also like is to not lock the assembly file on disk so I can update it at run-time without having to restart the application (I know this will leave the previous version(s) loaded). To that end I have written a virtual path provider that does the trick. I have subscribed to the CurrentDomain.AssemblyResolve event so as to redirect the framework to my assemblies. The problem is that the when the framework tries to compile the dynamic assembly for the aspx page

Target non specific version of an assembly

两盒软妹~` 提交于 2019-11-28 13:53:36
I m trying to not target a specific version of a dll but I m not quite sure how. I have set the option Specific Version on the properties of the assembly to false, however if i try to run the application and the version of the requested assembly is a previous one, I get a: FileLoadException: Could not load file or assembly This is happening when the version of the referenced dll does not exactly match the current one. I would believe that the issue is on how to reference this assembly. In general, if you are trying to use a specific version of an assembly the below doesn't really apply, you

Calling .NET methods from VB6 via COM visible DLL

一笑奈何 提交于 2019-11-28 12:53:51
I have created a .NET DLL which makes some methods COM visible. One method is problematic. It looks like this: bool Foo(byte[] a, ref byte[] b, string c, ref string d) VB6 gives a compile error when I attempt to call the method: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. I read that array parameters must be passed by reference, so I altered the first parameter in the signature: bool Foo(ref byte[] a, ref byte[] b, string c, ref string d) VB6 still gives the same compile error. How might I alter the signature to be

How can I use a .Net assembly in Java

自作多情 提交于 2019-11-28 12:39:36
I want to use a Microsoft .Net Assembly in a Java Application. Is there any way out to do that. Any help will be appreciated. Java and .Net run an fundamentally different systems: the JVM and CLR respectively. It's not possible to directly load one into the other and use it. They are incompatible formats. It is possible though to have .Net and Java components interact through a bridge layer. There are several out there which provide this behavior http://www.jnbridge.com/ http://java-dotnet-bridge.com/ Note: Most of these solutions though are aimed at sharing well defined components as opposed

C# Dynamic Loading/Unloading of DLLs Redux (using AppDomain, of course)

无人久伴 提交于 2019-11-28 12:31:20
I've read as many different version of this question as are on Stack Overflow, as well as every blue link on the front page of 3 different Google searches for tutorials, as well as the MSDN (which is kind of shallow beyond executing assemblies). I can only think of my efforts to get Tao to work as a good test case, but believe me, I've tried with a simple string return, a double, a function with parameters, too. Whatever my problem is, it isn't Tao. Basically I want to create a testLibraryDomain.CreateInstance() of my Draw class in the GLPlugin namespace. if( usePlugin ) { AppDomain

Can I run code from a .NET assembly from a command line?

隐身守侯 提交于 2019-11-28 12:16:16
I have a .NET class library (as a .dll file) and that library contains a class with a static method. Is there a way to call that method from a command line? Here is a guide on how to load a dll from Powershell and call methods in it. The most important part of the post are these commands: [C:\temp] PS:25 > notepad MyMathLib.cs (…) [C:\temp] PS:26 > csc /target:library MyMathLib.cs Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42 for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727 Copyright (C) Microsoft Corporation 2001-2005. All rights reserved. [C:\temp] PS:27 >

How do I find out if a .NET assembly contains unmanaged code?

徘徊边缘 提交于 2019-11-28 12:06:17
.NET assemblies that contain a mixture of managed and unmanaged code cannot be ILMerged with other assemblies. How can I verify if a given .NET assembly contains purely managed code, or a mix of managed and unmanaged code? Run the PEVerify tool against your assembly. PEVerify.exe is installed along with Visual Studio, e.g. this one comes with Visual Studio 2012: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\PEVerify.exe As suggested by nobugz, an easier way to see the CLR Flags is using the corflags utility, which is part of the .NET 2.0 SDK. If no options are

Load assembly from network location

懵懂的女人 提交于 2019-11-28 12:01:29
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, please enable the loadFromRemoteSources switch.See http://go.microsoft.com/fwlink/?LinkId=155569 for

.NET Cross-Assembly Performance Hit

我是研究僧i 提交于 2019-11-28 12:00:05
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 fewer times your program flow crosses assembly boundaries, the more efficient it will be... None of these