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
0answers
16 views

Azure Service Fabric and TCPListeners

I have a task to set up two TCP Listeners on different IP's (which will need to be static. The project manager has asked me to look into Azure Service Fabric to ensure high availability. The listeners ...
0
votes
0answers
18 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
60 views

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

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
33 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
61 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 ...
0
votes
4answers
183 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 ...
-1
votes
3answers
133 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 ...
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 ...
-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
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
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, ...
4
votes
1answer
164 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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
146 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 ...
1
vote
1answer
59 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? ...
5
votes
5answers
544 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
153 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 ...
7
votes
2answers
404 views

Is there any reason to use a Func over a method?

I recently just started looking at Func in C#, and as far as I can tell, they pretty much are the same as methods, which is fair enough. However, I was wondering if there is any point in using them, ...
2
votes
0answers
46 views

Better dynamic user permissions

I support an Internal ERP system and an external Reporting/Dashboard that our customers use that both use the same database. Internal normal application users can control what customers can access ...
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 ...
-3
votes
2answers
211 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 ...
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....
0
votes
0answers
58 views

Looking for pros/cons on using OWIN vs. a simple hand-rolled token based auth

We are wanting to implement an API to be used internally and externally and add it to our solutions. Some environment notes: We are currently using VS2013, .Net 4.5, EF5, SQL2008, MVC4, C#, and asp....
2
votes
2answers
95 views

How to handle when only certain derived classes need to be disposed?

I am trying to build a framework of objects where the main actors can be interchanged freely. At the moment I've done this by creating an abstract base class that all of my actors can be derived from. ...
4
votes
1answer
127 views

When starting a new ASP.NET application, what changes when I change from .Net 4.5 to 4.6.1 and why is 4.5 the default?

Using Visual Studio 2015 update 2, creating a new ASP.NET 4.x application, the default .Net "Target framework version" is 4.5. Is it a mistake to bump this to 4.6? I did my own research, and I am ...
0
votes
0answers
58 views

Call any number of different web services at different time intervals

I am creating a program that needs to retrieve data at user-specified time intervals from different devices. An analog to what I am doing, is that I am performing requests to different web services. ...
0
votes
0answers
86 views

What to use in case of waiting for something that is complete: delegates, events and/or thread

I try to give a concrete example. Create a semaphore for a crossroads. I have two semaphores. I have possibility to set a duration of semaphore 2 minutes, 5 minutes, 10m inutes etc. When one ...
2
votes
2answers
175 views

What is a good approach to get a detailed system design from an existing system?

I will be working on a system which will be ported over from Java to .Net. It is a pretty big system. I don't have any specifics about how the system is designed, no documentation, nothing. You know ...
0
votes
1answer
60 views

What would be the best technique for website localization in MVC?

Currently I'm working on a big website that will be published on almost 40 domains with different languages. My question is what would be the best way of doing localization/internationalization. I'm ...
0
votes
3answers
153 views

What is the best way to update boolean variable in this particular scenario? [closed]

I have the following class and a method named ValidateEverything(), where IsEverythingValid becomes true only when a or b or both of them are true. I was wondering about what would be the best way to ...
0
votes
0answers
54 views

In Actor Pattern (AKKA.Net) Should actors be classes OR Objects?

Im Just getting started with actor pattern. Coming from UnitOfWork pattern. Lets say i want to create Actor Pattern for a Employee Management System to mark they are present or absent. The Problem Im ...
2
votes
1answer
34 views

What's a good strategy to go about registering 2-step hotkeys?

User32.dll exposes a RegisterHotKey function, to register, well, hotkeys: [DllImport("user32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool ...
4
votes
1answer
46 views

Logging multiple objects for various reasons, then grouping by that reason

I'm having trouble cleaning up my code, and was wondering if there was any sort of pattern that I'm not aware of that can help me in this situation. I need to process a list of objects in various ...
7
votes
2answers
437 views

When and why to use Nested Classes?

Using Object Oriented Programming we have the power to create a class inside a class (a nested class), but I have never created a nested class in my 4 years of coding experience. What are nested ...
1
vote
0answers
79 views

Centralized management of app.config parts for self-hosted .NET services

What will be the best way to handle these scenarios, if they are not one-time, but regular: Self-hosted services on quite a bunch of machines are needed to be reconfigured to a different database in ...
1
vote
1answer
92 views

.NET Implementation Question (repository access)

I am trying to write a generic method which goes a particular DB table depending on the entity which is passed (all valid entities implement IStaticData) : IEnumerable<T> GetEnumerable<T>(...
1
vote
2answers
120 views

Working with multiple environments and vNext best practice

The new ASP.NET documentation under Fundamentals/Working with Multiple Environments it has a detailed description of how to handle multiple environments (surprise surprise) in code. I was wondering ...