DBSet does not contain a definition for Where [duplicate]

[Origin]: http://stackoverflow.com/questions/26848118/dbset-does-not-contain-a-definition-for-where

Add using System.Linq; in your model class

shareedit
Advertisements

Error in Protocol Mapping While hosting a WCF service in IIS

[Origin]: http://stackoverflow.com/questions/13123861/error-in-protocol-mapping-while-hosting-a-wcf-service-in-iis

I developed a simple WCF service with VS 2010. And i hosted in the default website in IIS by Adding Application and set the Physical Path

And i tried to browse the .svc file it gives me the following error:

The configuration section ‘protocolMapping’ cannot be read because it is missing a section declaration

Protocol Mapping Error

and I tried many solutions but it doesn’t work

I Created WCF Service Library has an App.config with this:

<?</span><span class="pln">xml version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pln"> encoding</span><span class="pun">=</span><span class="str">"utf-8"</span> <span class="pun">?></span>
<span class="str"><configuration></span>

  <span class="str"><appSettings></span>
    <span class="pun"><</span><span class="pln">add key</span><span class="pun">=</span><span class="str">"aspnet:UseTaskFriendlySynchronizationContext"</span><span class="pln"> value</span><span class="pun">=</span><span class="str">"true"</span> <span class="pun">/></span>
  <span class="pun"></</span><span class="pln">appSettings</span><span class="pun">></span>
  <span class="pun"><</span><span class="pln">system</span><span class="pun">.</span><span class="pln">web</span><span class="pun">></span>
    <span class="pun"><</span><span class="pln">compilation debug</span><span class="pun">=</span><span class="str">"true"</span> <span class="pun">/></span>
  <span class="pun"></</span><span class="pln">system</span><span class="pun">.</span><span class="pln">web</span><span class="pun">></span>
  <span class="pun"><!--</span> <span class="typ">When</span><span class="pln"> deploying the service library project</span><span class="pun">,</span><span class="pln"> the content of the config file must be added to the host</span><span class="str">'</span><span class="pln">s 
  app</span><span class="pun">.</span><span class="pln">config file</span><span class="pun">.</span> <span class="typ">System</span><span class="pun">.</span><span class="typ">Configuration</span><span class="pln"> does not support config files </span><span class="kwd">for</span><span class="pln"> libraries</span><span class="pun">.</span> <span class="pun">--></span>
  <span class="pun"><</span><span class="pln">system</span><span class="pun">.</span><span class="pln">serviceModel</span><span class="pun">></span>
    <span class="str"><services></span>
      <span class="pun"><</span><span class="pln">service name</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.EvalService"</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">clear </span><span class="pun">/></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"basic"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"basicHttpBinding"</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span><span class="pln">
          listenUriMode</span><span class="pun">=</span><span class="str">"Explicit"</span><span class="pun">></span>
          <span class="str"><identity></span>
            <span class="pun"><</span><span class="pln">dns value</span><span class="pun">=</span><span class="str">"localhost"</span> <span class="pun">/></span>
            <span class="pun"><</span><span class="pln">certificateReference storeName</span><span class="pun">=</span><span class="str">"My"</span><span class="pln"> storeLocation</span><span class="pun">=</span><span class="str">"LocalMachine"</span><span class="pln">
              x509FindType</span><span class="pun">=</span><span class="str">"FindBySubjectDistinguishedName"</span> <span class="pun">/></span>
          <span class="pun"></</span><span class="pln">identity</span><span class="pun">></span>
        <span class="pun"></</span><span class="pln">endpoint</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"mex"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"mexHttpBinding"</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"IMetadataExchange"</span><span class="pln">
          listenUriMode</span><span class="pun">=</span><span class="str">"Explicit"</span><span class="pun">></span>
          <span class="str"><identity></span>
            <span class="pun"><</span><span class="pln">dns value</span><span class="pun">=</span><span class="str">"localhost"</span> <span class="pun">/></span>
            <span class="pun"><</span><span class="pln">certificateReference storeName</span><span class="pun">=</span><span class="str">"My"</span><span class="pln"> storeLocation</span><span class="pun">=</span><span class="str">"LocalMachine"</span><span class="pln">
              x509FindType</span><span class="pun">=</span><span class="str">"FindBySubjectDistinguishedName"</span> <span class="pun">/></span>
          <span class="pun"></</span><span class="pln">identity</span><span class="pun">></span>
        <span class="pun"></</span><span class="pln">endpoint</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"ws"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"wsHttpBinding"</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span><span class="pln">
          listenUriMode</span><span class="pun">=</span><span class="str">"Explicit"</span><span class="pun">></span>
          <span class="str"><identity></span>
            <span class="pun"><</span><span class="pln">dns value</span><span class="pun">=</span><span class="str">"localhost"</span> <span class="pun">/></span>
            <span class="pun"><</span><span class="pln">certificateReference storeName</span><span class="pun">=</span><span class="str">"My"</span><span class="pln"> storeLocation</span><span class="pun">=</span><span class="str">"LocalMachine"</span><span class="pln">
              x509FindType</span><span class="pun">=</span><span class="str">"FindBySubjectDistinguishedName"</span> <span class="pun">/></span>
          <span class="pun"></</span><span class="pln">identity</span><span class="pun">></span>
        <span class="pun"></</span><span class="pln">endpoint</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"net.tcp://localhost:8888/evalservice"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"netTcpBinding"</span><span class="pln">
          contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span><span class="pln"> listenUriMode</span><span class="pun">=</span><span class="str">"Explicit"</span><span class="pun">></span>
          <span class="str"><identity></span>
            <span class="pun"><</span><span class="pln">dns value</span><span class="pun">=</span><span class="str">"localhost"</span> <span class="pun">/></span>
            <span class="pun"><</span><span class="pln">certificateReference storeName</span><span class="pun">=</span><span class="str">"My"</span><span class="pln"> storeLocation</span><span class="pun">=</span><span class="str">"LocalMachine"</span><span class="pln">
              x509FindType</span><span class="pun">=</span><span class="str">"FindBySubjectDistinguishedName"</span> <span class="pun">/></span>
          <span class="pun"></</span><span class="pln">identity</span><span class="pun">></span>
        <span class="pun"></</span><span class="pln">endpoint</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"net.pipe://localhost/evalservice"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"netNamedPipeBinding"</span><span class="pln">
          bindingConfiguration</span><span class="pun">=</span><span class="str">""</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span> <span class="pun">/></span>
        <span class="str"><host></span>
          <span class="str"><baseAddresses></span>
            <span class="pun"><</span><span class="pln">add baseAddress</span><span class="pun">=</span><span class="str">"http://localhost:8080/evalservice"</span> <span class="pun">/></span>
          <span class="pun"></</span><span class="pln">baseAddresses</span><span class="pun">></span>
        <span class="pun"></</span><span class="pln">host</span><span class="pun">></span>
      <span class="pun"></</span><span class="pln">service</span><span class="pun">></span>
    <span class="pun"></</span><span class="pln">services</span><span class="pun">></span>
    <span class="str"><behaviors></span>
      <span class="str"><serviceBehaviors></span>
        <span class="str"><behavior></span>
          <span class="pun"><!--</span> <span class="typ">To</span><span class="pln"> avoid disclosing metadata information</span><span class="pun">,</span> 
          <span class="typ">set</span><span class="pln"> the values below to </span><span class="kwd">false</span><span class="pln"> before deployment </span><span class="pun">--></span>
          <span class="pun"><</span><span class="pln">serviceMetadata httpGetEnabled</span><span class="pun">=</span><span class="str">"True"</span><span class="pln"> httpsGetEnabled</span><span class="pun">=</span><span class="str">"True"</span><span class="pun">/></span>
          <span class="pun"><!--</span> <span class="typ">To</span><span class="pln"> receive exception details </span><span class="kwd">in</span><span class="pln"> faults </span><span class="kwd">for</span><span class="pln"> debugging purposes</span><span class="pun">,</span> 
          <span class="typ">set</span><span class="pln"> the value below to </span><span class="kwd">true</span><span class="pun">.</span>  <span class="typ">Set</span><span class="pln"> to </span><span class="kwd">false</span><span class="pln"> before deployment 
          to avoid disclosing exception information </span><span class="pun">--></span>
          <span class="pun"><</span><span class="pln">serviceDebug includeExceptionDetailInFaults</span><span class="pun">=</span><span class="str">"False"</span> <span class="pun">/></span>
        <span class="pun"></</span><span class="pln">behavior</span><span class="pun">></span>
      <span class="pun"></</span><span class="pln">serviceBehaviors</span><span class="pun">></span>
    <span class="pun"></</span><span class="pln">behaviors</span><span class="pun">></span>
  <span class="pun"></</span><span class="pln">system</span><span class="pun">.</span><span class="pln">serviceModel</span><span class="pun">></span>
