locked
MVC Web API template's Values API error “This File does not have a Program Associated with it for Performing This Action” RRS feed

Answers

  • User283571144 posted

    Hi Taichung,

    I'm using Visual Studio 2017.  I created a new project by selecting the C#->web application -> MVC + WEB API both template boxes checked.  There are 2 default controller that comes with this template, Home and Values.  I built and ran the program and the home page display just fine.  However, when I call the values Get or Get id, I get pop up message at the bottom of the screen asking if I want open of save, I think it's referring to the json file the it's returning.

    If I select Open then I would get the error msg as described in the Subject of this question.  I googled on the web and there are like 3 different ways to fix this in Regedit.  Can someone here point me to the correct one?

    As far as I know, web api will return json or xml when you access the web api action.

    If your browser couldn't open the json file, it will download the file.

    I suggest you could firstly check the file's file extension.

    If the extension is 'json' it means json file.

    If the extension is 'xml' it means xml file.

    You could directly open the json or xml file by notepad.

    If you want to open the json file in the IE browser, you could refer to below ways.

     https://www.codeproject.com/Tips/216175/View-JSON-in-Internet-Explorer 

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 23, 2018 3:15 AM

All replies

  • User283571144 posted

    Hi Taichung,

    I'm using Visual Studio 2017.  I created a new project by selecting the C#->web application -> MVC + WEB API both template boxes checked.  There are 2 default controller that comes with this template, Home and Values.  I built and ran the program and the home page display just fine.  However, when I call the values Get or Get id, I get pop up message at the bottom of the screen asking if I want open of save, I think it's referring to the json file the it's returning.

    If I select Open then I would get the error msg as described in the Subject of this question.  I googled on the web and there are like 3 different ways to fix this in Regedit.  Can someone here point me to the correct one?

    As far as I know, web api will return json or xml when you access the web api action.

    If your browser couldn't open the json file, it will download the file.

    I suggest you could firstly check the file's file extension.

    If the extension is 'json' it means json file.

    If the extension is 'xml' it means xml file.

    You could directly open the json or xml file by notepad.

    If you want to open the json file in the IE browser, you could refer to below ways.

     https://www.codeproject.com/Tips/216175/View-JSON-in-Internet-Explorer 

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 23, 2018 3:15 AM
  • User-763603659 posted

    Thank you. You're right.  I got confused there when I switched the browser.

    Friday, February 23, 2018 11:17 PM