WebAPI project not accepting ImageResizer config - visual-studio-2012

I've created a small WebAPI that uses ImageResizer to scale some images stored in my machine. It works flawlessly.
Now I need to use the RemoteReader plugin to allow for on-the-fly resizing of web-served images. I've installed ImageResizer.Plugins.RemoteReader using nuget but all the requests fail because IIS Web Core won't accept the resizer tag in the web.config file, giving a 0x80070032 error code. I've tried an empty <resizer /> tag and it still fails.
I am using Microsoft Visual Studio Professional 2012, the project is .Net framework 4.0 and both ImageResizer and ImageResizer.Plugins.RemoteReader are version="3.4.2".
Anyone has any clue as to what is wrong?

You didn't install ImageResizer itself into Web.config, so the <resizer/> element hasn't been defined. Install ImageResizer.MvcWebConfig and you'll be good to go.

Related

ASP.NET Core module not in IIS

I am keep getting 500.19(0x8007000d) error when running my .NET core project through IIS Express.
After a bit digging, it looks like IIS doesn't recognize <aspNetCore> as a valid element in the web.config.
Here are the things I've tried:
installed URL rewrite module as someone suggested installed
AspNetCoreModule throgh here:
https://www.microsoft.com/net/download/dotnet-core/runtime-2.0.5.
installed .NET Core Windows Server Hosting bundle.
I've tried adding it as a managed module and put the path for AspNetCoreModule, but looks like it doesn't fix the issue. Enable stdoutLog doesn't work, because it simply won't generate any log file.
Any idea on how to solve this?
I got it working finally. Because all my website is under the default website, I went to install AspNetCoreModule module for the default website.
After it was installed, I noticed a change in the web.config under the default website. At the same time, AspNetCoreModule module is also listed as Native module in the module section.
The real error message is web.config was trying to install AspNetCoreModule, but it is already installed. Then I deleted the <modules> section in the web.config under the default website and it worked...
The website used to work before I turned off/on windows IIS features. Really not sure what caused this...
Repairing the core server hosting from the add remove program did the trick -
It seems like IIS was installed or changed after core windows server hosting. According to Microsoft is such case you need to repair the hosting bundle
Add Native module with path C:\Windows\system32\inetsrv\aspnetcore.dll

cloud project iis express 8 Static compression is being disabled

Here's my setup:
An MVC web project that is hosted in azure
VS2012 and VS2013
Windows Azure SDK 2.2
IIS Express 8 - 8.0.1557
The MVC project is using castle windsor, and there are performance counters being created during application start up.
When I run the project locally (via emulator) I am find that during the performance counters creation an exception is being thrown however the performance counters are created and copied across to azure table storage.
Exception:
The directory specified for caching compressed content C:\Users\danielc\AppData\Local\dftmp\Resources\c2fd1c9b-d6c5-49af-942d-715c8f1ccc1c\temp\temp\RoleTemp\iisexpress\IIS Temporary Compressed Files\767ba5ae-0038-4c32-a70c-3d2f671e37ed is invalid. Static compression is being disabled.
When I try and find this location, it does not exist, which implies to be that it maybe a permission issue, but I dont know how to change the permissions for the emulator.
To add to my headache, I am in a team of 6, all of which are not experiencing this issue. Furthermore when it is deployed to azure it works fine as well.
My question therefore is, has anyone experienced this issue before and know a solution?
Steps taken so far:
Uninstall and install azure sdk 2.2
Install azure sdk 2.3
Install azure sdk 2.4
Uninstall and install IIS Express 8
Uninstall IIS Express 8 and install IIS Express 7.5 (which turned out did work as not supported but just clutching at straws really)
Thanks
So I believe I have got to the bottom of it. It would appear the instance count in the ServiceConfiguration.cscfg is 4, but when set to 1 it runs fine.
It is very odd that my colleagues who work with this other configuration are not experiencing the issue.

MSDeploy - Cannot deploy .NET v4.5 package to v4.0 Application Pool