<span class="pun"></</span><span class="pln">configuration</span><span class="pun">>

and i Hosted the WCF Service Library application in WCF website (My Client) has an Web.config with this:

<?</span><span class="pln">xml version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pun">?></span>
<span class="str"><configuration></span>

  <span class="str"><appSettings></span>
    <span class="pun"><</span><span class="pln">add key</span><span class="pun">=</span><span class="str">"aspnet:UseTaskFriendlySynchronizationContext"</span><span class="pln"> value</span><span class="pun">=</span><span class="str">"true"</span> <span class="pun">/></span>
  <span class="pun"></</span><span class="pln">appSettings</span><span class="pun">></span>
  <span class="pun"><</span><span class="pln">system</span><span class="pun">.</span><span class="pln">web</span><span class="pun">></span>
    <span class="pun"><</span><span class="pln">compilation debug</span><span class="pun">=</span><span class="str">"false"</span><span class="pln"> targetFramework</span><span class="pun">=</span><span class="str">"4.5"</span> <span class="pun">/></span>
    <span class="pun"><</span><span class="pln">httpRuntime targetFramework</span><span class="pun">=</span><span class="str">"4.5"</span><span class="pun">/></span>
  <span class="pun"></</span><span class="pln">system</span><span class="pun">.</span><span class="pln">web</span><span class="pun">></span>
  <span class="pun"><</span><span class="pln">system</span><span class="pun">.</span><span class="pln">serviceModel</span><span class="pun">></span>
    <span class="str"><services></span>
      <span class="pun"><</span><span class="pln">service name</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.EvalService"</span><span class="pun">></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">""</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"wsHttpBinding"</span><span class="pln"> bindingConfiguration</span><span class="pun">=</span><span class="str">""</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span> <span class="pun">/></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"mex"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"mexHttpBinding"</span><span class="pln"> bindingConfiguration</span><span class="pun">=</span><span class="str">""</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"IMetadataExchange"</span> <span class="pun">/></span>
        <span class="pun"><</span><span class="pln">endpoint address</span><span class="pun">=</span><span class="str">"basic"</span><span class="pln"> binding</span><span class="pun">=</span><span class="str">"basicHttpBinding"</span><span class="pln"> bindingConfiguration</span><span class="pun">=</span><span class="str">""</span><span class="pln"> contract</span><span class="pun">=</span><span class="str">"EvalServiceLibrary.IEvalService"</span> <span class="pun">/></span>
      <span class="pun"></</span><span class="pln">service</span><span class="pun">></span>
    <span class="pun"></</span><span class="pln">services</span><span class="pun">></span>
    <span class="str"><behaviors></span>
      <span class="str"><serviceBehaviors></span>
        <span class="str"><behavior></span>
          <span class="pun"><!--</span> <span class="typ">To</span><span class="pln"> avoid disclosing metadata information</span><span class="pun">,</span> <span class="typ">set</span><span class="pln"> the values below to </span><span class="kwd">false</span><span class="pln"> before deployment </span><span class="pun">--></span>
          <span class="pun"><</span><span class="pln">serviceMetadata httpGetEnabled</span><span class="pun">=</span><span class="str">"true"</span><span class="pln"> httpsGetEnabled</span><span class="pun">=</span><span class="str">"true"</span><span class="pun">/></span>
          <span class="pun"><!--</span> <span class="typ">To</span><span class="pln"> receive exception details </span><span class="kwd">in</span><span class="pln"> faults </span><span class="kwd">for</span><span class="pln"> debugging purposes</span><span class="pun">,</span> <span class="typ">set</span><span class="pln"> the value below to </span><span class="kwd">true</span><span class="pun">.</span>  <span class="typ">Set</span><span class="pln"> to </span><span class="kwd">false</span><span class="pln"> before deployment to avoid disclosing exception information </span><span class="pun">--></span>
          <span class="pun"><</span><span class="pln">serviceDebug includeExceptionDetailInFaults</span><span class="pun">=</span><span class="str">"false"</span><span class="pun">/></span>
        <span class="pun"></</span><span class="pln">behavior</span><span class="pun">></span>
      <span class="pun"></</span><span class="pln">serviceBehaviors</span><span class="pun">></span>
    <span class="pun"></</span><span class="pln">behaviors</span><span class="pun">></span>
    <span class="str"><protocolMapping></span>
      <span class="pun"><</span><span class="pln">add binding</span><span class="pun">=</span><span class="str">"basicHttpsBinding"</span><span class="pln"> scheme</span><span class="pun">=</span><span class="str">"https"</span> <span class="pun">/></span>
    <span class="pun"></</span><span class="pln">protocolMapping</span><span class="pun">></span>
    <span class="pun"><</span><span class="pln">serviceHostingEnvironment aspNetCompatibilityEnabled</span><span class="pun">=</span><span class="str">"true"</span><span class="pln"> multipleSiteBindingsEnabled</span><span class="pun">=</span><span class="str">"true"</span> <span class="pun">/></span>
  <span class="pun"></</span><span class="pln">system</span><span class="pun">.</span><span class="pln">serviceModel</span><span class="pun">></span>
  <span class="pun"><</span><span class="pln">system</span><span class="pun">.</span><span class="pln">webServer</span><span class="pun">></span>
    <span class="pun"><</span><span class="pln">modules runAllManagedModulesForAllRequests</span><span class="pun">=</span><span class="str">"true"</span><span class="pun">/></span>
    <span class="pun"><!--</span>
        <span class="typ">To</span><span class="pln"> browse web app root directory during debugging</span><span class="pun">,</span> <span class="typ">set</span><span class="pln"> the value below to </span><span class="kwd">true</span><span class="pun">.</span>
        <span class="typ">Set</span><span class="pln"> to </span><span class="kwd">false</span><span class="pln"> before deployment to avoid disclosing web app folder information</span><span class="pun">.</span>
      <span class="pun">--></span>
    <span class="pun"><</span><span class="pln">directoryBrowse enabled</span><span class="pun">=</span><span class="str">"true"</span><span class="pun">/></span>
  <span class="pun"></</span><span class="pln">system</span><span class="pun">.</span><span class="pln">webServer</span><span class="pun">></span>
