Questions tagged [asp.net-4.5]

Refers to the version 4.5 of the ASP.NET web application framework introduced with the .NET Framework 4.5

Refers to the version 4.5 of the ASP.NET web application framework introduced with the .NET Framework 4.5

609 questions
27
votes
2 answers

Understanding context in C# 5 async/await

Am I correct that async/await itself has nothing to do with concurrency/parallelism and is nothing more than continuation-passing style (CPS) implementation? And the real threading is performed by SynchronizationContext instance that await…
UserControl
  • 13,469
  • 15
  • 88
  • 171
25
votes
1 answer

How to use MachineKey.Protect for a cookie?

I want to encrypt the ID that I am using in a cookie. I am using ASP.NET 4.5 so I want to use MachineKey.Protect to do it. Code public static string Protect(string text, string purpose) { if (string.IsNullOrEmpty(text)) …
David
  • 2,063
  • 3
  • 24
  • 31
23
votes
2 answers

requestValidationMode 4.5 vs 2.0

Is there a difference between requestValidationMode="4.5" and requestValidationMode="2.0"? I have a .net 4.5 application, there is a control which I don't want to validate, as users can enter html tags in:
Paritosh
  • 3,832
  • 7
  • 39
  • 67
22
votes
1 answer

Unit Testing MVC 4 RedirectToAction

I am trying to unit test the redirection of my controller in MVC 4 .Net 4.5. Here is an example: [TestMethod] public void Register_PassValidModel_RedirectToHomeIndexShouldBeTrue() { //Arrange var registerModel = new…
user962926
  • 479
  • 2
  • 5
  • 11
21
votes
5 answers

Register .NET Framework 4.5 in IIS 7.5

Pieces of the puzzle: Windows 7 .NET Framework 4.5 (installed) IIS 7(Version 7.5.7600.16385) Visual Studio (Ultimate 2013) MVC4 (multiple projects in the solution) The solution I'm running in Visual Studio works and runs as expected with…
id.ot
  • 2,641
  • 1
  • 28
  • 45
21
votes
2 answers

Is MVC4 baked into .NET 4.5?

A lot of release notes for Visual Studio 2012 talk about .NET 4.5 and MVC4, but I can't tell if MVC4 is actually part of the .NET 4.5 release. Anybody know for sure? I would love not to have to install MVC separately on my server.
Jim
  • 10,765
  • 17
  • 74
  • 114
19
votes
3 answers

view code coverage report on azure devops portal

I am running the NUnit tests (project in .Net Framework 4.5), as part of azure devops build pipeline. - task: VSTest@2 inputs: testAssemblyVer2: 'tests/**/*.Tests.dll' pathtoCustomTestAdapters: '$(Build.SourcesDirectory)/packages' …
harishr
  • 16,726
  • 7
  • 70
  • 114
18
votes
1 answer

System.Web.Security.AntiXss.AntiXssEncoder vs Microsoft.Security.Application.AntiXssEncoder

In ASP.NET 4.5 there is a new namespace System.Web.Security.AntiXss which includes encoding routines from version 4.0 of the AntiXssLibrary (http://www.asp.net/aspnet/overview/aspnet-45/whats-new#_Toc318097382). The latest version of AntiXssLibrary…
Alexander Simonov
  • 1,502
  • 1
  • 9
  • 15
18
votes
2 answers

Type definition exists in two libraries

I am building an ASP.NET Web Forms web site using .NET 4.5. The error ... The type 'System.ComponentModel.DataAnnotations.Schema.ForeignKeyAttribute' exists in both 'f:\Projects\web…
Gary O. Stenstrom
  • 2,072
  • 8
  • 34
  • 53
18
votes
3 answers

How to implement HttpMessageHandler in Web API?

In an ASP.NET 4.5 MVC 4 Web API project, I want to add a custom HttpMessageHandler. I've changed WebApiConfig class (in \App_Satrt\WebApiConfig.cs), as follows: public static class WebApiConfig { public static void Register(HttpConfiguration…
Tohid
  • 5,185
  • 7
  • 42
  • 75
18
votes
2 answers

ASP.NET MVC 4 Areas in separate projects not working (view not found)

I have tried to create simple proof-of-concept ASP.NET MVC 4 web site using areas in separate projects. I tried to following tutorials: http://bob.archer.net/content/aspnet-mvc3-areas-separate-projects (Application doesn't work in virtual…
Tomino
  • 5,050
  • 6
  • 32
  • 47
17
votes
1 answer

How to use System.Web.Caching in asp.net?

I have a class that looks like this: using System.Collections.Generic; using System.Web.Caching; public static class MyCache { private static string cacheKey = "mykey"; public static Dictionary GetCacheValue(bool…
quakkels
  • 11,058
  • 24
  • 87
  • 147
17
votes
1 answer

.NET 4.5 MVC RouteCollection.LowercaseUrls breaks when using Area

A new property to RouteCollection was added with .NET Framework 4.5: http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.lowercaseurls.aspx This works great, until you add an Area to your project. All Urls are propercase…
mwijnands
  • 1,186
  • 11
  • 22
17
votes
12 answers

Failed to load viewstate. The control tree into which viewstate is being loaded

I am receiving the following error message after an HTTP POST on an ASP.NET form hosted inside a UserControl: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save…
krisdyson
  • 3,165
  • 7
  • 41
  • 84
17
votes
1 answer

How should I handle exceptions within a controller constructor in WebAPI?

Say I have a constructor where it's initialization can potentially throw an exception due to reasons beyond my control. FantasticApiController(IAwesomeGenerator awesome, IBusinessRepository repository, IIceCreamFactory factory) { Awesome…
Mike Bailey
  • 11,600
  • 12
  • 60
  • 118
1
2
3
40 41