.net-4.5

Deploying a .Net 4.5 website to an IIS 7.5 server

半城伤御伤魂 提交于 2019-12-18 12:29:26
问题 We are using Teamcity to do continuous integration builds for our website and have just upgraded our website to .Net 4.5RC. The application builds and runs in IIS express on my box and builds on our build server that I have installed .NEt 4.5RC on. But when we deploy it to the server that has had .Net 4.5RC installed on it we get the following error. The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v4.0'. This application requires 'v4.5'. What

Does ProfileOptimization actually work?

喜你入骨 提交于 2019-12-18 12:14:29
问题 One of the new performance enhanchements for .NET 4.5 is the introduction of the 'MultiCode JIT'. See here for more details. I have tried this, but it seems to have no effect on my application. The reason why I am interested is that my app (IronScheme) takes a good long time to startup if not NGEN'd, which implies a fair amount of JIT'ng is involved at startup. (1.4 sec vs 0.1 sec when NGEN'd). I have followed the instructions on how to enable this, and I can see a 'small' (4-12KB) is created

HTTP Error 403.14 - Forbidden - MVC4 .net 4.5 bundles

半城伤御伤魂 提交于 2019-12-18 12:13:27
问题 I made a MVC4 application with .net 4.5 using razor engine. It works fine when run locally with visual studio. When I deploy to IIS on windows server 2008 R2(all windows updates done), it appears my bundles do not work and the CCS is not loading. I tried viewing the site on the server, viewed source went to the bundle link for the css, and it loads some css and then there is an IIS error of: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

How to 'await' raising an EventHandler event

笑着哭i 提交于 2019-12-18 10:16:14
问题 Sometimes the event pattern is used to raise events in MVVM applications by or a child viewmodel to send a message to its parent viewmodel in a loosely coupled way like this. Parent ViewModel searchWidgetViewModel.SearchRequest += (s,e) => { SearchOrders(searchWidgitViewModel.SearchCriteria); }; SearchWidget ViewModel public event EventHandler SearchRequest; SearchCommand = new RelayCommand(() => { IsSearching = true; if (SearchRequest != null) { SearchRequest(this, EventArgs.Empty); }

Creating an async method in .NET 4.0 that can be used with “await” in .NET 4.5

孤人 提交于 2019-12-18 10:13:53
问题 I have a .NET project that uses C# in .NET 4.0 and VS2010. What I would like to do is add some async overloads to my library to make doing async programming easier for users in .NET 4.5 with the await keyword. Right now the methods that are being overloaded are non-asynchronous. Also I don't want to use any async methods myself, just create new ones and make them available. Is creating async methods in .NET 4.0 and VS2010 possible and if so, what should the .NET 4.0 async method look like?

Why would finding a type's initializer throw a NullReferenceException?

大城市里の小女人 提交于 2019-12-18 09:57:09
问题 This has got me stumped. I was trying to optimize some tests for Noda Time, where we have some type initializer checking. I thought I'd find out whether a type has a type initializer (static constructor or static variables with initializers) before loading everything into a new AppDomain . To my surprise, a small test of this threw NullReferenceException - despite there being no null values in my code. It only throws the exception when compiled with no debug information. Here's a short but

'Enable-Migrations' fails after upgrading to .NET 4.5 and EF 5

谁都会走 提交于 2019-12-18 07:35:15
问题 I just upgraded my MVC4 project to .NET 4.5 and EF5 and started using VS2012. After realizing I needed to set-up auto-migrations in the Package Manager again I ran Enable-Migrations - EnableAutomaticMigrations and received the error No context type was found in the assembly 'MySolutionName'. Some Research has said that it has to do with EF5 not enabling prereleases. I ran Install-Package EntityFramework -IncludePrerelease but it said EF5 was already installed (which it was when I installed it

'Enable-Migrations' fails after upgrading to .NET 4.5 and EF 5

懵懂的女人 提交于 2019-12-18 07:34:59
问题 I just upgraded my MVC4 project to .NET 4.5 and EF5 and started using VS2012. After realizing I needed to set-up auto-migrations in the Package Manager again I ran Enable-Migrations - EnableAutomaticMigrations and received the error No context type was found in the assembly 'MySolutionName'. Some Research has said that it has to do with EF5 not enabling prereleases. I ran Install-Package EntityFramework -IncludePrerelease but it said EF5 was already installed (which it was when I installed it

SQLite with VS2012 and .NET 4.5 — ANY CPU Build

妖精的绣舞 提交于 2019-12-18 05:49:38
问题 I've tried looking through the answers for related questions, but haven't found anything that isn't a few years old (unsure if they are still the go-to answer) or that answers my question fully. Requirements: I'm developing a C# application that is to run on BOTH 32-bit and 64-bit computers. My client does NOT want to create two different releases based on x86 vs x64. We're using SQLite, VS2012, and .NET 4.5. Here are the available DLLs for SQLite: http://system.data.sqlite.org/index.html/doc

Is the method naming for property getters/setters standardized in IL?

纵饮孤独 提交于 2019-12-18 05:48:25
问题 I have the following two methods that I am wondering if they are appropriate: public bool IsGetter(MethodInfo method) { return method.IsSpecialName && method.Name.StartsWith("get_", StringComparison.Ordinal); } public bool IsSetter(MethodInfo method) { return method.IsSpecialName && method.Name.StartsWith("set_", StringComparison.Ordinal); } While this code works, I'm hoping to avoid the portion that checks the StartsWith and programmatically get the naming convention. Basically, are there