After migrating TeamCity from one server to another, and also switching to Visual Studio 2013, our build fails when using MSDeploy to push a TC-built .zip package to IIS.
The application pool that you are trying to use has the
'managedRuntimeVersion' property set to 'v4.0'. This application
requires 'v4.5'
This is a strange error since my IIS server has .NET 4.5 installed and has been happily running and being deployed to for weeks, and a 4.0 application pool will run a 4.5 targeted app.
Unfortunately, the waters are muddied by the changes to TC and VS (2013) so what caused the issue I cannot be sure of.
Note: Our TC server only has Visual Studio 2012 on it, since I'm on MSDN and got early access to 2013. This could be the culprit, but doesn't make the issue any less odd.
I'd prefer not to disabled .NET runtime version checking at all (with IgnoreDeployManagedRuntimeVersion), but instead implicit set runtime version via DeployManagedRuntimeVersion:
<DeployManagedRuntimeVersion>v4.0</DeployManagedRuntimeVersion>
Some more details: http://techblog.dorogin.com/2013/11/deploying-45-projects-with-webdeploy.html
Open your .csproj file and set the following element:
<IgnoreDeployManagedRuntimeVersion>True</IgnoreDeployManagedRuntimeVersion>
Adding it just above this element helps readability:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Kudos to https://stackoverflow.com/users/1769923/abhishikt-n-jain for answering with this little-known config setting here:
MSBuild deploy failing after upgrade to .NET 4.5
If anyone knows why this happens, please feel free to add an answer.
Update
Disregard my comments below. While it got me past the deploy, I got a 503 Service Unavailable when I actually tried to run the web app. I backed out this change by setting the managedRuntimeVersion property back to v4.0 and added the IgnoreDeployManagedRuntimeVersion to my project. Then the deploy succeeded and the app worked. Dumb...
This happened to me after I installed .NET Framework 4.5.1 on a Windows Server 2008 R2 SP1 machine (as part of upgrading Powershell).
The IIS user interface on Windows Server 2008 doesn't give the option of setting the managedRuntimeVersion property to v4.5 even after that version is installed. However, this can be done on the command line using the appcmd utility as #3boysdad's answer shows.
appcmd is the command-line equivalent of managing IIS sites, apps, apppools, etc. It is located at %systemroot%\system32\inetsrv\appcmd.exe but it is not on the PATH as the following link explains:
http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe#HowToUse
I'm of the opinion that modifying your project (via the IgnoreDeployManagedRuntimeVersion or DeployManagedRuntimeVersion properties) is sub-optimal. The application pool should be set to use v4.5, and the only way to do that on Windows Server 2008 is to use the appcmd utility. #3boysdad's answer should be the accepted answer.
found this gem while hunting around for this same problem.
appcmd set apppool /apppool.name: <your app pool> /managedRuntimeVersion:v4.5
this will need to be executed in your \System32\inetsrv directory.

Umbraco - web.config issue when installing

I'm trying to install a default Umbraco installation on IIS7, and I'm getting the following error on my (unmodified) web.config file, any ideas?
Config Error
The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration
Thanks,
I'm going to assume you are using the current version of Umbraco 4.5.2 as offered on the Codeplex site...
By default, Umbraco is configured to use .Net 2.0 (not .Net 4.0). Go to your IIS Management Console, select ApplicationPools and double-click your website. Make sure the .Net Framework is set to 2.0.
Also make sure the server you are running the IIS on has .Net 2.0 installed!
If you can provide more information from the server's error page, I can help better pinpoint the error...

Do you get an easy to use IIS Installer?

I have just finished the development of a web service application in visual studio.
Is there an easy way to wrap it in an installer, so that I can just ship it off to technical support, and they can have a wizard based installer that will fully setup an IIS site for them, either in 6 or 7?
You can use Visual Studio's built in setup project. I've only tried this once on a test project, but it created all the necessary stuff in IIS 6 just fine.
I would suggest you export the IIS METABASE for your local instance of the service and then this can be imported into a new server to create the correct IIS configuration. Have a look at Copying IIS Configurations using iiscnfg.vbs The METABASE is just an XML file and you will easily see the specific values that allows you to edit them should the deployment be different in anyway.

Resources