class-library

Debugging a Class Library

独自空忆成欢 提交于 2019-12-23 03:13:35
问题 I have a few class libraries in my ASP.net Web Application. I have been debugging them with no problems then suddenly, BAM! Monday morning I get this error and I can hit any break points: The following module was built wither with optimizations enabled or without debug information: To debug this module, change its project build configuration to Debug mode. To supress this message, disable "warn if no user code on launch" debugger option. Does anyone have any ideas as to what is causing this?

Web Api 2.2 - Code First Migration in Class Library Project

喜欢而已 提交于 2019-12-23 02:41:22
问题 I have two projects in myVS 2015 solution. Project A Web Api 2.2 Project Main Project where DBContext class and connection string (in web.config file) is defined Project B Class Library Project Project A added as a reference Models & Controller Defined Models inherits a class of Project A Created a DBContext class which inherits DBContext from Project A. public DbSet Planets { get; set; } My idea behind the above project structure is: To reduce the complexity when project grows larger To make

Azure class library access GetConfigurationSettingValue vs. web.config

喜欢而已 提交于 2019-12-21 13:11:09
问题 I have a class library shared between an Azure Worker Role and a ASP.NET Website. A method in the library needs to pull a value from the config to determine if it should send an email or not. In the ASP.NET site, the setting is in web.config: <add key="SendEmails" value="true"/> And in the Azure worker role it is in ServiceConfiguration.Cloud.cscfg: <Setting name="SendEmails" value="true"/> What I am trying to do is have my class library be able to access either config setting, depending on

WCF Service Library vs Class Library project types

流过昼夜 提交于 2019-12-21 03:29:08
问题 What does a WCF Service Library do that a regular class library doesn't? Edit: I posted my own answer. Am I missing anything? Are they fundamentally both just class libraries with a few template classes added? 回答1: I created both and compared. This is what I found. WCF Service Library adds references to System.Runtime.Serialization and System.ServiceModel . does not contain a reference to System.Data.DataSetExtensions as the Class Library does. contains sample service classes IService1 ,

Referencing mscorlib 4.0.0.0 from .NET Core 1.0 class library

这一生的挚爱 提交于 2019-12-18 05:45:15
问题 I have a .NET Core 1.0 class library which targets .NET 4.6.1 and references the .NET Standard Library 1.6.0 and Identity Framework 2.2.1 project.json { "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "2.2.1", "System.Runtime": "4.1.0", "NETStandard.Library": "1.6.0" }, "frameworks": { "netstandard1.6": { "imports": [ "net461" ] } } } In my project I'm just creating the identity models, which extend the base Identity Framework models (User, Role etc). When

How to debug a class library in Visual Studio

折月煮酒 提交于 2019-12-17 23:17:52
问题 I am working on a class library (DLL) project in Visual Studio 2008; programming in C#. In order to test my DLL I just created a second project that is a console application and in that project I can reference the first and run tests. Is there a simpler way of doing this? Can I just create another file within my class library project that has the tests in it and then somehow tell Visual Studio to run that file? I know one way would be to add a text file to my project and then write my test

How to convert a Class Library project to a Web Application project?

冷暖自知 提交于 2019-12-17 21:50:00
问题 Long story short, because of some issues with architecture and the fact that someone already put a few .aspx files in a class library, I'd like to just finish off the change and convert a class library to a web application. This is using Visual Studio 2010 and .NET 4.0. Is there an easy way of doing this? Thanks! EDIT: I was hoping for a better method than recreating the project, I had too many issues with broken references when I tried just creating a new project, including one I could never

Where is the implementation of InternalEquals(object objA, object objB)

不想你离开。 提交于 2019-12-17 16:38:31
问题 While disassembling the .Net Source Code using Reflector, I came upon the Equals implementation in the Object Class and it refers to bool InternalEquals(object objA, object objB); Which again refers to internal static extern bool InternalEquals(object objA, object objB); I am now confused regarding where to find the implementation of this InternalEquals(object objA, object objB) function and how is it using this function and in which .Net assembly is this function defined and also if each and

What is the difference between .NET Core and .NET Standard Class Library project types?

主宰稳场 提交于 2019-12-17 05:15:32
问题 In Visual Studio, there are at least 3 different types of class library you can create: Class Library (.NET Framework) Class Library (.NET Standard) Class Library (.NET Core) While the first is what we've been using for years, a major point of confusion I've been having is when to use the .NET Standard and .NET Core class library types. I've been bitten by this recently when attempting to multi-target different framework versions, and creating a unit test project. So, what is the difference

How do I stop my class library generating an .EXE file and causing a TypeLoadException Exception?

你离开我真会死。 提交于 2019-12-14 04:00:32
问题 I've got a really strange error occurring in my solution one of my projects which is a class library is causing a project it is referenced in to throw a TypeLoadException. I've looked through various answers on SO and the closest to my issue is; TypeLoadException was unhandled in C# [closed] This answer led me to question if this was my issue, doing some digging in the debug folders I found that my project that was referencing my class library is generating a DLL and EXE with the same name,