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
14 views

C# gets an enum, but doesn't work correctly with switch statement [migrated]

Im having some trouble with enums and then checking it with a switch statement. I'm not sure if I'm doing something super wrong, but I don't get any errors so hey. # Level.cs enum LevelID { ...
-2
votes
0answers
26 views

From Visual Studio 2010 to VS 2013 - any pitfall that I should know? [on hold]

It's been some five years since I started my current job as C#/WPF developer, using VisualStudio 2010 / .NET 4.0 with a Windows 7, 32 bits OS in a dual core, 4GB RAM, 64 bits machine. Even my bosses ...
2
votes
1answer
155 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 ...
18
votes
3answers
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 = ...
0
votes
0answers
47 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
66 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
119 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
votes
1answer
64 views

Mono and entity framework, which database to use? [on hold]

I was looking into monoproject website, and I saw they have entity framework support. Source: http://www.mono-project.com/docs/about-mono/compatibility/ But my question is: Is it supposed to be used ...
1
vote
1answer
83 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 ...
1
vote
0answers
35 views

Injecting data processing logic into class

I want find more elegant and appreciate way to inject processors into CommandProcessorDispatcher class. Or it can be another one solution (the goal is separate each command processing logic to ...
5
votes
1answer
276 views

Should the expected value be hard-coded into the Assert

My own personal preference would be to use a variable, but maybe there are reasons against this? I haven't been able to find any resources that state the pros or cons of using one of these over the ...
0
votes
3answers
153 views

How to save complex data to file/disk?

I am working on a side project for a small business owner (my father) and part of the requirements for the application include saving customer and job related data in a way that it can easily be ...
2
votes
1answer
100 views

How much physical memory is consumed by the stack of a .NET thread?

In Stephen Cleary's article in MSDN magazine "Introduction to Async/Await on ASP.NET" he says that "every thread pool thread on a modern OS has a 1MB stack." (modern OS == Windows 7/8 for this ...
3
votes
5answers
144 views

Exception handling and 3rd party library

I'm currently having an issue with a 3rd party control library provider. They have an exception occulting culture that gets in the way of my general fail-fast approach when developing software. An ...
0
votes
0answers
37 views

Reading large files for ETL program POC

I'm looking for some information on how to increase the performance of reading large text files for use in an ETL process. We're currently using a proprietary program that is more of a scripting ...
2
votes
1answer
235 views

Avoiding closures

I have a data structure in the form of a tree. Each node represents a cardboard box. The boxes can contain child boxes. public class CardboardBox { public int Id {get; set;} public int ...
2
votes
0answers
39 views

How to free server side resources in RMI call? [migrated]

Our application is a client-server based application that I have converted from .NET remoting to ZMQ. We have two scenarios where a large image object is converted to a byte array in order to be ...
0
votes
2answers
74 views

How to store users' info in network app?

I'm currently working on a school project that aims at creating a P2P chat client for users on the same network. For now, it will only be used by users on the same LAN network. But hopefully,I will to ...
0
votes
1answer
68 views

WCF Project Structure & Maintainability

We are working on a medium scale WCF project configured to use per call instancing and wondering weather it's a good practice to create classes per service method to hold the business logic since each ...
1
vote
3answers
148 views

Single instance of windows service querying multiple databases

My current situation is that we have four instances of a single windows service running on the server, for production, demo, QA and dev. I am looking for a solution where I just need to run single ...
0
votes
0answers
42 views

Designing scalable Azure application with table storage [on hold]

I am creating my first Azure application and want to design it in a highly scalable fashion. However, I am also considering the ease of actual development. So far, I have been targeting Azure table ...
-1
votes
1answer
82 views

What changes in .NET software architecture have taken place in the past couple of years?

I've been away from hands on development work for the past couple of years and focusing more on delivery management. I'm looking to get a couple of new projects ASP.NET MVC apps off the group and I'm ...
11
votes
3answers
500 views

What is the best way to structure and name files which contain generic classes with the same name?

In my current project I have come across the requirement to create generic classes with the same name, but different numbers of generic parameters. For example: MyClass<T1> MyClass<T1, ...
0
votes
4answers
223 views

How should nodes in a chain be connected?

Suppose you were building a system that receives data on one end and sends filtered data on the other end. The system is a chain of nodes, each receiving data from the node before and sending ...
1
vote
2answers
224 views

Is there actually an advantage to using Win API calls for file access?

I remember coding file access using the Win API about 15 years ago. It was much faster than using the FileStream of my language at the time (Delphi). I spent a while today experimenting in C# under ...
1
vote
1answer
158 views

.NET WCF: Persistent connection or Open/Close as needed?

I have a .NET WCF web service currently running in production right now. I would say 95% of the time it works flawlessly and as intended. However; there are times when I am throwing an exception that ...
1
vote
2answers
52 views

Implementing Continuous Integration with a volatile hierarchy of library dependencies

Recently my company setup a build server using Bamboo and a private Nuget Feed which is populated by the successful builds being deployed from the build server. There is a hierarchy of projects under ...
0
votes
0answers
42 views

Switch Configuration of Several .Net Programs for Several Sections in a Simple Way

We build a highly configurable .Net Client/Server application. (Client is C#/WPF, Server is C#/WebService) There is a single code base, but each customer has its own 'profile'. The profile ...
2
votes
1answer
105 views

How to differentiate between exceptions coming from system and business logic?

I would like to differentiate between exceptions coming from business logic like requested database record does not exist attempt to store invalid business data (validation failed) provided CSV file ...
1
vote
1answer
222 views

How to write unit tests for a piece of code that has a data context?

I am new to unit testing and using Microsoft's unit testing library for following piece of code. When I execute the code normally it executes fine, however when I run unit test written for this code I ...
5
votes
4answers
175 views

Using struct to enforce validation of built-in type

Commonly domain objects have properties which can be represented by a built-in type but whose valid values are a subset of the values which may be represented by that type. In these cases, the value ...
-1
votes
2answers
111 views

Is a DLL developed in .NET is accessible from any language or operating system?

I am creating a DLL that I want to distribute to public to use it the way they want. This DLL contains common utility functions. People can use it on any operating system and with any language or ...
0
votes
1answer
80 views

Tracing and Logging per item instead of per application

I'm building a service in .NET that process "things" in the background and I'd like to trace the execution of these things per item, not per application. Most logging frameworks (I'm familiar with ...
1
vote
1answer
78 views

More than 20 Records Inserted in a Span of 1 Sec

Well, this is not specific to any programming languages. I came across this situation in Android, iOS, PHP and .NET. The problem is many times I come across a situation while building IoT apps, where ...
-1
votes
2answers
163 views

Productivity using .Net WPF for large ERP (LOB) desktop applicatons ~1500 forms\dialogs [closed]

I am wondering if WPF will fit in my case: We want to refactor an old legacy application written in a 4GL language with about 1500 forms\dialogs. We want to do that in .Net (desktop application), now ...
3
votes
3answers
343 views

ASP.NET MVC should I reference the DAL from the UI?

I am developing an ASP.NET MVC application, and I have three projects: UI (with the system.web.mvc reference, BL and DAL references) BL (business facade and business objects) DAL (contains my ...
2
votes
1answer
72 views

Under which circumstances does it make sense to lose track of where an exception was thrown from?

Is there any valid reason why a catch block on a lower layer would throw back an exception caused by a higher, unknown layer using the following syntax: throw ex; ... rather than: throw; ... ? ...
0
votes
1answer
62 views

Advice needed on rethrowing an exception

Consider the following c# code: public class ExceptionManager { public static void TreatException(Exception ex) { if (ShowAndContinue(ex)) // display a user-friendly ...
1
vote
1answer
119 views

What is the best and most optimized way to return a filestream from a .NET WCF SOAP service?

To give some background, i have a WCF SOAP service in .NET that needs to return pdf files. This service will be used by multiple application, many times in a day. The size of the files returned varies ...
1
vote
1answer
582 views

Speech Recognition in the .NET framework is not efficient [closed]

I want to create a Virtual Keyboard that can catch whatever key you 'speak' and send the keystroke to the active application. The Virtual Keyboard part and linking it to Speech Recognition will be ...
2
votes
3answers
82 views

Pre-processor usage to separate logic to different versions of product

In the .NET code base of a product, there are #if pre-processor statements to define whether certain functionality should be available. Like so: shared logic #if version1 some logic #endif #if ...
3
votes
1answer
206 views

The most effective arguments in favor of improving code quality, for a manager [closed]

My employer's legacy system started off (in 1997) as very structured procedural code (with a smidgeon of OO), and it was luckily one of the 10% of software projects that was successful. It may look a ...
1
vote
1answer
109 views

Why does a custom action filter need to inherit from both ActionFilterAttribute and IActionFilter?

I m first time creating a custom action filter and following this link http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters They are saying to Extend ...
1
vote
1answer
142 views

Should one write a custom IndexOutOfRange exception?

In the process of writing a special collection I utilized the already exisiting IndexOutOfRangeException as e.g. a list or array would throw if I were to access an illegal index. Code analysis tells ...
2
votes
2answers
315 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 ...
2
votes
3answers
217 views

Is this extension method any better than just casting to an int?

The following extension method was set up in some code I maintain. public static Int32 GetInt32(this System.Data.Common.DbDataReader reader, string name) { return ...
2
votes
3answers
140 views

.NET Framework standard container type for multi-value property?

I'd like to create a simple class property which can contain multiple values set from the outside. (Values are of the same type.) Example of property name and contained items: KnownHidScanners ...
1
vote
7answers
482 views

What is the simplest way to broadcast data from application to other applications in .Net

I want to send information from one .Net application to multiple other .Net applications. I want the applications to be loosely coupled. The number of applications receiving the information could ...
3
votes
3answers
234 views

Interface to enumerate over files

I'm trying to design a generic interface for enumerating over a list files. Each iteration will open a file, allow the consuming code to access the file to perform some task, and then close the file. ...
1
vote
0answers
122 views

Callback pattern handling exceptions - Best practices in .NET 3.5

I am looking to implement the callback pattern with error handling such that error is caught and pass to the callback code with the response. Since I am using .NET 3.5, I cant use Task (TAP) pattern ...