Questions tagged [.net-4.5]

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.

Reference

3775 questions
2
votes
1 answer

.NET 4.0 application with Microsoft.Bcl.Async fails to build on .NET 4.5 build server

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…
Arthur Nunes
  • 6,718
  • 7
  • 33
  • 46
2
votes
3 answers

Failure to implicitly convert class to base class when using LINQ IEnumerable.ToDictionary()

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
Moop
  • 3,414
  • 2
  • 23
  • 37
2
votes
1 answer

Generics - return different type object

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…
O.O
  • 11,077
  • 18
  • 94
  • 182
2
votes
2 answers

Repository pattern with Entity Framework 5. Updating related objects

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…
Phil Murray
  • 6,396
  • 9
  • 45
  • 95
2
votes
0 answers

Web API, model binding, [FromUri], and WebApiExplorer not playing well together

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]…
2
votes
1 answer

Why is the response content in this streaming service example empty?

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…
neontapir
  • 4,698
  • 3
  • 37
  • 52
2
votes
1 answer

Log4Net, Cannot use multiple RollingFileAppenders at a time

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:
user2541621
  • 461
  • 1
  • 4
  • 3
2
votes
1 answer

Getting System-Wide Windows 8 Toast Notifications

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…
Jaxidian
  • 13,081
  • 8
  • 83
  • 125
2
votes
1 answer

How to set entity framework 4.5 to never set any property as Nullable

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?
2
votes
2 answers

How to put many different thread to wait() and be able to awake them all with signalAll()?

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…
flagg19
  • 1,782
  • 2
  • 22
  • 27
2
votes
1 answer

Getting deadlock when using ExecuteReaderAsync

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) …
thomas
  • 1,399
  • 1
  • 17
  • 32
2
votes
5 answers

Using C# LINQ to concat a filtered List to List
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 {…
crush
  • 16,713
  • 9
  • 59
  • 100
2
votes
0 answers

Is it possible to use a .Net 4.5 assembly (using Entity Framework 5) from a .Net 4 project?

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…
Griff1000
  • 21
  • 2
2
votes
3 answers

SQL case statement to a better C# method

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.…
BossRoss
  • 869
  • 2
  • 11
  • 31
2
votes
2 answers

What happens to an open Filestream if it is not close due to program crash?

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…
rpb
  • 23
  • 3