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

5
votes
3answers
103 views

Design Pattern - DLL per Strategy

I usually found myself designing my application in the following way: One DLL containing interfaces for a desired subsystem. For example, Company.Framework.Persistence.dll. One new DLL per each ...
3
votes
0answers
46 views

Rich client persistence without a database

We have a pretty sizable .NET rich client app that currently uses nHibernate and Firebird embedded for persistence. Due to the nature of the app, we need to load the entire database into memory when ...
1
vote
2answers
63 views

.NET solution dependency workflow for a small dev team

We have a team of 5 developers working on a product and are at a crossroads trying to determine a better way (if one exists) of managing development workflow and project dependencies. We currently ...
-3
votes
3answers
88 views

Save flags in an int32 [on hold]

Unity3d PlayerPrefs only allow saving certain types - string, float, and int32. Since int is composed of 32 bits, it should be able to store 32 flags or a bool[] of length 32. So far, I've thought ...
2
votes
1answer
115 views

Call method in a disposable object at the beginning of a “using” statement

When we use the lock statement, it is essentially doing a Monitor.Enter at the beginning of the locking block and a Monitor.Exit at the end of the block. This process is automatically handled by the ...
3
votes
1answer
275 views

Why is iterating through List<T> more expensive than iterating through Array in .NET?

According to the answers in this post, List<T> is backed by an Array. According to this article, list iteration is considerably slower than array iteration. If Lists are arrays 'under the ...
1
vote
1answer
38 views

Documenting MVC JSON API

I've got an MVC5 application that we're using an a JSON API for various clients (mobile apps, other web applications, etc.) as well as a traditional web application. Controller actions that return ...
15
votes
7answers
1k views

What's the idea behind naming classes with “Info” suffix, for example: “SomeClass” and “SomeClassInfo”?

I'm working in a project which deals with physical devices, and I've been confused as how to properly name some classes in this project. Considering the actual devices (sensors and receivers) are one ...
4
votes
1answer
71 views

Cons of using unconstrained frameworks for unit testing

It's very easy to write unit tests for legacy code using unconstrained frameworks, such as TypeMock Isolator. But what about writing unit tests for newly written code? Is it a good practice to use an ...
1
vote
1answer
37 views

SQL - Designing a Threshold value table