<span class="pun"></</span><span class="pln">configuration</span><span class="pun">>
shareedit

Amr,

This sounds like you may have permission issues in the folder you .svc is running from, please can you check and see if the following permissions are there:

  • \IIS_IUSERS
  • \IIS_IUSR —If running webservice in Anonymous Mode

For the issue with protocol Mapping, please ensure that the app Pool you are using for the IIS site is setup to use .net 4, as from what I understand protocol mapping is only available in .net 4.

Hope this helps

shareedit

No ASP.NET MVC 5 Web Application Template on VS 2012?

[Origin]: http://stackoverflow.com/questions/20607648/no-asp-net-mvc-5-web-application-template-on-vs-2012

After creating a new project using ASP.NET MVC 5 Empty Project, you can right click on the project, then click Add.. > New Scaffolded Item..., select MVC on the left, then MVC 5 Dependencies and choose Full dependencies from the prompt.

This will add a default layout (Views\Shared\_Layout.cshtml), Content folder, Scripts folder with bootstrap, jquery, modernizr, etc, and other things the Web Application template creates.

If you get the error “CS0103: The name ‘Styles’ does not exist in the current context” just add <add namespace="System.Web.Optimization"/> under <namespaces> in Views/web.config

shareedit

IIS_IUSRS and IUSR permissions in IIS8

