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.
I have a .NET 4.0 application which uses Microsoft.Bcl.Async for async/await support, developed under Visual Studio 2012 in a Windows 8 machine. It builds fine in my machine and it runs fine in other environments (XP/Vista/7).
My build server setup…
I have the following situation which is confusing me.
Given:
public class ThermoRawFile : MsDataFile { }
public abstract class MSDataFile { }
I am unable to run this LINQ IEnumerable.ToDictionary() method:
IEnumerable…
I have a bunch of methods defined on my interface that look like this:
T Map( SomeType someParam );
and are implemented like this:
public T Map( SomeType someParam )
{
return AutoMapper.Mapper.Map( someParam );
}
How can I…
I am building a repository for a new application which uses Entity Framework 5 as the backend data source. I have the basic CRUD operation working for simple models but I am struggling to understand how to update related objects on an update to an…
I have a fairly simple web api project and have the following method in a CustomerController:
public class CustomerController : ApiController
{
[HttpGet]
public UpdatePasswordResult UpdatePasswordWithUserCode([FromUri]…
I could really use some help understanding why this unit test is failing. I suspect it's due to the way I'm handling the streams. I have a number of other tests that successfully use this self-hosting server setup, but they all read services that…
I have a strange problem. I'm trying to create multiple rolling file appenders referencing everyone the same file, but using only one of theese appenders at a time.
The matter is, if i declare my appender like this:
How could I, using C# in either a WinRT (ideal although unlikely) or Legacy app, access previous (and likely missed) Toast Notifications from all applications?
As best as I can tell, there is no easy way to do this (no obvious APIs, understandably…
The one feature that I cannot stand with-in the Entity framework is where the complex Result object sets some properties as Nullable.
Is there a global setting to where that Nullable property is never set to yes?
I've studied that in concurrent programming there's something called "event semaphore" that works like this:
Let's say "sem" is the event semaphore object.
Threads executing sem.Wait() are suspended until someone calls sem.signalAll() that awake any…
I'm trying to use the async pattern to execute a SQL command and return a DataTable.
Can someone please advice how to solve this problem?
This is my code:
private static async Task ExecuteAsync(Connections connection, SqlBuilder sql)
…
This is probably easy for someone more experienced with LINQ and the Lambda expressions in C#. I'm just starting out with them, so I must be missing something.
I have a custom object like this:
public class BusinessName {
public string Name {…
I have a project written in VS2012/.Net 4.5 that is essentially a bog-standard, database-first Entity Framework 5 entity model and context, and associated business domain classes. That all works fine when I'm referencing the built assembly from a…
I have code in SQL that will take the length of a SMS message and tell me how many parts the message will be.
Messages <= 160 characters are one part.
Messages > 160 characters become multipart messages, each part will then contain 152 characters.…
What will happen to an open FileStream if it is not close due to a program crash?
Will it be close automatically?
I can't enclose it in a try catch or using because I am doing something with the file.
It's like I open the file with an Open…