Configuring .NET Framework 4.5.2 in IIS 8.0 - iis-8

In my Windows Server 2012, I have installed .NET Framework 4.5.2, but it is not listing in IIS when I tried to change one application pool's .NET Framework.

The application pool should be set to .net 4.0, that includes all updates like 4.5.1 and 4.5.2
All other settings are through config, for example:
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>

install Microsoft .NET Framework 4.5.2 Developer Pack https://www.microsoft.com/en-us/download/details.aspx?id=42637

Related

How to publish a Asp.net 5 MVC6 website on IIS containing two web apps

I have got a project with two web apps. One of them is only for reference in the base app. The project runs okay in visual studio. I am trying to publish it in local file system and then copy it across to the windows server 2008. Below is the web.config generated by visual studio.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="bootstrapper-version" value="1.0.0-beta4" />
<add key="runtime-path" value="..\approot\packages" />
<add key="dnx-version" value="1.0.0-beta4" />
<add key="dnx-clr" value="clr" />
<add key="dnx-app-base" value="..\approot\src\MySite" />
</appSettings>
</configuration>
When I run this website in Server using dnx . web, it runs okay. But when I try to run it under IIS by pointing IIS to wwwroot then all of the packages go missing. The website is unable to find packages.
Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1':
Base32 1.0.0.13
BouncyCastle 1.7.0
CsQuery 1.3.4
EcmaScript.Net 1.0.1.0
EntityFramework 7.0.0-beta4
EntityFramework.Commands 7.0.0-beta4
EntityFramework.Core 7.0.0-beta4
EntityFramework.Relational 7.0.0-beta4
EntityFramework.Relational.Design 7.0.0-beta4
EntityFramework.SqlServer 7.0.0-beta4
EntityFramework.SqlServer.Design 7.0.0-beta4
.........
.........
How did you deploy?
Here are the steps that you can follow to get that running:
Make sure that you the app pool is a .NET 4 app pool
Run, in your web app's project folder dnu publish --runtime <name of runtime> (the name is the name of the runtime folder under %userprofile%\.dnx\runtimes
Step 2 generates a folder that contains the application, its dependencies and the runtime under the bin\debug folder.
Copy that folder to the IIS website folder
Run

Visual Studio 2012 IntelliSense & Highlighting stopped working for ASP.NET MVC 5 Web App after installing Xamarin Studio