[Origin]: http://stackoverflow.com/questions/14934006/iis-iusrs-and-iusr-permissions-in-iis8

I’ve just moved away from IIS6 on Win2003 to IIS8 on Win2012 for hosting ASP.NET applications.

Within one particular folder in my application I need to Create & Delete files. After copying the files to the new server, I kept seeing the following errors when I tried to delete files:

Access to the path ‘D:\WebSites\myapp.co.uk\companydata\filename.pdf’ is denied.

When I check IIS I see that the application is running under the DefaultAppPool account, however, I never set up Windows permissions on this folder to include IIS AppPool\DefaultAppPool

Instead, to stop screaming customers I granted the following permissions on the folder:

IUSR

  • Read & Execute
  • List Folder Contents
  • Read
  • Write

IIS_IUSRS

  • Modify
  • Read & Execute
  • List Folder Contents
  • Read
  • Write

This seems to have worked, but I am concerned that too many privileges have been set. I’ve read conflicting information online about whether IUSR is actually needed at all here. Can anyone clarify which users/permissions would suffice to Create and Delete documents on this folder please? Also, is IUSR part of the IIS_IUSRS group?

Update & Solution

Please see my answer below. I’ve had to do this sadly as some recent suggestions were not well thought out, or even safe (IMO).

shareedit

