Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [.net]

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++.

-2
votes
1answer
29 views

What are pattern and practices or frameworks for Managed Extensibility Framework? [on hold]

Are there any frameworks for using MEF, for example for WPF application there are number of frameworks to save time, but what is there for MEF? are we to start every MEF application from scratch or is ...
0
votes
2answers
97 views

Naming conventions for .net C# Unit test projects for better sorting [closed]

I currently use the following naming scheme for my unit test projects.. if I have a project "MyApp", I will have.. -- MyApp -- MyApp.Tests I see this is quite a common practice. Now, the problem is,...
3
votes
3answers
232 views

what is the best way to write a recurring code with different enums

Basically what this code does is to determine whether the user is allowed access to the page or not from list of pages as enum, each one has the role name as its name and the page name inside it. The ...
1
vote
0answers
57 views

How can I resolve circular dependency within service layer in a n-tier architecture system?

I am currently starting a new project with a 4-tier architecture design. The layers is set as follow. +------------------+ +---------...
1
vote
0answers
20 views

DataTable Processing: Want lowest result

(Hi there, not entirely sure if this is the right place to ask, sorry if it isn't!) I am knocking up a fairly quick and dirty Visual Basic.NET application that essentially is a DB UI for my day job, ...
1
vote
1answer
125 views

Using “On” at the start of a method name

From what I've observed, methods that start with the word "On" fall into two categories: A base class that defines an event will expose a protected method whose name starts with "On" followed by the ...
18
votes
2answers
576 views

.NET Self Reference

I am evaluating an open source CMS called Piranha (http://piranhacms.org/) for use in one of my projects. I found the following code interesting and a bit confusing, at least to me. Can some help me ...
3
votes
1answer
110 views

Regulations about collecting data from software running at clients hardware (apps 'phoning home') [closed]

We develop an application which has now been installed on a few thousand customers sites. Unfortunately, we have no customer data collection built into the software. This is something we want to ...
1
vote
2answers
68 views

Is it okay for async function to update a common object

I have a couple of functions, each function verifies a set of rules and updates a common object. The common object is just a container that holds a list of rules that passed or failed. I would like to ...
1
vote
0answers
49 views

Wrapper method for ConfigureAwait(false)?

Does it make sense to declare a async method as private and then create a public method to act as a wrapper that calls the private method with ConfigureAwait(false)? The intended purpose is design an ...
-1
votes
2answers
126 views

Argument for staying on Rails instead of migrating to .net MVC?

I work for a Rails SaaS platform that was recently acquired by a primarily Microsoft shop. They are pushing the issue we need to rewrite the entire application in .NET. It's very clear they know ...
-1
votes
4answers
301 views

Alternatives to Long Loops [closed]

I am part of a software team that is writing a console application (no UI) in C#. My part in the team is to write code to call RESTful APIs from a third party site, process the returned data and save ...
3
votes
1answer
144 views

Single responsibility of Program class in C#

I do not follow SOLID strictly in general, but I do try making sure to separate responsibilities of my classes. I was developing a small app with a Windows service powered by Topshelf and realized ...
0
votes
2answers
158 views

How to create secure desktop installer that doesn't trigger a virus alert for unknown exe?

When I created a c# desktop application and move the exe file to another computer that has anti virus security, the security program shows an alert as unknown exe. I want to create a desktop ...
-1
votes
1answer
93 views

Giving Viewmodels access to application wide Model in MVVM

I am practicing building applications using MVVM and WPF+C# by making a "finance application". The application contains several views with their own ViewModels. The views are in a hierarchy and are ...
3
votes
3answers
452 views

Multithreading ( thread per area ) for an MMO server, good idea?

As a personal project, I'm setting up a MMO, and writing the server in C#/.NET Core. As of now my architecture is as follows: The world exists of different areas ( you can go from area to area trough ...
4
votes
1answer
192 views

How to have multiple source copies of a dependency in a C# git project?

In our company, we develop information system software in C#.NET, which has client-server-module architecture. Module project does not depend directly on server/client project, but only on shared ...
41
votes
13answers
10k views

Is it unreasonable to expect Any() *not* to throw a null reference exception?

When you create an extension method you can, of course, call it on null.But, unlike an instance method call, calling it on null doesn't have to throw a NullReferenceException -> you have to check and ...
1
vote
5answers
595 views

Limits of Defensive Programming acknowledging that Exception Handling should be avoided

I've read Defensive Programming vs Exception Handling? and if/else statements or exceptions, but none contain something relevant to what I'm searching for. Taking into account that exception handling ...
3
votes
1answer
159 views

Reusing business logic layer in multiple applications

I have seen some people asking about sharing business logic with more than one application, and answers generally discuss putting it in a class library. I'm fine with that, but usually the examples ...
-3
votes
3answers
373 views

Shouldn't cost be good reason to migrate to .Net from Java

I have a RESTful services developed using Java Spring framework. It's not a huge application, around 12K lines of Java code. Front end is in Angular and DB is No-SQL world. Recently I came to know ...
2
votes
0answers
67 views

Using C# to implement an F# type provider

I am in a situation where I believe type providers would be useful. Consuming type provider in F# could be the way I finally dip my toes in F#. However, I understand that writing type providers is ...
-2
votes
1answer
144 views

Shared classes between namespaces, how to distribute them?

Some time ago I read from this book that namespaces inside libraries should be distributed in a way that inner namespaces have more concrete classes than their parent namespaces. We can find an ...
2
votes
1answer
108 views

Should namespaces within a single project act as boundaries?

When working within a single project that contains multiple namespaces, should these namespaces be treated as boundaries? Or is it acceptable that any namespace can access any other namespace? For ...
0
votes
1answer
131 views

How to handle API responds with DTO or Error Message

I have a mobile app and an API. The mobile app is set up to expect back a DTO from the API but has no information if an request was unsuccessful. This needs to be updated so that better messaging is ...
1
vote
1answer
136 views

What's stopping Cloud Platforms from owning the whole deployment process?

Although things have come a long way in recent times, in my workplace we're still talking about DLLs, containers, configs, substitutions, pipelines - all complexities when it comes to shipping code. ...
4
votes
4answers
188 views

Should custom exceptions live with the interface or the implementation?

I have an interface IMyService in a class library. I have an implementation of this interface MyService in a separate class library. MyService may raise a custom exception CustomException. Should ...
0
votes
1answer
85 views

How to run machine-specific tests during DevOps remote build

What are the generally accepted means of running tests that pass on the dev machine on the build server where they'll consistently fail due to missing dependencies? (In this case, a configuration file ...
1
vote
0answers
64 views

Is there a pattern/cleaner way of saving a large object with multiple nested classes?

I'm in the midst of a rather large project which involves decomposing a very old and large ColdFusion legacy application and creating some .NET services in it's place. Due to this, there are some ...
0
votes
1answer
74 views

Method for loading and running user defined code in .NET windows application

Are there any patterns that address how to have and application load and run user defined code at run-time? I am looking into developing a C# library that the users of a Test Executive application (...
0
votes
3answers
65 views

Error Handling Best Practice for External Library

My development environment specifically is .NET and I'm writing a DLL to be compiled and referenced in other .NET programs we'll be writing going forward. My question is: In that DLL, what is the ...
0
votes
2answers
70 views

Long response times vs. concurrency issues on a multithreaded web server

A class with a slow initialization used to process a request leads to long response times. But the actual method used is quite fast. Should the class be static, I guess it would need to process a ...
0
votes
2answers
157 views

Get data from the byte array

I have a byte array and a value defining the type of the data stored in it (string, int, ...). What is the best way to get this data? I have two options in my mind: Call a method which gives the type ...
1
vote
1answer
90 views

sequential command processing with an async io cloud upsert

We are new to c# and still trying to grok the async idioms. We have a windows service that requires us to iterate a list of results queried from a PC database to feed the parse cloud server (which ...
2
votes
1answer
176 views

Net Automatic Serialization vs Custom Serialization Difference

In C#, what is the difference between Automatic serialization and Customer Serialization? Also what is Reflection? I know this stuff is not simple, if someone can explain in lay man's term, that would ...
2
votes
1answer
75 views

How best to organise a multitargeted VS solution being ported from .net Framework to both .net Framework+Core?

I'm not a native English speaker, and i'm new to .net Core. I have a task to port the logic of a WPF app to .Net Core while leaving this app working like previously. The app has approximately 70 ...
1
vote
2answers
90 views

Are two .net web applications necessary?

We have one single internal website. Underneath this website (in IIS) we have two web applications: 1-Main web application 2-Web services (created using the visual studio web api project template) ...
1
vote
1answer
98 views

Entity Framework Entity Names

As an example, I have a POCO called Person which is used in my presentation layer and my business logic layer. I don't want to use this POCO in the Entity framework because I don't want that class ...
5
votes
3answers
567 views

Should I localize exception messages?

It is probably related to "Who should read Exception.Message if at all" and similar questions asked on this site, but I don't see how it is possible to always generate a custom message while avoiding ...
0
votes
2answers
97 views

Handling a limited resource in rest WEB API 2

I have developed a restful WEB API 2 (C#, .NET 4.7) for an internal integration project. In my API's backend, I need to use a vendor's dll in order to process the provided input. The vendor's dll is ...
0
votes
1answer
137 views

How to write clean code accessing nested members on higher abstraction levels in c#

What are best practices for cleaner code style when accessing nested members on higher abstraction levels. class A{ B b; void Do(){b.c.d.e.f.g.value;} } class B{public C c;} class C{public D d;} ...
2
votes
1answer
636 views

Is .NET ASP MVC core suitable for rapid web development?

I currently work for a company who builds web applications for businesses and entrepreneurs, typically 4-6 projects per year. We currently use Laravel/PHP which allows us to build apps relatively ...
0
votes
1answer
57 views

What is the name of a Not Implemented Assembly, in relation to a Core Assembly

Context My projects are separated into one assembly with Interfaces, which I call the Core, and another assembly with the implementation, which I call the Implementation. In reality, the namespaces ...
2
votes
1answer
44 views

Should the ORM create the related objects (ForeignKey objects) when saving the entity?

This question is coming from a frustration when using the Entity Framework and ASP.NET MVC, but I assume it's a general frustration across more frameworks and languages. Lets say we have an object ...
-2
votes
1answer
295 views

Strategy pattern with Async c#

My question is public interface IFoo { void HandleRequest(int i); } public class Class1 : IFoo { public void HandleRequest(int i) { if(i == 1) // just for example { ...
-2
votes
1answer
162 views

Can I use DI with client of Abstract Factory pattern c#

Let's say I have something like this: switch(i) { case 1: new Class1();break; case 2: new Class2();break; } So what's the best practices of doing this if in class where I placed ...
1
vote
1answer
105 views

Direction to take to improve a AST interpreter

I'm looking for some opinions/advices about a particular subject. Here is the situation : I'm developing for fun, in my spare time, a programming language interpreter made in C# and I'm looking for ...
12
votes
1answer
192 views

Is there any way to make a .Net library for Windows and Mac, with platform dependent references?

We're trying to develop a cross-platform app for desktops (Windows and Mac) using C#. The app contains a massive amount of platform dependent stuff and our team lead wants us to write all of that code ...
0
votes
0answers
61 views

.Net - “Thread is blocked/waiting” meaning for I/O bound operation

Caller waiting for method to return back and till it is not returning, we can say thread is waiting, right ? However, this behaviour is because that inner method is waiting for some other operation or ...
5
votes
2answers
583 views

C# Names of Namespaces with version suffix

In official Microsoft docs: ✓ DO use a stable, version-independent product name at the second level of a namespace name. But in Reference Source, the following namespaces ends with Version: ...