class-library

Get UserId from class library project

[亡魂溺海] 提交于 2019-12-25 01:53:08
问题 Is there a way to get the UserId from a class library project? This class library project logs everything a user does and write it to a database. But I need the UserId too which I can't get from any project except a web project. I also would need the user's ip address from the class library project. Anyone has done this before in an asp.net-mvc project and could share it how to do it? 回答1: I had a similar situation in my current project, the way I did it was to pass the UserID as a parameter

DLL lazy loading

房东的猫 提交于 2019-12-24 11:41:01
问题 I have complex .NET class library is dependent on several other .NET class libraries, but not all of them are used in every situation. Is there any way to mark them as 'Lazy loading', so I can delete it from folder if I know it is not used at all? 回答1: All assemblies are always loaded on demand. If you remove an assembly from a folder, the application will work until the point where it needs to load that assembly. 来源: https://stackoverflow.com/questions/22862777/dll-lazy-loading

Overriding methods from Library Project

天大地大妈咪最大 提交于 2019-12-24 08:37:03
问题 I am working on Windows Phone 8 application. I have a Windows Phone Class Library project(Called Base) and Windows Phone App(called child). In my Base project i have a class which has methods and static variables. Eg: Class Settings { public static string AppName = "Base"; public virtual List<String> TabDetails() { List<String> TabDetails = new List<string>(); helpTabDetails.Add("AAA"); helpTabDetails.Add("BBB"); return helpTabDetails; } } Now in my child app i am just linking this class (by

Class Library Intellisense not showing up after adding the dll to the references

我们两清 提交于 2019-12-24 04:52:09
问题 In C#, I made a ClassLibrary that has one Namespace and one Class. I saved it and build it. in other Projects, when i use it, I add it to my references by browsing to the .dll location. But The Problem is that its name is not showing up in the Intellisense. i.e when I: using ... my dll doesn't show .. I'm Importing the library to a ConsoleApp. both of the App and the library target Framework is .NET Framework 4.0 and I made their Assembly Version 4.0.0.0 so they're the exact same. is there a

Class Library Intellisense not showing up after adding the dll to the references

房东的猫 提交于 2019-12-24 04:52:05
问题 In C#, I made a ClassLibrary that has one Namespace and one Class. I saved it and build it. in other Projects, when i use it, I add it to my references by browsing to the .dll location. But The Problem is that its name is not showing up in the Intellisense. i.e when I: using ... my dll doesn't show .. I'm Importing the library to a ConsoleApp. both of the App and the library target Framework is .NET Framework 4.0 and I made their Assembly Version 4.0.0.0 so they're the exact same. is there a

How to locate the meta files generated by EF in a class library?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 02:55:23
问题 I've moved my Entity Framework 4 model to a class library. The meta files are built to \bin\Debug What is the connection string I use to locate the meta files in the class library? I have tried: <add name="Models.DataModelConnectionString" connectionString="metadata=res://MyClassLibrary, 1.0.0.0, neutral, null/bin/Debug/Models.DataModel.csdl|res://MyClassLibrary, 1.0.0.0, neutral, null/bin/Debug/Models.DataModel.ssdl|res://MyClassLibrary, 1.0.0.0, neutral, null/bin/Debug/Models.DataModel.msl

ASP.Net 5 project referencing old class library

无人久伴 提交于 2019-12-24 02:10:50
问题 I was trying repository pattern with ASP.Net 5 project and service project. I referenced my " .Service" class library project into my " .Web" project but something went wrong with the reference. I removed all referenced to other libraries, even removed my " .Service" and " .Web" projects and added new empty ones but the newly created " .Web" project still referencing the old version of deleted " .Service" project. " .Web" > ASP.Net 5 project. " .Service" > .Net Framework 4.5.1 class library

.NET - Storing An App.config With A Class Library

非 Y 不嫁゛ 提交于 2019-12-23 18:13:06
问题 This seems to be asked a lot on the internet, but so far my research hasn't produced a solution. (And, at least for now, I haven't accepted "it can't be done" as a solution.) At its simplest description, what I'm trying to do is have a config file in a .NET class library project that is available to that class library in any application that references it. My setup can be simplified to 3 WCF services sharing some domain logic. One of the things they share is an injected dependency of a logger

why connection string is not found from my class library to another class library?

不羁的心 提交于 2019-12-23 12:39:01
问题 I am having the architecture like this : Where MVC layer is the presentation layer. EF is class library and Repository is another class library.I am trying to insert data to database from repository by creating the EF context object. Added EF reference into Repository class library. EF having the edmx file. its app.config having the connection string generated by EF. code is : public bool CreateUser(User _user) { context.Users.Add(_user); context.SaveChanges(); return true; } but while

How do I install a C# class library in Visual Studio?

拜拜、爱过 提交于 2019-12-23 09:02:31
问题 I am trying to use a class library which I found on a different question here. I am quite new to C#, Visual Studio, and OOP in general, so please excuse me if this is not the right question. I followed the link and downloaded the zip. The help file does not seem to contain any directions on how to get Visual Studio to utilize the library. I figure that I have to tell it to use the library somehow, but I really don't know what to do. Or maybe I need to copy the .dll to a specific folder. I