3

Windows Server 2012 R2, IIS, VS2013 I have implement a ASP.NET web api, when I debug in VS2013, it can open IE, and I can call my web api correctly. http://localhost:42508/api/log/111

I have use "publish" in VS2013, and deploy all files to D:\api_publish.

Now, I set up IIS, and under "Default Web Site", I add a application "serverapi". Now I set "physical path" to D:\api_publish\bin (where serverapi.dll is at). then I use below URL to access API, http://192.168.1.100/serverapi/api/log/111

But it return 404 - File or directory not found.

UPDATE:

After I set "Default Web Site" to another folder path, and set Application "physical path" to D:\api_publish\, Now when I access http://192.168.1.100/serverapi/api/log/111, it will return HTTP 500 error.

12
  • What are the settings on the application pool? Have you set it to use .Net 4? Commented Jun 8, 2015 at 8:57
  • Your URL looks incorrect. Commented Jun 8, 2015 at 8:57
  • 3
    Also, the physical path should probably be a level above the bin folder. Commented Jun 8, 2015 at 8:57
  • 1
    As my "Default Web Site" is already point to D:\api_publish, if I set application serverapi to D:\api_publish, it will conflict. so What should I do? Commented Jun 8, 2015 at 9:03
  • Point the default website to somewhere else! Commented Jun 8, 2015 at 9:03

2 Answers 2

4

There are a couple of issues that I can see here.

  1. The physical path should be set to D:\api_publish and not in the bin folder.
  2. Check the application pool is set to use .NET CLR Version v4.

As you mentioned in the comments, the default website already points to the same physical folder. You can either:

  1. Move the default website to another path.
  2. Use the default website instead of the serverapi one you created.
Sign up to request clarification or add additional context in comments.

Comments

0

You should use D:\api_publish as physical path. Bin folder can not be used for that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.