Version 4.5 of the Microsoft .NET Framework. Use for questions specifically related to .NET Framework 4.5. For questions on .NET Framework generally, use the .net tag.
If I am using the Random class in .Net(4.5) and I am always using the same seed to generate 1000 numbers is there a chance that on a different machine (with diff chipset / number of cores, etc) that my 1000 numbers could be different? I don't see…
I have an interface:
public interface IRunner
{
Task Run(object o);
}
and I have some classes that implement it using async, for example:
public class Runner1 : IRunner
{
public async Task Run(object o)
{
var num =…
I have a two level heirarchy of inheritance defined in my EF5 edmx file.
A simple example of the class structure:
A -> B
A -> C
A -> D -> E
A -> D -> F
Where bold classes are abstract (mustinherit).
Class A defines several properties that are used…
I have created a new metro application for Windows 8.
My intention was to consume data from the WCF data service in the metro application. The WCF service should connect to a SQL server installed on the local machine.
I have set up an Interface for…
I know this question has been asked before but the answer simply wasn't what I needed. I need to create a password protected text file. I don't mean to encrypt but just create a file with a simple text password. It would also be nice to find out how…
Is it possible to decode a SessionSecurityToken?
I've set up a site to work with ThinkTecture IdentityServer using MachineKeySessionSecurityTokenHandler, and everything works as expected.
But now I need to pass the token to another service, but in…
Working on a big project, I realized the following snippet :
public interface Mother
{
void CoolFeature();
}
public interface Daughter : Mother
{
}
public class YouJustLostTheGame : List where T : Mother
{
public void Crowd(Mother…
I have a WPF datagrid that changes the rowdetails datatemplate based on the combobox selection of one of the columns(action column). One of the rowdetails template is large and the space provided for the datagrid cannot fully display the…
I tried this question in a generic way on this post: https://stackoverflow.com/q/18968846/147637
But that did not get us to the result.
Soooo, here it is concretely!
I have the code below. It works. In VS, you add a web reference, code up the below,…
Using VS2012 .Net Framework 4.5, I created a WCF Service Application with Local STS, using Identity and Access Plugin.
My goal is to be able to authenticate using the browser.
What I did so far:
Added WSFAM and SAM modules.
Used Fiddler to make…
I'm trying to find an easy way to convert a DataReader to a DTO (wich got properties just like the column names). But I'm wondering how the reflection would affect the performace and maybe there's an easier/cleaner way to do it.
I was looking at SO…
We are currently investigating replacing the logging on our system. In many places we are already using the regular EventLog API which auto creates the Event Source if one doesn't exists.
I'd like to know how much benefit there is to converting our…
This is really short question. I don't understand try-catch mechanism completely.
This is my current code:
public static void WriteText(string filename, string text)
{
try
{
System.IO.StreamWriter file = new…
I wanted a very simple WebSocket sample in .NET 4.5 but haven't been able to get any examples/tutorials working. I'm beginning to think it's actually my system rather than the samples (some of them are out of date, referencing W8 RC, for example).…
I have a MVC 3 application that targets .net 4.0 It has a dozen or so projects also targeting .net 4.0
I have created a new project for the solution targeting .net 4.5 that uses reflection (there are a couple of nice bits of functionality in 4.5…