assemblies

Project References DLL version hell

霸气de小男生 提交于 2019-11-30 03:45:43
We're having problems getting visual studio to pick up the latest version of a DLL from one of our projects. We have multiple class library projects (e.g. BusinessLogic, ReportData) and a number of web services, each has a reference to a Connectivity DLL we've written (this ref to the connectivity DLL is the problem). We always point references to the DLL in the bin/debug folder, (which is where we always build to for any given project) and all custom DLL references have CopyLocal = True and SpecificVersion = False ReportData has a reference to business logic (which also has a reference to

.NET assembly loading priorities

孤街浪徒 提交于 2019-11-30 01:55:33
I have a solution with 3 projects (GUI, BL and DAL). The DAL assembly is signed and deployed in the GAC. When I build the solution the DAL is compiled and the assembly placed in the bin folder of the main project. But when I run the application, it loads the GAC version instead of the local one. Why is this? I realized that because the version in the GAC was not the latest one and some methods were missing, although it compiled fine. Does the GAC have priority over the local bin folder? Tks in advance Short answer Yes , the GAC has precedence over local files. this is a different behavior from

How to get C#.Net Assembly by name?

一个人想着一个人 提交于 2019-11-30 01:39:26
Is there something like: AppDomain.CurrentDomain.GetAssemblyByName("TheAssemblyName") so instead of looping through AppDomain.CurrentDomain.GetAssemblies() , we could just get the specific assembly directly. cyberzed Have you tried looking at Assembly.Load(...) ? I resolved with LINQ Assembly GetAssemblyByName(string name) { return AppDomain.CurrentDomain.GetAssemblies(). SingleOrDefault(assembly => assembly.GetName().Name == name); } It depends on what you're trying to accomplish. If you just want to get the assembly, then you should call System.Reflection.Assembly.Load() (as already pointed

How to reference a namespace from a specific assembly?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 01:29:17
So here is my problem. My (test) project references both Castle Windsor and Rhino Mocks. I am creating a class which implements Castle.Core.Interceptor.IInterceptor from the Castle.Core.dll assembly In building Rhino Mocks, Ayende used Castle.Core.Interceptor and includes the whole darn namespace inside the Rhino.Mocks.dll So when I try to build, I get the error The type 'Castle.Core.Interceptor.IInterceptor' exists in both 'c:...\Libraries\Rhino.Mocks.dll' and 'c:...\Libraries\Castle.Core.dll' How then do I specify that I want to use the IInterceptor instance from the Castle.Core.dll rather

Side effects of calling Assembly.Load multiple times

强颜欢笑 提交于 2019-11-30 00:50:58
问题 If one calls Assembly.Load multiple times does it cause any side effects? e.g. for (int i = 0; i < N; i++) { Assembly.Load(assemblyStrongName); // ....... } This loads the assembly one time doesn't it? I've checked with AppDomain.CurrentDomain.GetAssemblies() before and after and it seems it's loaded one time (as it should) but does it have side effects? In a long running server application (runs for months/years with no restart) does the above cause any issues? 回答1: This loads the assembly

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Elmah.MVC issue

旧时模样 提交于 2019-11-29 20:55:54
Locally - my MVC 4, asp.net, c# app runs fine on IIS 8 / Windows 8. When deployed to Windows Server 2008, I get this error: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) and [FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition

Should I have a separate assembly for interfaces?

巧了我就是萌 提交于 2019-11-29 20:34:24
We currently have quite a few classes in a project, and each of those classes implement an interface, mostly for DI reasons. Now, my personal feeling is that these interfaces should be put into a separate namespace within the same assembly (so we have a MyCompany.CoolApp.DataAccess assembly, and within that there's an Interfaces namespace giving MyCompany.CoolApp.DataAccess.Interfaces ). However, somebody has suggested that these interfaces should actually be in their own assembly. And my question is - are they right? I can see that there are some benefits (eg. other projects will only need to

Problem getting the AssemblyVersion into a web page using Razor /MVC3

与世无争的帅哥 提交于 2019-11-29 20:24:51
I'm using the following code in a footer in my _Layout.cshtml file to put the AssemblyInfo version data into the footer of every page in my MVC3 site. However: @System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() Just prints in the footer: Revision 0.0.0.0 When I modified the view to display all of the assembly info for the "Executing Assembly" using the following @System.Reflection.Assembly.GetExecutingAssembly().GetName().ToString() Which prints the following: Revision App_Web__layout.cshtml.639c3968.hlogy75x, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

“Why is my .net exe so huge” analyzer tool?

余生长醉 提交于 2019-11-29 19:35:32
问题 Is there a tool that can explain the size of a .NET assembly (executable or DLL file)? In the olden days, there was an IDE extension that would detail the space used by a project. It should show the large code files: And data resources : Is there such a thing for the .NET world? I really thought that moving to .NET, and no longer having to build the entire VCL into the executable, that executable sizes would shrink. Bonus Reading Analyze space used by .NET assembly 回答1: The standard SDK took

Parsing plain Win32 PE File (Exe/DLL) in .NET

家住魔仙堡 提交于 2019-11-29 18:41:01
问题 I need to parse plain Win32 DLL/Exe and get all imports and exports from it to show on console or GUI (i.e. Win Forms). Is it possible to parse Win32 DLL/Exe in C#.NET by reading its export/import tables and get managed types from it? As it's unmanaged PE, .NET doesn't allows you to convert unmanaged PE files to managed .NET assemblies, it only generates COM managed assemblies. How can I parse these tables and take all of its methods (signatures) in managed form. (e.g. if char* as argument,