.net-assembly

Referencing Library in ASP.NET Core 1.0 (vNext)

这一生的挚爱 提交于 2019-12-05 13:30:59
问题 I am learning ASP.NET Core 1.0 (vNext). With that in mind, I have a solution that is structured like this: MySolution src MyLibrary MyClass.cs project.json MyWebSite Startup.cs project.json I am successfully compiling MyLibrary from the command-line using dnu build . I ran dnu pack which generated MyLibrary.1.0.0.nupkg . There are also two folders: dnx451 and dnxcore50 which both contain MyLibrary.1.0.0.dll . I want to use MyLibrary in MyWebSite , however, I'm confused. How do I "include"

Could not load assembly WebPages.Deployment version 2 at host?

旧时模样 提交于 2019-12-05 12:52:14
问题 I have a ASP.NET MVC 2 website (VS2010) that I have upgraded to ASP.NET MVC 3 (VS2012) and this works fin on local IIS7 but when publishing it I get this exception on host : Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. After some seartch I found this that states that I should set CopyLocal on some of the references(inlcuding the System.Web.WebPages

Could not load file or assembly 'System.ComponentModel.Annotations' in published .Net 4.6.1 project referencing .Net Standard library

最后都变了- 提交于 2019-12-05 11:43:28
PLEASE NOTE : This is not a duplicate of Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0 . Unlike the issue linked, this issue occurs only after publishing the application. As you will see below, I have tried every solution proposed in that post with no success. This issue occurs in a WPF .Net Framework 4.6.1 project which references a .Net Standard 2.0 library which itself references the System.ComponentModel.Annotations NuGet package. The issue is reproduced in the following project: https://github.com/kaitlynbrown/DataAnnotationsError To reproduce the

Web Api: System.Net.Http version 2.0.0.0 not found

巧了我就是萌 提交于 2019-12-05 07:58:17
When I install the NuGet package for WebApi, it gives me version 1.0.0.0 of System.Net.Http, yet it references version 2. I cannot seem to find version 2 for the life of me. When I download .net 4.5 I get System.Net.Http version 4.0.315.x, but I cannot use that because the Web Api assemblies refer to version 2.0.0.0. Anyone know where I can find this version 2.0.0.0? I've tried the NuGet package manager, mvc4, .net 4.5, and nothing is giving me version 2. Thanks in advance. Add the below configuration inside your Web.config file under <system.web> node (assuming your app runs on .NET 4.5,

How to change assembly info in asp.net core?

被刻印的时光 ゝ 提交于 2019-12-05 07:24:24
I want to versioning my asp.net core app. I followed this link: http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/ , but I want to remove project assembly info, but I didn't find it. How to remove duplicated assembly info? I want to override asp core assemblies with another file. BETTER SOLUTION After a while I realize that the best solution is to use a T4 file, the version is incremented automatically after each build. look here: http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/ Set

How to use a Roslyn scripting submission as an assembly in other Roslyn compilations

断了今生、忘了曾经 提交于 2019-12-05 07:08:11
I'd like to reuse a script as a dynamic assembly in another non-scripting Roslyn compilation, but I can't for the life of me figure out how to make that work. For example, say a I create a script the normal way and then emit the script as an assembly to a byte stream using something like: var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); var compilation = script.GetCompilation().WithOptions(compilationOptions); using (var ms = new MemoryStream()) { EmitResult result = compilation.Emit(ms); ms.Seek(0, SeekOrigin.Begin); assembly = Assembly.Load(ms

Assembly Dependencies Change After Installation

荒凉一梦 提交于 2019-12-05 03:35:09
I have a .NET application that seems to have some of its dependency versions change between debugging and running as an installed release app. I'll just focus on the Castle.Core assembly for my details, but the same issue occurs with a couple others as well. A NuGet package I'm using requires Castle.Core as a dependency (all cases of my issue are related to assemblies originating from NuGet, in case it matters). In Visual Studio, when I install the NuGet package with the Castle.Core dependency, everything runs just fine, both in Debug and Release configurations. I can see that the Castle.Core

How to load dylib or .a (static library) file using objective-C?

天涯浪子 提交于 2019-12-05 03:18:11
问题 C# code : (windows) Assembly assembly = Assembly.LoadFrom(AssemblyPath); System.Type[] objTypes = assembly.GetTypes(); Type libType = null; I want to achieve same for Mac where AssemblyPath is path of static library (libTEST.a) or dylib file. Is it possible in Objective-C (Mac)? I tried with NSBundle. But i want some good solution. 回答1: First off, this has precisely nothing to do with Xcode. Now, you can't load static libraries dynamically, because a static library is just a collection of

Load a .NET assembly from the application's resources and run It from memory, but without terminating the main/host application

走远了吗. 提交于 2019-12-05 01:29:28
INTRODUCTION I'm using the next C# code example shared by David Heffernan ' for loading a .NET assembly from the application's resources and run It from memory : Assembly a = Assembly.Load(bytes); MethodInfo method = a.EntryPoint; if (method != null) method.Invoke(a.CreateInstance(method.Name), null); Here I just share an adaptation in VB.NET that I am using too: Public Shared Sub Execute(ByVal resource As Byte(), ByVal parameters As Object()) Dim ass As Assembly = Assembly.Load(resource) Dim method As MethodInfo = ass.EntryPoint If (method IsNot Nothing) Then Dim instance As Object = ass

Reference to assembly without strong name

强颜欢笑 提交于 2019-12-05 01:16:44
Is there a way to reference a library without a strong name? When I add a reference to the assembly in references and rebuild solution everything is fine, but when I call the class from this assembly solution it doesn't build. Output says that referenced assembly should have strong name. What is the best solution? Strong naming library is not preferable. I think the problem you have here is that the assembly you are trying to add the reference from is being signed with a strong name but the assembly you are trying to reference is not signed. A strong-named assembly can only reference other