0

I have published multiple .NET Core projects through VSTS to IIS and had no problems. However when I try to add a .NET Standard project I get a 403.14 - Forbidden error page. If I try and type in a specific route for the API to get a response it throws a 404 - Not Found error page.

I am using .NET Framework 4.6.1 which is also installed on my my IIS 8.0 server.

Is there any way to debug this issue or a way of fixing this issue?

aamb
  • 1
  • 2
  • ".NET Standard 4.6.1" you mean .Net Framework 4.6.1 – phuzi Oct 10 '17 at 15:46
  • Yes. I edited the question. Thanks – aamb Oct 10 '17 at 15:53
  • Possible duplicate of [HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory](https://stackoverflow.com/questions/18981118/http-error-403-14-forbidden-the-web-server-is-configured-to-not-list-the-con) – codeMonkey Oct 10 '17 at 16:49
  • What do you mean exactly by "add a .NET Standard project"? Is your application targeting .NET Standard, or is your application targeting .NET Framework or .NET Core and *referencing* a project or NuGet package that targets .NET Standard? – NightOwl888 Oct 10 '17 at 16:51

3 Answers3

0

You should check the Authentication the application is set to use in IIS.

If you aren't using Authentication, make sure that you have anonymous authentication enabled. You also need to make sure that the IIS user has access to the directory that your application is in.

If you want to use your domain account as authentication, then make sure Windows Authentication is turned on, and the account you are using has access to the directory your application is in. Also, make sure you are applying authentication at the action, controller, or application level in your code.

For more info, you can read the MSDN info here

MBurnham
  • 381
  • 1
  • 9
  • I double checked to make sure that Anonymous Authentication was enabled. I disabled everything that was restricting authentication in my controllers to make sure that wasn't the issue but that didn't help. I am able to access everything fine on my localhost. Thanks for your help though. – aamb Oct 10 '17 at 16:16
  • IIS is likely using a different user than you are on your localhost, does IIS have access to that directory? – MBurnham Oct 10 '17 at 16:17
  • Yes, IIS has access to that directory. – aamb Oct 10 '17 at 16:19
  • Can you provide the code for your controller and config file? – MBurnham Oct 10 '17 at 16:22
0

.NET Standard is for non-executable assemblies (class libraries) so they can be shared between different executable assemblies.

When you publish an application to IIS, you need to use an executable DLL (.NET Framework or .NET Core), which rules out using .NET Standard. You can reference .NET Standard libraries from your application, but the entry point of the application cannot be .NET Standard.

However, it isn't clear why you are only discovering this when publishing to IIS, since an ASP.NET application that targets .NET Standard shouldn't run locally, either.

NightOwl888
  • 55,572
  • 24
  • 139
  • 212
  • Then how would you publish a Web API that uses .NET Framework to IIS? – aamb Oct 10 '17 at 16:40
  • There should be no problem with that (is that what you are doing? your question seems to indicate otherwise...). – NightOwl888 Oct 10 '17 at 16:48
  • Maybe I phrased it wrong. I am trying to publish a Web Application that uses .NET Framework to IIS. One is a Web API and one is a NuGet Server. Thanks for your help. – aamb Oct 10 '17 at 16:51
0

I was pointing to the wrong location on the server. I was pointing to the bin folder when I needed to be pointing to the project folder. Thanks for the help.

aamb
  • 1
  • 2