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
60 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
0answers
31 views

.NET Dynamic export/import and data integration and synchronization between systems [on hold]

I have a task to design a system for electronic document exchange between various systems that our company is developing, such as ERP and POS or ERP and WMS system. System has to be flexible and ...
0
votes
1answer
76 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
48 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
44 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
46 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 ...
-1
votes
0answers
38 views

What are the differences and/or purpose of these assemblies? [migrated]

What is the difference and purpose of assemblies located in C:\Windows\assembly in C:\Windows\Microsoft.NET\assembly Which one are used by intelisense?
3
votes
2answers
135 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 { ...
1
vote
1answer
48 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
88 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
29 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
61 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
54 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
45 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
120 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
94 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 ...
1
vote
1answer
123 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
2answers
139 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
3k 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
118 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 ...
24
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 ...
0
votes
0answers
14 views

C# How to define TcpListener for IP address [migrated]

I have looked through some examples of TcpListeners and TcpClients , and in one example the server side TcpListener is declared like this TcpListener listener = TcpListener.Create(8080); ...
1
vote
0answers
33 views

Receive data using TcpListener and TcpClient and distinguish between file and raw data [migrated]

I am having a really hard time figuring out how to make my program work, here is what it is: Server and Client apps Client app will send data to the Server directly, using TcpClient Client app will ...
1
vote
1answer
57 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
136 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
39 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
117 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
182 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
70 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
88 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
46 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
196 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
100 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
42 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
94 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
69 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
417 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
103 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
114 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
234 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
111 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 ...
2
votes
1answer
211 views

Reducing the complexity of over-designed code

I have just started working at a company where I have inherited a C# codebase from a previous developer. I know programming well, have an engineering degree + an (unfinished, several year long) PhD ...
21
votes
4answers
2k views

Is it worth even checking to see if Guid.NewGuid() is Guid.Empty?

In one of the projects I'm working on the following pattern is seen on a fairly regular basis: var guid = Guid.NewGuid().ToString(); while (guid == Guid.Empty.ToString()) { guid = ...
1
vote
0answers
57 views

Should all public API POCO value-type properties be nullables?

I use nullable value types a lot when designing classes that have properties which may remain null, i.e. when the object is being persisted. For example: public int? MyProperty { get; set; } My ...
0
votes
2answers
113 views

Create the fields in class level then instantiate inside methods or create and instantiated inside methods

I'm a newbie in software development. Just wondering which code is better and why should I continue which pattern should I follow. First Snippet: Class TestClass { private Object1 field = null; ...
3
votes
1answer
232 views

Tracing an object

Suppose I want an object with a list of strings and every method that this object gets passed to adds its name to the list of strings. Basically it's a stack trace, except unlike a stack trace it ...
1
vote
1answer
123 views

One dll or many? [duplicate]

I currently have one "library" dll that has one module for each topic: Text, Reflection, Security, Math, FileSystem, FTP, Mail, Serialization, etc. In each module are public helper methods that may ...