I need to design an SQL table to be used for "threshold" or special values, which in general would have the following properties: - key - value - comparer (less than and greater than as a start, ...
0
votes
1answer
78 views

Does F# require .NET runtime and libraries to run?

Does F# like C# requires .NET framework to run? According to Wikipedia as stated below, F# is mostly used as a CLI language which means that it is used mostly with .NET. But it also states that the F# ...
22
votes
5answers
3k views

Is my usage of explicit casting operator reasonable or a bad hack?

I have a big object: class BigObject{ public int Id {get;set;} public string FieldA {get;set;} // ... public string FieldZ {get;set;} } and a specialized, DTO-like object: class ...
0
votes
1answer
83 views

Is the regex syntax in .net 3.5 the same as the regex syntax in the latest version of .net framework in c#?

Is the regex syntax in .net 3.5 the same as the regex syntax in the latest version of .net framework in c#?
0
votes
0answers
16 views

De-serializing and Serializing objects the proper way [migrated]

I am serializing and de-serializing a class object within the class which is then sent over the network like this class data public name as string public cmd as Commands public message as ...
1
vote
1answer
53 views

Shared database vs tightly coupled message model

We have an ASP.NET MVC application sitting on top of a MySQL database. Now we're thinking about creating a public REST API so that third parties may integrate their services with ours. Now, I would ...
0
votes
1answer
90 views

Custom serializer or create base class which implements IXmlSerializable?

I am working on a project where I have very specific xml serialization specifications, that is: Some properties are elements, some are attributes Some properties are required others aren't Some ...
1
vote
0answers
53 views

How would I prevent assemblies that have been digitally signed from being called by unsigned assemblies?

Lets say I have an application with a few dlls to go along with it. The user installs the application, all of the assemblies installed on the computer are digitally signed with a certificate from a ...
3
votes
2answers
145 views

Factory for creating a singleton instance

We have some legacy code that has a bunch of singletons all over the place (written in C#). The singleton is a fairly "classic" implementation of the pattern: public class SomeSingleton { ...
2
votes
1answer
86 views

What does “Stateful” means in Stateful ViewModel in MVVM

I was reading about some XAML patterns, and there was the Stateful ViewModel, according to what I read it has nothing different than what we as just the "ViewModel". Here's a description for example ...
0
votes
1answer
203 views

C#/.NET multithreaded application design

The application to be designed serves as a bridge between two different systems. One natively speaks TCP (RS232 actually, but there's a COM->ETH server in the line of communication) - the other one is ...
0
votes
0answers
34 views

Why does the EF query plan cache eviction algorithm reduce the cache to its cleanup trigger size, causing a perpetual cleanup?

The cache eviction algorithm for query plan caching in Entity Framework is described in section 3.2.2 as this: Once the cache contains a set number of entries (800), we start a timer that ...
-1
votes
1answer
66 views

Any library or dll to use to give a free lancers project from clients who accept your work but not pay [closed]

I've been thinking about getting into the free lance field (using sites like guru.com or freelance.com). Something I see in the FAQ's is that there's been numerous instances where the client got an ...
1
vote
1answer
73 views

What OpenID Connect flow is right for me?

Here's the deal. I have a .NET MVC5 web application that I'm moving up to the OpenID Connect standard. I also would like to be able to access controller methods from a mobile app (much like an API) ...
0
votes
3answers
58 views

How to test Windows .NET TCP program handling of connection failure [closed]

I've written my own C# TCP communications module (using SocketAsyncEventArgs, although that's presumably irrelevant). My module runs at both ends of the connection, client and server. As part of the ...
2
votes
3answers
126 views

Many different classes that need similar functionality. Best approach?

I have many (at the moment around 30) different message classes in an application I am creating. Each of these messages need to be serialized and deserialized. However, the process of serializing and ...
1
vote
1answer
96 views

Under what cirumstances would type 'System.Object' qualify for serialization?

I'm in charge of a comprehensive serialization format with support to serialize runtime objects (any derived type of Object). I can't find a sane scenario where one would choose to serialize an ...
2
votes
4answers
263 views

How to optimize the application with huge number of database requests per minute

I have to provide free demo of some service to end users in my application. Free demo could be of 30 mins, 1 hours, 5 hours etc. (predefined time) for a new user for one time only. User can also ...
3
votes
3answers
217 views

How do you find out what resources are unmanaged?

Looking through the .NET documentation, specifically the WebRequest class, I don't see any information indicating that I should wrap an instantiation of it in a using statement. Even the provided ...
10
votes
4answers
5k views

Should one use Dependency Injection even if the class is used only once? [duplicate]

During a code review I have started having a bit of a dilemma as to whether use dependency injection or not. I would like to hear your thoughts, because this is kind of an ongoing theme and would help ...
0
votes
1answer
122 views

What's the point/Use of writing out just the method signatures for an API in .Net Web Api

I have been asked to write the signatures for and API end points GET/POST/PUT methods. I'm having a hard time wrapping my head around what the point of this is. My co-worker asked if I could do this ...
25
votes
3answers
3k views

How much work should I place inside a lock statement?

I am a junior developer working on writing an update for software that receives data from a third-party solution, stores it in a database, and then conditions the data for use by another third-party ...
1
vote
1answer
71 views

Where view models inside Web project of n-tier application should be placed?

Let's assume we have an ASP.NET MVC web application with following tiers: Business logic Entities (business domain and database POCOs) Common (resources, consts) Data access (database EF queries, ...
4
votes
3answers
1k views

Best way to define, start and stop threads in C#

I am making a little program, which have few Threads, constantly running. At some point, I may want to stop one of them, and then, after random period of time, to start it again. So first, what is the ...
0
votes
2answers
178 views

Server and Client apps that will send files and other info to each other

I am trying to do a Server and Client programs, that will communicate with each other, but I can't figure out the best way to do it, so let me explain what I need: The Server app should be able to ...
0
votes
1answer
60 views

MVC: Creare sub folders under View

I am working on a small ERP Application and using MVC5 for it. I have several Modules in the application and each module contain several web pages (Views, you can say). i.e: for School application I ...
0
votes
2answers
121 views

Simple TimeZones

I need to send out emails based on a timestamp. But the timestamp must be what the user expects it to be. The timestamp is set by the user submitting an object. E.g Al from L.A in the U.S saves an ...
1
vote
3answers
202 views

C# Subject Observer Architecture question

I'm making a C# application using the Subject Observer design pattern in a slightly different way. I am passing the Provider Class, implementing IObservable (this has the OnNext() method that ...
1
vote
1answer
88 views

Use of FindWindow and window handles within a Windows service

I've got a third-party vendor who is installing a series of Windows services to a (Windows 2008 R2) server in my control. Whilst attempting to run each service under its own least-privilege account, ...
1
vote
2answers
93 views

Is storing data that rarely changes in-memory a good candidate for a singleton/cache?

I have a class called DataPoint that is defined like the following. Currently, it goes through each property on an object and based on the DataPoint, it does some formatting like padding, trimming, ...
2
votes
1answer
51 views

Peculiar architecture interfacing .NET to AutoCAD out-of-process

I have written a set of classes to interact with AutoCAD from an out-of-process .NET assembly, but it seems like my class architecture and interactions are unusual. I am struggling to find a better ...
2
votes
1answer
199 views

When designing a data structure, should I implement very inefficient operations for convenience?

(I've added the .NET tags because the data structures are for .NET, and this question should be considered in the context of the conventions for that platform.) I'm writing a library of immutable and ...
1
vote
5answers
105 views

How much data from a web service should I expose in a library?

I'm working on a personal project, a library that can access the weather forecasts and other weather related data from it. However, a lot of the returned data is sometimes quite redundant or simply ...
0
votes
1answer
50 views

proper exception handling (throwing/message) dll libary

I just wrote a dll library using vb.net. while testing, i got an error which i did not initially use a try-catch block. The code is Try 'The first four bytes are for the Command ...
2
votes
1answer
145 views

Mixing REST and websocket in the same API

A bit of background first, I'm working on an application that manages a piece of physical equipment with motors, stuff like that. When I started on the project, there was an existing application, ...
1
vote
2answers
79 views

What's the correct way to architect multiple ASP.NET MVC applications dealing with similar data?

I am currently working to replace a bunch of legacy applications. The first one is getting close to being released, which will mean I will be starting the second one. Each application deals with a ...
6
votes
1answer
436 views

What is the purpose of Code analysis and when do I need to use it?

I heard about Visual Studio's Code analysis but never used one. I've read MSDN, but still don't understand the real use of Code analysis. Isn't it the same as StyleCop? Somewhere, FxCop was also ...
0
votes
2answers
108 views

What naming convention should you use for data objects solely meant for parameters

This is my pseudocode for DAL: CusOrderDTO GetCustomerOrder(DateTime OrderDate, string customerCode) CusOrderDTO orderSet = new CusOrderDTO() * query data from database, populate CusOrderDTO ...
0
votes
0answers
146 views

How is CancellationToken.IsCancellationRequested updated?

I've been doing some refactoring today and I encountered one interesting thing. I've extracted a method from a code which uses a cancellation token passed to it in order to check if the user did not ...
2
votes
3answers
262 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
113 views

Using and referencing external executables in a solution

I have an application written in AS3 which I need to be able to start up from my C# application. I have a prototype that does this just fine but my question is in relation to how I would arrange my ...