assemblies

What should I change when the compiler tells me to “Consider app.config remapping” when I have no app.config file?

喜欢而已 提交于 2019-12-23 12:47:55
问题 In compiling a solution ported from .NET 1.1 in VS2003 to .NET 3.5 in VS2008, I get several suggestions, of which this one is representative: Consider app.config remapping of assembly "System.Windows.Forms, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "2.0.0.0" [C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.Windows.Forms.dll] to solve conflict and get rid of warning. Neither project in the

How to get Custom Assembly Attribute with PowerShell

陌路散爱 提交于 2019-12-23 10:15:14
问题 In the AssemblyInfo files of a .net project one can specify a custom assembly attribute via [assembly: AssemblyMetadata("key1", "value1")] My question is how does one retrieve this value from a compiled .net assembly via powershell? I'm able to read all the standard attributes like fileversion, companyname, etc. but I'm having a heck of a time getting the value of this custom attribute (key1) 回答1: Try something like this: 32# (get-date).GetType().Assembly.GetCustomAttributes([Reflection

Injecting assembly version numbers at build time

那年仲夏 提交于 2019-12-23 09:19:59
问题 I want to change the assembly version number of a C# project at build time by passing it as a property on the MSBuild command line. AssemblyInfo Task will modify the assembly version inside a AssemblyInfo.cs before compiling. This is nearly what I want. The problem is I don't want AssemblyInfo.cs to be changed because of source control issues. I don't want all these AssemplyInfo.cs files to show as being modified and needing to be checked in every time we do a build. What I would like is a

Loading an assembly by Bytes loses the location

旧时模样 提交于 2019-12-23 06:58:40
问题 I want to load the assembly via the following var loadedAssembly = Assembly.Load(File.ContentsAsBytes); the File.ContentAsBytes returns the dll as a byte[] , via the following System.IO.File.ReadAllBytes("dll location"); The issue is the loaded assembly ( loadedAssembly ) loses its phyisical location loadedAssembly.CodeBase - is set to the assembly which is loading it (which is not correct) loadedAssembly.Location - is empty Is there a way to load from a byte[] and getting a similar result to

Assemblies in Web.config

不羁的心 提交于 2019-12-23 06:48:28
问题 I've been doing .NET development for about a year, but I still don't know what the purpose of the <assemblies> section is. What is the section's purpose? Can I delete the assemblies specified in there? I asked some senior developers in my team but they just told me to ignore it. Can someone give me a good explanation on it? 回答1: What is the purpose of the assemblies section? The <assemblies> element in an ASP.NET application defines the assemblies that are used during compilation of an

Microsoft Application block DLL V2 and V4.1 references

此生再无相见时 提交于 2019-12-23 05:39:16
问题 My application is referencing Microsoft Enterprise library V4.1 while one of the older DLL (external application) requires a reference to Microsoft Enterprise library V2.0. I know for sure that i can register both of these assemblies in the GAC and the application will start reading relevant DLL as required but that is not a solution for us since our security expert is not agreeing upon accepting this solution. Is there any way using the webconfig where I can specifically specify that the

How to ship gdiplus.dll but not have Windows use it?

孤者浪人 提交于 2019-12-23 05:37:10
问题 i have an application that has a dependancy on gdiplus. i need the application to also run on Windows 2000. i want to include GDIPlus in the application directory, so that Windows 2000 computers will function, but if the machine is Windows XP, Windows Vista, Windows 7, etc, i want it to use the version of GDIPlus that ships, and is updated, with Windows. Not possible? 回答1: From http://msdn.microsoft.com/en-us/library/ms997620.aspx Try adding the following to your manifest :- <?xml version="1

Why can't my .NET CF application find a DLL In the same directory as the executable?

泪湿孤枕 提交于 2019-12-23 03:14:11
问题 I have a .NET CF 1.1 application that has been running perfectly fine for years. Occasionally, I get a help desk ticket with the following error message (generic): Method not found: MethodName AssemblyNamespace.Class The DLL is there, and it's the same version as my other devices. What could change that would make it not find the method. Does this error imply that the assembly was loaded, or did it break before that even happened? Does it matter how I added the reference in Visual Studio

Stuck with “Cannot find type” error using CreateInstance()

淺唱寂寞╮ 提交于 2019-12-23 01:11:25
问题 I am trying to use .CreateInstance() in a connection utility in a C# project, while serializing XML. .Unwrap() is used to unwrap the serializable return type and get an instance of the type I'm trying to create. String fileToLoad = @"D:\RPMOpen\svnCobra\conversion\aui\Model\bin\Debug\RPM_Model"; String file = Path.GetFileName(fileToLoad); AbstractResponseMessageData response = (AbstractResponseMessageData)Activator.CreateInstance(file, responseName).Unwrap(); My assembly RPM_Model at @"D:

Stuck with “Cannot find type” error using CreateInstance()

北城以北 提交于 2019-12-23 01:11:09
问题 I am trying to use .CreateInstance() in a connection utility in a C# project, while serializing XML. .Unwrap() is used to unwrap the serializable return type and get an instance of the type I'm trying to create. String fileToLoad = @"D:\RPMOpen\svnCobra\conversion\aui\Model\bin\Debug\RPM_Model"; String file = Path.GetFileName(fileToLoad); AbstractResponseMessageData response = (AbstractResponseMessageData)Activator.CreateInstance(file, responseName).Unwrap(); My assembly RPM_Model at @"D: