Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

How can I check if a string is null or empty in PowerShell?

Is there a built-in IsNullOrEmpty-like function in order to check if a string is null or empty, in PowerShell? I …

.net string powershell null
Setting WPF image source in code

I'm trying to set a WPF image's source in code. The image is embedded as a resource in the project. …

c# .net wpf image
How to access Session variables and set them in javascript?

In code-behind I set Session with some data. Session["usedData"] = "sample data"; And the question is how can I get …

javascript .net session
How to create a new object instance from a Type

One may not always know the Type of an object at compile-time, but may need to create an instance of …

c# .net performance reflection types
Update all objects in a collection using LINQ

Is there a way to do the following using LINQ? foreach (var c in collection) { c.PropertyToSet = value; } To clarify, …

c# .net linq foreach
When & why to use delegates?

I'm relatively new in C#, & I'm wondering when to use Delegates appropriately. they are widely used in events declaration, …

c# .net delegates
Why is Dictionary preferred over Hashtable in C#?

In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that?

c# .net vb.net data-structures
AppSettings get value from .config file

I'm not able to access values in configuration file. Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var clientsFilePath = config.AppSettings.Settings["…

c# .net appsettings configurationmanager
How to set session timeout in web.config

I have tried very hard but cannot find a solution on how to set session timeout value for in-process session …

c# asp.net .net session visual-studio-2008
How to get the list of properties of a class?

How do I get a list of all the properties of a class?

c# .net reflection properties