After installing Xamarin Studio Visual Studio 2012 IntelliSense & Highlighting stopped working for ASP.NET MVC 5 Web App.
Syntax and IntelliSense for my MVC 4 Web Projects are there when I open or create a new MVC 4 Web project.
Syntax and IntelliSense for my MVC 5 Web Projects are gone and I believe it happened right after I installed Xamarin Studio which has a few SDKs and some other stuff that integrates into Visual Studio.
Is anyone familiar with this issue?
PS: I just created a New MVC 4 and MVC 5 projects and looking for what could be causing the issue - because MVC 4 project's IntelliSense & Highlighting is there and MVC 5's is not.
Here is a Web.Config file for MVC 5
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
Here is a packages.config file for MVC 5
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
</packages>
As I was looking for an answer I have seen some folks struggling with the same issue after installing Xamarin Studio.
I finally was able to fix it by installing Microsoft ASP.NET Razor Version 2.1.0
Now Intellisense is working on the View as well.
I wish I could also leave a comment on some other question (I don't have enough reputation to do so) because it looks like they are struggling with the same MVC 5 Intellisense issue (one guy there reported that it started happening after Xamarin installation as well)and that solution could possibly help them.

MSI .NET Framework Prerequisite

I have an MSI file with .NET Framework 2.0 Prerequisite. In windows 8 .NEt framework 2.0 is not installed by default and when i run the .msi, it says you need to install .NET framework 2.0.
But Windows 8 already comes with .NET framework 4.0 or 4.5 which supports older versions and indeed would be able to run the msi file if i could say this msi file can also run on .NET framework 4.0. How can i do that?
More precisely, how can i configure an msi file to have a prerequisite such that min .net framework version 2.0 but can run on newer versions?
I can do this for assemblies adding the configuration below.
<configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v3.0" />
<supportedRuntime version="v3.5" />
<supportedRuntime version="v4.0" />
</startup>
</configuration>
Thanks
The SO question How can I detect .net 3.5 in WiX? appears to answer this. It also points to another post that discusses this when not using WiX
If you install the .Net framework 3.5, that will provide 2.0 as well. Only 4.5 is installed by default. Go to the Windows features and turn on .Net framework 3.5.

ASMX to WCF conversion

I had an asmx service in .NET Framework 3.5 which I have now converted to .NET Framework 4.0. Now I want to run this service as WCF service with the same ASMX extension. I read a couple of blogs which have step y step procedure to convert them. However they all refer to .NET Framework 3.5. Here are the references I got from internet.
http://weblogs.manas.com.ar/waj/2007/05/31/asmx-to-wcf-migration/
http://blogs.msdn.com/b/wenlong/archive/2007/09/18/how-to-use-asmx-extension-to-handle-wcf-requests.aspx
I tried these and they work well with 3.5 framework but not with 4.0 framework. I got the error
Unable to cast object of type
'System.Web.Compilation.BuildResultCustomString'
to type
'System.Web.Compilation.BuildResultCompiledType'.
on which I added httpHandler section and it was gone. However now I get a new error
Could not load type
'System.ServiceModel.Activation.HttpHandler'
from assembly 'System.ServiceModel,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
Can anyone help me out with this error.
I got it working with aspNetCompatibilityEnabled set to 'true' like this:
Add a reference to:
System.ServiceModel.Activation
in your web.config:
<system.web>
<compilation debug="true" targetFramework="4.0">
<buildProviders>
<remove extension=".asmx"/>
<add extension=".asmx" type="System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</buildProviders>
</compilation>
</system.web>
<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="MyNewAsmxHandler" path="*.asmx" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
mind the type and publickeytoken changes in the handler! It has to be 'System.ServiceModel.Activation' in stead of 'System.ServiceModel' and 'PublicKeyToken=31bf3856ad364e35' as Microsoft has split these into seperate assemblies
I think you may need to register the .NET 4 handlers in IIS properly. Run ServiceModelReg.exe -ia from the .NET 4 framework directory and see if it helps.
C:\Windows\Microsoft.NET\Framework\v4.0.30319>ServiceModelReg.exe /?
Microsoft (R) WCF/WF registration tool version 4.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
Administration utility that manages the installation and uninstallation of
WCF and WF components on a single machine.
Usage:
ServiceModelReg.exe [(-ia|-ua|-r)|((-i|-u) -c:<command>)] [-v|-q] [-nologo]
[-h]
-ia
Install all components
-ua
Uninstall all components
-r
Extended only. Repairs all components
-i
Install components specified with -c
-u
Uninstall components specified with -c
-c:<component>
Install/uninstall a component:
httpnamespace - HTTP namespace reservation
tcpportsharing - TCP port sharing service
tcpactivation - TCP activation service (unsupported on .NET 4 Clien
t Profile)
namedpipeactivation - Named pipe activation service (unsupported on .NET
4 Client Profile)
msmqactivation - MSMQ activation service (unsupported on .NET 4 Clie
nt Profile)
etw - ETW event tracing manifests (Windows Vista or later
)
Can be used to install several components at the same time
-q
Quiet mode (only error logging)
-v
Verbose mode
-nologo
Suppress the copyright and banner message
-h
Displays this help text.
Examples:
ServiceModelReg.exe -ia
Installs all components
ServiceModelReg.exe -i -c:httpnamespace -c:etw
Installs HTTP namespace reservation and ETW manifest
ServiceModelReg.exe -u -c:etw
Uninstalls ETW manifests
ServiceModelReg.exe -r
Repairs an extended install

Loading a 3.5 compiled C++/CLI application in .NET 4.0

I'm trying to load a mixed managed application compiled and targeted for Framework 3.5 in the 4.0 CLR.
We have a .config file next to the .exe where I've added this node:
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0.21006" />
</startup>
Unfortunately, the app crashes out on startup with a nasty callstack. Can someone in the know confirm that a mixed managed app (.exe is C++/CLI) will not load in 4.0 if it was compiled for 3.5?
I'm watching a Channel9 video about side-by-side CLR hosting, and one of the devs seems to imply that this is the case:
http://channel9.msdn.com/shows/Going+Deep/CLR-4-Side-by-Side-In-Process-What-How-Why/
Thanks!
You need to set useLegacyV2RuntimeActivationPolicy if you want to load a CLR 2 (.NET 3.5) mixed mode assembly in a CLR 4 process:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Without this, you'll get a nasty exception.
You should be able to run 3.5 and 4.0 in the same process. However forcing the app to use 4.0 instead of 3.5 doesn't look possible.
What are you trying to accomplish?