I hate to post my own answer, but some answers recently have ignored the solution I posted in my own question, suggesting approaches that are nothing short of foolhardy.

In short – you do not need to edit any Windows user account privileges at all. Doing so only introduces risk. The process is entirely managed in IIS using inherited privileges.

Applying Modify/Write Permissions to the Correct User Account

  1. Right-click the domain when it appears under the Sites list, and choose Edit Permissions

    enter image description here

    Under the Security tab, you will see MACHINE_NAME\IIS_IUSRS is listed. This means that IIS automatically has read-only permission on the directory (e.g. to run ASP.Net in the site). You do not need to edit this entry.

    enter image description here

  2. Click the Edit button, then Add…
  3. In the text box, type IIS AppPool\MyApplicationPoolName, substituting MyApplicationPoolNamewith your domain name, e.g. IIS AppPool\mydomain.com

    enter image description here

  4. Press the Check Names button. The text you typed will transform (notice the underline):

    enter image description here

  5. Press OK to add the user
  6. With the new user (your domain) selected, now you can safely provide any Modify or Write permissions

    enter image description here

shareedit

git pushes with wrong user from terminal

[Origin]: http://stackoverflow.com/questions/21615431/git-pushes-with-wrong-user-from-terminal

I have an issue with git and my terminal.

Here’s a gallery to show you my issue : http://imgur.com/a/6RrEY

When I push commits from my terminal, git says I push them with another username, that’s a user from my organisation (my company) with no commit at all and it seems it belongs to no one : (check gallery first pic)

But this doesn’t happen when I use Github for mac, in the feed I see the commits pushed by myself.

The problem also affects my personal repositories, my terminal says that I don’t have the permission to push commits on those repositories (which is obviously wrong) since it tries to push it with this user : (check gallery second pic)

Guess what ? This doesn’t happen with Github for mac too.

I changed my computer to a brand new one few days ago, so I reset’ed all my ssh key of github and left only a new one generated by Github for Mac so I don’t think that there’s some ghost user/ssh key hidden somewhere, this hdd is brand new : (check gallery third pic)

My .gitconfig file is all clear, there’s only my credentials : (check gallery fourth pic)

I really don’t get it, help, StackOverflow, you’re my only hope.

(My apologies for my poor Gimp skills and the Star Wars reference)

