The .NET Framework is a software framework for Microsoft Windows operating systems. It includes an implementation of the Base Class Library, Common Language Runtime, and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++.

learn more… | top users | synonyms

0
votes
1answer
84 views

ThreadPool.QueueUserWorkItem is this example a valid use case?

I need to send out a batch of reminder emails, never more than 100 emails per batch, using authenticated SMTP. This is happening on a WindowsService (no GUI). The SMTP library we're using raises a ...
4
votes
3answers
3k views

Separation of retrieving data and business objects between DAL and BLL Layers

I did some research before posting this question. Among other questions or post, one of those is provided below. I could not get a clear mind how to determine.. Business Objects within a Data Access ...
0
votes
1answer
37 views

DB Data structure for .Net sequenced list with insert, delete, move

The problem is maintaining in .net a list of rows that have a specific sequence where rows can be inserted, moved and deleted, and being able to save and restore that sequence from disk. In memory ...
0
votes
0answers
16 views

Developing Python Scripting API using Petrel Ocean SDK (C#/.NET)

I use a commercial software called Petrel. Petrel has a software development kit (SDK) that allows the user to develop plugins in C#/.NET via the Ocean core API. At our offices, we have installed a ...
-2
votes
0answers
59 views

C# and .Net Core Multi Projects Architectures Solutions [on hold]

I starting a new set of projects in C# and .net core initially in WPF or UWP (windows desktop app) with a goal to theirs to all mobiles (ios, android and wp), asp.net core, MacOS and Linux. What's ...
-3
votes
0answers
30 views

Web.config Impersonate With HangFire [closed]

I'm trying to impersonate another user in order to connect to SQL database using an Active Directory (AD) username and password, but when ever the impersonate is enabled hangfire does not recognize ...
1
vote
1answer
60 views

How to create a layout of controls that can be duplicated on a form at runtime

I have a bunch of controls including labels, updown menu, combo boxes, radio buttons, and check boxes that must be replicated once someone hits the add button. Is there a way that I can create a ...
-1
votes
0answers
47 views

Is this an appropriate use case for WCF? [closed]

We have a task to send messages and receive from a remote TCP service dealing with financial transactions (probably going to be very high throughput). We are not in control of that service, and at the ...
2
votes
5answers
138 views

Database transaction and separation of concerns

Apllication structure: Business layer public interface IOrderDataService { void Save(Order order); } public interface IOrderLineDataService { void Save(OrderLine orderLine); } public ...
37
votes
3answers
26k views

Best practices for logging and tracing in .NET

I've been reading a lot about tracing and logging, trying to find some golden rule for best practices in the matter, but there isn't any. People say that good programmers produce good tracing, but put ...
0
votes
4answers
182 views

How do I elegantly store tabular data in code?

Let's say I want to store date which cannot be changed by the user in code. For example, my application supports ten types of reports, and I want to store metadata about it. Usually, I'd use a ...
2
votes
2answers
733 views

What does the implementation of .NET string.Split(char[], StringSplitOptions) look like from inside?

That is if we were to see how Microsoft wrote this method what would it look like? I'm mainly interested in the use of the StringSplitOptions enumeration with the other parameter and how they probably ...
2
votes
1answer
458 views

Thoughts on having a generic, reusable grid viewmodel

I'm developing a wpf-based application and I'm currently struggling to find the best way of supporting a recurring scenario in it. This app uses grids a lot. There are a bunch of features I want in ...
-1
votes
3answers
132 views

Why doesn't System.String include a constructor taking an IEnumerable<char>?

Why doesn't System.String include a constructor capable of taking a IEnumerable<char>? The expected behavior would be: var foo = "hello"; var bar = new string(foo.Select(x => x)); Actual ...
27
votes
7answers
58k views

.NET Properties - Use Private Set or ReadOnly Property?

In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example: Public Class Person ...
0
votes
3answers
881 views

How to stop a .NET application from being duplicated?

I have created a .net windows form application that I want to restrict from being duplicated. I want this application to be portable, so I would like to allow it to be moved. How would I be able to do ...
1
vote
1answer
265 views

Clarification about Event Producer in StreamInsight

I need a small clarification about StreamInsight, I know by doc's that StreamInsight can handle multiple concurrent Events. But will the event producer be a separate function, for ex: I need to watch ...
-3
votes
0answers
25 views

Transparent ListBox can't see items [migrated]

I created new control then inherit listbox ... as follow: Public Class TransparentListBox Inherits ListBox Public Sub New() MyBase.New() Me.SetStyle(ControlStyles.UserPaint, ...
15
votes
7answers
3k views

What is the “right” way to implement DI in .NET?

I'm looking to implement dependency injection in a relatively large application but have no experience in it. I studied the concept and a few implementations of IoC and dependency injectors available, ...
1
vote
3answers
67 views

Use HttpUtility.HtmlEncode or create extension method

Should I use HttpUtility.HtmlEncode or write an extension method? Pro for using HttpUtility.HtmlEncode is that other developers can instantly see and recognise what it's doing. Pro for using an ...
1
vote
2answers
142 views

Is an empty class in some cases correct

I know it's generally a design flaw to have an empty class, yet I'm wondering whether there are some cases where it isn't to have an empty (abstract) class to group objects. Especially when ...
0
votes
1answer
145 views

How Common/Acceptable is it for a .NET developer to abstain from WebForms as a rule? [closed]

I work at a mostly .NET shop. A coworker has more of a background in open-source MVC (think RoR and Spring MVC). She seems to really enjoy .NET MVC, but she practically refuses to work on Web Forms, ...
5
votes
4answers
794 views

How important is an in-depth knowledge of the Common Language Runtime to a .NET developer?

I wonder how many .NET developers have a working knowledge of CIL and where it has been useful to them. In case you are missing my meaning, here is a simple CIL example to add two locations together: ...
4
votes
1answer
160 views

What are the important considerations when switching from monolithic to microservices architecture in .NET?

We are contemplating breaking up our monolithic monsters into microservices based architecture progressively. We have 5 teams, each team containing 2-3 C# developers, at least 1 database developer, ...
2
votes
1answer
112 views

Different ways of array declarations in C#

What is the difference between the following two methods of creating an array in C#: int[] arr = new int[] { 1, 2, 3 }; Array arr = new int[] { 1, 2, 3 };
-1
votes
1answer
125 views

Which file format should I use as an alternative to my current Excel worksheet? [closed]

My .NET application does its work and then creates a report (an Excel worksheet). That report contains thousands of short text strings [KEY - VALUE]. So Excel worksheets suites very well, one column ...
1
vote
0answers
20 views

.NET server object instance: Singleton vs Per Call vs Per Client in the context of a 2 tier architecture

Note: This is a theoretical question weighing up the pros and cons of server object instancing, the tier architecture is not the topic of the question. My question is simply whether my thoughts are ...
2
votes
0answers
183 views

Software License for project using .NET and Sql Server Express

I considering making my application open source on github. I don't intend to sell it (neither in binary form nor source code form). It probably isn't even useful to a lot of people except maybe for ...
7
votes
2answers
122 views

Is there a practical reason not to use a .NET “setting” to store data that is not a setting?

.NET applications developed using Visual Studio have an easy way to store and recover user settings. You can add the default value of a setting in a special class and have read/write access to it at ...
1
vote
1answer
36 views

Encapsulate common application libraries into a single library project

My company is planning to integrate 3 in-house libraries into all of our applications (with possibly more on the way), and I'm wondering what the best way to go about this would be. My initial ...
1
vote
1answer
91 views

Layer application and token authentication

Suppose we have an application with multiple layers in .Net: Domain layer (entities) Data access layer (entity framework) Business layer Web Services layer (Web Api) Presentation layer (MVC) Now I ...
3
votes
2answers
95 views

How should I refer to data bound columns?

I work often with data-bound applications with WinForms; records are pulled from a database and updated in a client application that I write. Stored procedures are used for all database transactions ...
8
votes
2answers
614 views

Who should initialize dependencies in a TDD application?

I'm trying to learn implementing TDD with mocking/fake objects. One of the questions I have is how to initialize a dependency in an application which implements TDD? An example from this article ...
6
votes
2answers
3k views

Examples of permission-based authorization systems in .NET? [closed]

I'm trying to figure out how to do roles/permissions in our application, and I am wondering if anyone knows of a good place to get a list of different permission-based authorization systems (...
19
votes
9answers
7k views

Whether to put the business logic in Stored Procedure or Not?

There is always a debate over the topic - "Whether to put the business logic in Stored Procedure or Not?". If we decide not to use the ORM Tool and not to put the Business Logic in Stored Procedure ...
2
votes
1answer
75 views

What design pattern(.Net) to use for multiple control design with multiple properties?

I have to design for a bunch of user control types, each of which share some common properties but some of which have special unique properties. For example, the common properties across all the ...
0
votes
2answers
97 views

Injecting a factory with multiple constructor parameters

Initially I needed only one queue to be created by the MessageQueueFactory: container.RegisterSingleton<IMessageQueueFactory>(() => { var uploadedWaybillsQueuePath = ConfigurationManager ...
0
votes
1answer
83 views

What's the point of having the build number in the .NET framework versions?

The .NET Framework CLR files are located in the following folders under C:\Windows\Microsoft.NET\Framework: v1.0.3705 v1.1.4322 v2.0.50727 v4.0.30319 (Yes, there's v3.0 and v3.5 as well, but they ...
5
votes
5answers
2k views

Why do projects opt to stay on an older version of the .NET Framework? [closed]

Why do projects opt to stay on an older framework version of the .NET Framework? For example, staying on .NET Framework version 3.5 which was released in 2007 instead of upgrading to the latest 4.5.1 ...
8
votes
2answers
748 views

Why aren't all method virtual or why doesn't have each class at least one interface?

This is more philosophical question, which address .NET platform, but maybe it is useful also for other languages. I'm doing lot of Unit Testing and especially when I'm using third-party components I ...
2
votes
1answer
185 views

Why and when would you use a .NET framework data type?

I've seen an increasing trend of people submitting code to SO that includes the use of .NET Framework data types. I understand that the .NET Framework has its own data types (like Int16, Int32, ...
3
votes
5answers
145 views

Conditionally initializing a string list

I am writing a program that needs to be able to process data from a number of different sources. The sources output data in a variety of formats. So, depending on which source is being used, I need to ...
0
votes
1answer
59 views

Portable Class Library best practices

I am converting some .NET framework targeted projects over to Portable Class Libraries and looking for some best practices. Usually all of my projects use the same project name and assembly name, and ...
2
votes
4answers
946 views

3 tier architecture in .NET web applications

Nowadays most systems are designed as web apps. In the .NET world the famous three tier architecture is usually translated like this. Front End (Web Application) Middle Tier (custom DLLs using an ...
1
vote
1answer
56 views

How to map references in different VB.Net solutions

I just come to a small company. There are more than 500 solutions in different VS.Net versions and even VB 6.0 projects. They share several dll. Is there a way to map relation between each program? ...
-3
votes
2answers
208 views

Can a media decoder/player be implemented entirely in C#? [closed]

One of these days, when talking to a friend about different programming languages and their uses, I mentioned that video players (and media coding implementations) are always written in lower-level ...
5
votes
5answers
536 views

.NET: Are web-based applications inherently harder to build than client-server?

We currently have an ongoing discussion about which approach to move into - we want to replace multiple older environments with .NET applications, and two potential architectures are under discussion: ...
2
votes
2answers
151 views

C#/VB struct – how to avoid case with zero default values, which is considered invalid for given structure?

How to implement some constrained .NET struct/structure (let's say LimitedString), where its state with default values (set by CLR to technical defaults, i.e. nulls, zeros, etc.) should be prohibited ...
5
votes
3answers
130 views

Is it worth the effort to use culture invariant string formatting in single-culture applications?

Sometimes, we need to stuff an integer ID into a string, for example when generating HTML form <select> items. Calling int.ToString() can result in digits outside the range [0-9] in certain ...
1
vote
1answer
78 views

In a .NET Windows Forms app with a custom MVC, should a custom UserControl (view) implement any non-animating logic on its own?

This is strongly linked to these two questions: http://stackoverflow.com/q/15800945/279112 Should Controller know about View & Model? or vice versa? as well as this one: http://codereview....