Skip to main content

All Questions

Tagged with
0 votes
1 answer
65 views

How to register DI Services in .net core class library?

I want to add some services in my class library project and I found some ways on Google for this https://mcguirev10.com/2018/01/31/net-core-class-library-dependency-injection.html. However, I don't ...
shah Taymur's user avatar
-1 votes
1 answer
154 views

How to create a class library (c#) in visual studio code using .net 4.7 version

I am trying to create a class library from visual studio code, as i cannot use visual studio because of some organizational limits. So when i tried to create the class library i was able to use the c# ...
Roshan K S's user avatar
0 votes
0 answers
67 views

Error on BlazorWebView and Class Library with Winform

I have a class library (CL) project which has a class I register to COM. This CL has a project reference to a Razor Class Library which has some components I want to show on a Windows Forms dialog ...
alexxchela's user avatar
2 votes
1 answer
505 views

Source Generators for class library project in c#

Is this possible to generate code with Source Generator in c# into class library project? I would like this auto-generated code to be packed into Nuget package then. When I try to build a project made ...
user avatar
0 votes
0 answers
21 views

NU1102 Unable to find package Communications.Interface with version (>= 6.0.0)

I have a .net class library called Communications.Interface, this is the .csproj of this project : <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework&...
Faouzeya's user avatar
  • 311
0 votes
1 answer
194 views

Reference to System.Windows.Forms in .net7.0 class library project

I need to add a reference to System.Windows.Forms in class library project written in .net7.0 that will be distributed in NuGet for my young students. How can this be done? The class that I want to ...
Eikey's user avatar
  • 29
-1 votes
1 answer
689 views

C# Run Class Library

I am building a C# project in Jetbrains Rider. When the project is finished, I want to include it in another project by building a dll and adding the dll to the project. To generate a dll, I need to ...
Zeek Joseph's user avatar
0 votes
0 answers
50 views

ServicePointManager not initialised when in CLR class library?

I've inherited a CLR class library (.NET Framework 4.7.2) that provides a function which queries table storage in Azure. The function, called from a native C++ executable, is currently failing because ...
Eleco Martin's user avatar
0 votes
1 answer
702 views

Where do I perform startup in a .NET class library?

Haven't done .NET for years, getting back into it. I would like to know where I perform startup in a class library I am developing. This class library will have several different HttpClients, and I ...
serlingpa's user avatar
  • 12.5k
2 votes
1 answer
172 views

Possible to increment DLL version automatically

I have a C#/VB .Net Class Library which is used in multiple projects. One of the issues we face is if a change is made to this Class Library it needs to be deployed to multiple projects. As you can ...
Computer's user avatar
  • 2,199
-1 votes
1 answer
517 views

Quartz .net 6 : Execute method does not work

Exetuce method in Ijob is not triggered. class library code: public static async void Start() { try { using (var dbContext = new SqlDbContext()) ...
Batu han's user avatar
0 votes
2 answers
161 views

Can I use the same function in different ASP.NET pages?

protected void DropDownMainProduct_SelectedIndexChanged(object sender, EventArgs e) { string mainProductCode = DropDownMainProduct.SelectedValue; if (mainProductCode == "0") { ...
user avatar
0 votes
1 answer
429 views

Unable to build a multi-targeting .NET library for net20 and net35 after switching to Visual Studio 2022

Recently I've moved to using Visual Studio 2022, while uninstalling my previous IDE (Visual Studio 2019). I work on a class library project which uses the multi-targeting feature of the new SDK-style ....
stackh34p's user avatar
  • 8,959
14 votes
1 answer
5k views

What's the difference between a MAUI class library and a normal class library?

As far as I can tell a MAUI Class Library is a class library in .NET 6, where you can inject platform specific code. But is there really any other difference between a MAUI library and a .NET 6 ...
GottaLovePizzas's user avatar
0 votes
1 answer
825 views

How to reference .Net 6.0 project from WinUI 3 project?

I have a .NET 6.0 C# class library project that contains platform-independent code (let's call this BusinessLogic). In my same solution, I would like to create a project for a WinUI 3 app that ...
Michael Kintscher they-them's user avatar
1 vote
4 answers
102 views

How to clean up repetetive elements in a C# method?

I'm currently working on a .NET Core 3.1 application. I need to refactor a code smell to reduce method complexity - in my method there are lots of repetitive elements. All properties in my class are ...
Bender.'s user avatar
  • 71
1 vote
2 answers
826 views

Embedding WebView2 Runtimes in .NET Framework Class Library With Fody Weavers

We have a class library (consumable by third-party apps not under our control, and deployed as a single file dll with embedded references) that previously used the WebBrowser control. That was a very ...
SteveCinq's user avatar
  • 1,954
0 votes
1 answer
636 views

How do I access the "importer" classes in a Class Library? (.NET MAUI/C#)

I have developed a .NET MAUI app for my company. To do so, I created some "Core" classes in the project that helped me develop the project. For example, I created a "Navigation" ...
VC JS's user avatar
  • 95
0 votes
1 answer
132 views

Automatically write a code snippet for a specific method of my library

I'm writing a custom library and some interfaces in c# and it will be reused by other developers. Some of the methods of my library always require certain lines to work so I'd like to automatically ...
LexFerrinson's user avatar
3 votes
2 answers
314 views

Access files and folders of Internal Computer drives in CrossPlatform UWP

Making a class library that works for all system and it resolves around storage (system.io). So far it works for Winforms and Wpf but its failing to work on UWP. I also have a total of 3 internal ...
Redstone145's user avatar
0 votes
1 answer
632 views

Access files from inside class library

Background Info: I needed to convert PDF files to images and have full control over how this is done, and noticed that this functionality does exist in NuGet packages, but only in paid packages. ...
Wessel Ottevanger's user avatar
2 votes
0 answers
481 views

One big .NET class library vs multiple smaller ones -- what are the tradeoffs? [closed]

I'm working on a C# app that makes use of interop to interact with several of our DLLs that export C-linkage functions. Because our product consists of more than one executable, I moved all the ...
Scott Smith's user avatar
  • 3,958
0 votes
0 answers
282 views

DLL Hell with .NET Core Class Library

I'm building a COM Library to expose SignalR to a non-NET software but it has a lot of references loading different versions, I even lost a lot of time trying to get the strict version of everything ...
Luiz Henrique Rios's user avatar
0 votes
1 answer
1k views

How to add DbContext In Startup.cs without using Entity Framework?

I am currently working on a project where I am developing a class library that later on will be uploaded as a nugget package, such that if a user creates a.NET Core application, she/he can download ...
Sergiu Nimat's user avatar
0 votes
0 answers
97 views

Correct DLL utilization without including it in the output directory for a standalone application (VB.Net)

So I've been using the NAudio.dll in my VB.Net project and so far it was quite easy using it by utilizing Imports NAudio.Wave and just calling the one class and function I need from that class. Now it ...
Vandrey's user avatar
  • 561
0 votes
0 answers
150 views

How to get the dynamic data of websites which has ajax calls in c#

Sorry if my question was not in proper manner do edit if required. USE CASE I want a function which will find the given string or text from a web page as soon as it updated in wepage in c#. Take ...
Firoz Rangrez's user avatar
0 votes
1 answer
851 views

CS0426 type name does not exist when calling Create function [duplicate]

This is what I have in my library public class ClassA { public int Value { get; set; } } public static class FactoryClass { public static ClassA CreateClassA(int ...
Ricardo Acosta's user avatar
0 votes
1 answer
561 views

Wtih .Net 5.0 what Class Library Type is the new standard?

In the past I would use .Net Standard for my .Net Class Library type as it seemed the most universal. However, with the introduction of .Net 5.0, .Net Standard Class Libraries are raising the yellow ...
Tom Crosman's user avatar
  • 1,257
30 votes
4 answers
17k views

How to create .Net 5.0 Class Library project in Visual Studio 2019 16.8.1?

I can not see the Class Library(.NET) option on Add a New Project window in Visual Studio 16.8.1. How can I create a Class Library (.NET) project? (Not .Net Core or .Net Framework)
Tolga Cakir's user avatar
2 votes
0 answers
490 views

WPF-Project (Class library) not building after update to VIsual Studio 2019 16.8.1 [duplicate]

I have a .Net472 class library with WPF-controls. It is existing for some years now, originally started with VS2017, then also used with VS2019 and it used to compile fine,also with VS 2019 16.7. ...
emvoll's user avatar
  • 109
1 vote
1 answer
187 views

WebBrowser Control with Google 2-Step Verification

We have a class library that uses the .NET WebBrowser control to authorize access to a third-party API, either with that third-party's oAuth2 Authorization flow or with Google 2-Step Verification (aka ...
SteveCinq's user avatar
  • 1,954
0 votes
0 answers
44 views

Not able use get the locally made application setting from class library using C#

I have c# class library in VS 2017 version. I wanted get certain information while I execute my application dynamically. So I have created settings.setting file which inturn created app.config file. ...
user1539205's user avatar
3 votes
1 answer
2k views

C# Class Library "Make assembly COM-Visible" grey or not available

I want to write a DLL in C# to use in VB6. When I looked it up i found this. Sounds good to me, but i can't check the "Make assembly COM-Visible". I tried different Project types, but the &...
Static's user avatar
  • 87
2 votes
1 answer
2k views

Visual Studio C# with which Class Library Projects can I reference a Blazor Project

I want to write a C# library for my MongoDB CRUD operations in Visual Studio 2019. And use this library later in different projects. I want to use the library in Blazor (.net core) and in WinForms (....
nogood's user avatar
  • 1,230
0 votes
2 answers
331 views

'EmployeeDBEntities' could be found in the application config file in C# Class Library project

I am trying to get a list of books from database in my class library project, there is a windows service which is using it. I am using entity framework to query the db, but not able to get the list. ...
sharpshooter's user avatar
0 votes
0 answers
346 views

Encapsulates class library with Costura Fody

I have a .Net Framework class library project which includes other 3rd-party packages. After I compile the project, all the dlls are in the output folder. How can I embed the assemblies into the ...
KDani's user avatar
  • 438
1 vote
0 answers
106 views

Creating .NET/.NET Core/.NET Standard C# Class Library on the fly for testing purpose

I'm developing a tool that updates some C# (Class Library) projects' properties programmatically. At the moment unit tests are based on projects that already exist in a solution path, but, for ...
DioBrando's user avatar
  • 1,017
3 votes
0 answers
4k views

How can I import Class Library and it's dependencies?

I've created a Class Library and it has 2 NuGet dependencies. When I build the library, the .dll is generated and I can successfully reference it on other project using the "Add Reference" option on ...
Helder Costa's user avatar
1 vote
1 answer
2k views

.net core 3.1 inserting CommandManager-class into class library-project

I'm currently on trying out to migrate an MVVM-library I've created a few years ago from .NET 4.5 to .NET Core 3.1. That went surprisingly good, but at the moment I'm struggling with the ...
GeoCoder's user avatar
2 votes
0 answers
850 views

.net Standard 2.0 class library produce error when adding reference

Created a .net Standard 2.0 class library, and then used it in a console application created by targetting .netframework 4.6.1 and dot net core 2.1. when running web application the blow exception ...
Kunjahamed P's user avatar
0 votes
1 answer
563 views

C# How to open an image file as bitmap but scaled down?

How can I open an image file as bitmap scaled down? For example in java I can do this: BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 2; Bitmap myBitmap = ...
Flafy's user avatar
  • 335
1 vote
1 answer
187 views

Why do I get a design time error saying "could not find default endpoint element"?

We have a Windows Form, C#, .NET 4.5.1 application that calls a class library also in C# and 4.5.1. It's worked for years without a problem. This week when I tried to make a change I've run in to a ...
boilers222's user avatar
  • 1,949
0 votes
1 answer
218 views

Project Reference which has Multiple DLL itself

I have one query... I have one class library project which has Exception logging mechanism. For logging exception in db and file I am using NLog. I wanted to implement this Exception Class library ...
vijay sahu's user avatar
1 vote
1 answer
1k views

Autofac resolve within class library

I have a web forms application (myWebForms) I have a class library project (myClassLibrary) that has a class called "myClass" WebForms references myClassLibrary I have added Autofac references to ...
treendy's user avatar
  • 463
4 votes
1 answer
901 views

Can .NET standard libraries somehow consume nuget packages, which support .NET Framework 4.6.1

I am converting a C# net461 based library to netstandard2. Some of the dependencies of the library support at most net461. Visual Studio shows the following warning for those dependencies: Warning ...
Bahaa's user avatar
  • 1,707
1 vote
1 answer
1k views

Inno Setup 'Could not call proc' when using 64-bit class library

Inno Setup version 5.6.1(u). Dev Studio 2015 64 bit class library. .NET Framework 4.6.1 Uses the UnamanagedExports package. Here's the script: [Setup] ArchitecturesInstallIn64BitMode=x64 ...
Jana Andropov's user avatar
0 votes
1 answer
382 views

How to have multiple config files in c# application?

I am developing C# application to write functional test cases using MStest. I have one app.config file. This holds information required in the application. I already added lot of information in the ...
Niranjan's user avatar
  • 577
0 votes
1 answer
286 views

If From & To date is same record not filtering LINQ

I am filtering records based on Dates using Where clause but it's not working. From and To date is same & one record comes within the same date but that getting eliminates. todate {11/6/2018 12:...
Arvind Chourasiya's user avatar
0 votes
1 answer
484 views

Is there any equvalent builtin async method to Console.ReadKey()?

I was writing a simple console application in C#. I could not find any equivalent async method for Console.ReadKey() in Console.In or anywhere else in System or System.Core Assembly. Is there any ...
Nafeez Abrar's user avatar
  • 1,065
1 vote
1 answer
2k views

How to run a .NET class library as a webservice

I have a web service built by colleagues as a class library that communicates with SharePoint 2013 on-premise. I now have to continue building this web service but there is no documentation on how to ...
AllramEst's user avatar
  • 1,429

15 30 50 per page