class-library

Regisering a Dll written in C# on a windows server machine - (Install a C# Class Library)

不想你离开。 提交于 2019-12-13 20:05:11
问题 I have written a save and open dialog box add on for a VBA project i'm working on - heres the link VBA: Get Excel FileDialogOpen to point to "My Computer" by default (thanks for the help @mehow). Now this add on (Class Library as it is actually called) works fine with the vba project on my computer which Ive been developing it on. However now to use this add (Class Library) on on the server I'm not able to get addon registered successfully so that the VBA project can see it. I wrote the

Reference to Projects which have references to the same dll with different versions

岁酱吖の 提交于 2019-12-13 19:30:11
问题 in my c# class lib i have referenced different Projects which have references to the same dll with different versions. Both references the nlog.dll but one project version 2.1 and the other 4.2. The referenced project are class libs, too. Most of them are .net 2.0 and some 4.5. 回答1: Just make a Libraries folder if you need to and then create a version folder structure and 'add reference' to each project. If these are nuget packages then you shouldnt need to do this. 回答2: You need to install

Circular referencing with three .NET class libraries - possible or stupid?

血红的双手。 提交于 2019-12-13 08:48:44
问题 I have read other questions about circular references on here but I can't find the answer to my question. I have three class libraries: Authentication, EmailService and ExceptionService. Authentication controls user login to various applications, EmailService sends emails, the ExceptionService logs errors/exceptions to a database. At the moment Authentication references the EmailService and the ExceptionService, to use their functionality, and this works. The ExceptionService references the

Problem with Constructors

拟墨画扇 提交于 2019-12-13 03:39:21
问题 ****Just below is my winform client inst with one parameter constructor within the class.**** private void button1_Click(object sender, EventArgs e) { string s1 = textBox1.Text; int x1 = Convert.ToInt32(s1); int X= x1; ExternalTest ob = new ExternalTest(X); string s2 = Convert.ToString(ob.Y); ob.Y = 0; textBox2.Text = s2; And below this is my class that i added to the project The code below is an added class within the assembly. If i tried to make it a class library and and add addreference -

Referencing a Native C++ DLL in a C# Class Library Project in Visual Studio [duplicate]

老子叫甜甜 提交于 2019-12-13 01:17:03
问题 This question already has answers here : Fast C++ program, C# GUI, possible? [closed] (12 answers) Closed last year . I have a C# Class Library Project in Visual Studio 2015 that creates a C# DLL. I use this plugin for various Unity Projects. There are some math related functions that I have written in Native C++, which I want to access in my above mentioned Class Library Project. Is it possible to create a C++ plugin for the Class Library Project, which will finally be built into the C# DLL?

how to add config file in Class Library, followed by connection string for .NET Core 1.1

徘徊边缘 提交于 2019-12-12 09:41:02
问题 I am working on n-tier application, where I have Data Access Layer. which is independent to any other application. I have create Class Library for .NET Core 1.1, I can see dependencies folder but not any config/JSON file. I want to know, Can I add AppSetting.JSON file in class library project? followed by how can I add connection string. I am aware to override ConfigureBuilder in DbContext class --> SQLServerConnection but I want to keep in separate config file and refer to these connection

How to create a C# session object wrapper?

喜欢而已 提交于 2019-12-12 08:55:08
问题 How do I create a class library where I can get and set like the IIS Session object where I use var x = objectname("key") to get the value or objectname("key") = x to set the value? 回答1: Normally I just have a static class that wraps my session data and makes it type safe like: public static class MySessionHelper { public static string CustomItem1 { get { return HttpContext.Current.Session["CustomItem1"] as string; } set { HttpContext.Current.Session["CustomItem1"] = value; } } public static

Add CSS File in DLL (Class Library)

只谈情不闲聊 提交于 2019-12-11 18:25:55
问题 I have a Class Library project named "AddJsFunction" which contains a class where I am including all related JS, CSS and Image files. Below is the IncludeJsFile method inside the above mentioned class where I am adding all the Javascript files which works as expected. public void IncludeJsFile(Page pg) { pg.ClientScript.RegisterClientScriptInclude(this.GetType(), "Test2", pg.ClientScript.GetWebResourceUrl(this.GetType(), "AddJsFunction.queue.js")); string csslink2 = "<script type='text

.NET Windows Service from dll

一个人想着一个人 提交于 2019-12-11 12:01:57
问题 I have a Windows Service and Service Installer inside of a .NET class library (not an exe). Once the service is installed via installutil, when trying to start, I get the error Windows could not start the xxx service on Local Computer Error 193: 0xc1 In googling I found that this error might be due to the fact that my service is part of a dll, not an exe. Could this be the problem? If so, how can I resolve the issue? If not, what else could be the problem. 回答1: In VS.NET go to New Project

C# Web Service and Web Site sharing library, service returns different “type” of library object

梦想的初衷 提交于 2019-12-11 08:28:05
问题 I have a Web service and a Web site (both C#) in the same solution (For now); I also have a class library in the solution. Both the web service and the web site reference this class library. The web service has a WebMethod that creates an object from the library and returns it. The website invokes this and attempts to put it into a Trainer object (once again, from the same library) ProFitWebService.Service serviceConn = new ProFitWebService.Service(); ProFitLibrary.Trainer