EDIT : ssh-add -l only shows the good ssh key created by github for mac and I have only one github account

EDIT2 : ssh -T git@github.com recognize me as the good user.

EDIT3 : After a few tests it looks like my terminal does the commits with my username, but pushes them with the other one, Github for mac commits and pushes with the good username.This situation happen with every repo I have/make (even new ones).

EDIT4 : In a personal repository git log --pretty="%h %an %ae" shows my good username

EDIT5 : No sign of environment variables that would override my credentials in my env. Even if I try to set those variables with the good credentials problem persists.

EDIT6 : Things work back normally if I force the user in the path of /.git/config of a repository but I don’t think that’s the good option : http://USER@github.com/USER/REPO.git

EDIT7 : We deleted the git user that pushed the commits for me and this brings another error : remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/USER/REPO.git/'

FINAL EDIT : I installed git with homebrew, typed git config --global push.default simpleand now it takes my credentials even without forceing the user. That’s strange. Thanks everybody for your help, you’re great guys !

shareedit

check ~/.gitconfig and $project_root/.git/config files. One of those two is surely misconfigured for user name. – mu 無 Feb 6 ’14 at 22:31

Despite all the great options given by other users, the only way to fix this was to reinstall git completely and type git config --global push.default simple to rewrite good credentials.

shareedit

git config --system --unset credential.helper worked for me, I’m now asked for my GitHub credentials on push again and can supply the correct user ID and password. – CoDEmanX Sep 2 ’16 at 12:44

How to add/insert leading zeros to numbers or text in Excel?

[Origin]: https://www.extendoffice.com/documents/excel/792-excel-add-leading-zeros-to-number-text.html

Supposing you have a range of data, and you need to add zeros in front of each cells as following screenshots shown. How could you quickly add the zeros before the numbers?

doc-add-leading-zeros1 -2 doc-add-leading-zeros2

 

 


arrow blue right bubble Add/ insert leading zeros to numbers with Text function

The Text function will add zeros in front of numbers, and make the new numbers with leading zeros in certain length.

Step 1: Enter the formula =Text (A1, “00000”) in a blank cell which is adjacent to the data cell.

doc-add-leading-zeros3

Step 2: Then press Enter key, and select cell C1 drag the fill handle Description: Selected cell with fill handle across the range that you want to fill. Then you will view all the numbers in A1:B6 are copied and pasted to C1:D6 with leading zeros. And each numbers contains 5 digits.

doc-add-leading-zeros4

Tips: 1. As they are formulas, so when you need to copy and paste them to other places, you need to paste them as values.

2. This Text function can not add leading zeros for text.


arrow blue right bubble Add/ insert leading zeros to numbers and text with Concatenate function

If you want to insert specific digit of leading zeros into each number, for example three leading zeros for each number, you should try the Concatenate function.

Step 1: Enter the formula =Concatenate (“000”, A1) in a blank cell and press Enter key. In this case, we enter the formula in Cell C1.

Step 2: Click the Cell C1, and drag the fill handle Description: Selected cell with fill handle across the range that you want to fill. Then you will view numbers in A1:B6 are pated to C1:D6, and each number contains three leading zeros.

doc-add-leading-zeros5

How do I enable HTTP PUT and DELETE for ASP.NET MVC in IIS?

[Origin]: http://stackoverflow.com/questions/12440277/how-do-i-enable-http-put-and-delete-for-asp-net-mvc-in-iis

Go to Handler Mappings in your IIS Manager. Find ExtensionlessUrlHandler-Integrated-4.0, double click it. Click Request Restrictions… button and on Verbs tab, add both DELETE and PUT. enter image description here


EDIT: Possible WebDav Publisher issue

You’ve mention on a deleted post you were running on a 2008 server right? Try removing webDav role, or disable it from your site config: on system.webServer -> modules section, remove WebDAVModule module:

<system.webServer>
  <modules>
    <remove name="WebDAVModule" />
  </modules>
  <handlers>
    <remove name="WebDAV" />
  </handlers>
</system.webServer>
shareedit