the web server is configured to not list the contents of this directory iis 7 - asp.net-mvc-4

When deploying my ASP MVC 4 application to IIS from my pc It worked , I tried also in my colleague pc and It's working but when I had to do it in my office computer it gives me this error "the web server is configured to not list the contents of this directory" , although there is the same configuration in the three computers : Windows 7 , iis 7 .
I've checked many question that threats this issue like this one and many others but they all recommend to enable directory browsing option in IIS , I've tried this but it's just showing my project content and what I want is to open my site .
Actually, since I'm using ASP MVC 4 , I don't have to mention a default document because in MVC 4 Its goes to controller and get from there the page to show. Do you have any idea of how to solve this ?

Just in case if anyone reached here looking for solution, here is how i resolved it. I deleted all files from my server ( bid directory ) and recopied it and but i recopied all files i missed App_global.asax.dll and App_global.asax.compiled files. Because these files were missing IIS was giving me this error
403 - Forbidden: Access is denied.
As soon as i added these files, it started working perfectly fine.

Related

Blazor .NET Core app not deploying on IIS

I'm trying to deploy a blazor app on IIS following the article below
https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-5.0&tabs=visual-studio
I've installed IIS version 10.0 using the following settings:
I then created the site and changed the application pool to No Managed Code
I created a new Blazor app and deployed it immediately without changing a thing (so I know there's not a problem with the code). Looking in the project properties it's using .NET Core 3.1
I noticed there was no web.config file when I built the Release version.
I copied the Release version to the website directory.
Browsing to the site gives me a 403.14 - Forbidden error.
I read in another article to try configuring the Mapping Handlers this was the current state of the handlers:
I added a module mapping like so:
I now get a 500 error:
The web.config file currently looks like this:
I then read to add this aspCore line to the configuration file:
After that it looks like it loads but with none of the formatting.
I assumed hosting a Blazor site on IIS would be a simple thing to do, would someone be able to point me to where I am going wrong?

Deploying Asp.net Core 3.1 does not work on Windows server

I have this Asp.net Core 3.1 developed on VS2019 preview.
basically it is a blazor server-side app with referenced assemblies and some nugets.
it runs fine on VS2019 and on my IIS after publishing to folder..
problem is when i move that folder to windows server machine with IIS installed and everything.
an error with 500 code appears.
one thing i noticed here..the log_error.txt file in the server it points out an exception
,and that exception -what ever it is- showing the error line of the startup.cs file with my laptop directory path !
i mean it shows this C:/mrmeeez/..../Startup.cs line 411
but this path does not exists in the windows server machine
it supposed to be F:/.... somthing/Startup.cs line 411
i don't know if it has something too do with the problem anyway..or maybe my assemblies and nugets not shipping correctly to the server
windows server machine is working fine , i tried blazor app template and it ran perfectly.
i need your help guys , Thanks !
Ok , i found it
i don't know for sure is this related to asp.net core 3.1
because i deployed asp.net core 2.1 months ago and it was fine
anyway i used the development exception page in the final publish to see what causing the error and showed this
UnauthorizedAccessException: Access to the path 'C:\Windows\system32\config\systemprofile\AppData\Local\ASP.NET\DataProtection-Keys' is denied.
and after searching for that i found the answer from a guy in github
it seems that the user IIS_IUSRS for this application pool -by default- does not have permissions to access that path
to solve this problem,either one of the two below:
1-Give IIS_IUSRS permissions to access the system files -NOT RECOMANDED-
2-Change the user of the your application pool to LocalSystem account in IIS by going to Application Pools -> Right-Click your app -> Advance Settings -> Process Model section then change Identity
Reference: https://github.com/dotnet/aspnetcore/issues/1983
Thanks!

Publish .NET Code application to Arvixe Host

I have a ASP.NET Core with Blazor website and I want to deploy it to Arvixe host. The website is very simple and contains only UI elements no database required. I published the website to a local file system and uploaded it using FTP to the Plesk.
When I am visiting the website, I receive this error:
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
I have tried to run it on the IIS and I received more details:
Configuration The configuration file cannot be read due to
insufficient permissions.
I tried to add IIS_IUSRS to the group and users for web.config but I am not able to find it because I am using a windows 10 connected to active directory.
Besides, I still don't know how to solve this problem at Arvixe. Does anyone know tips might help?
500 internal error is generic issue. Please kindly check the error message on the server and paste it here. Make sure that your provider has installed .net core bundled on their server and here are tutorial about publsih .net core using plesk https://windowswebhostingreview.com/how-to-publish-using-web-deploy-with-plesk-control-panel/. It should be working fine.
You need to give Full Trust permission (Read-Write-Execute) to your application folder and also to Application Pool and also check if the Runtime version supported by Arvixe matches with your Asp.net Core version.
Also enable the logs in web.config file by setting stdoutLogEnabled="true" to get detailed error so that you can investigate more about the error.

Why does JavaBridge work but JavaBridgeTemplate621 not

I am trying to install a PHP Java Bridge as per the instructions on http://php-java-bridge.sourceforge.net/pjb/index.php on Windows 7
I have PHP working fine on via IIS installed at c:\php
I copied the JavaBridge.war to c:\php which proved to get a good result from the test (running from c:\php)
java -classpath JavaBridge.war TestInstallation
I installed Tomcat 7 and copied the JavaBridge.war to webapps, which the service extract automatically and I am able to get the expected result from
http://localhost:8080/JavaBridge/
All Ok Great!
However when I do the same with the JavaBrigdeTemplate621.war, the browser
http://localhost:8080/JavaBridgeTemplate621/
returns an error
HTTP Status 500 - php.java.bridge.http.FCGIConnectException: Could not connect to server
I have not included the whole page as its very verbose, but the last root cause entry is
root cause
java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [php-cgi, -v]
php.java.bridge.Util$Process.start(Util.java:1145)
php.java.servlet.fastcgi.FCGIProcess.start(FCGIProcess.java:68)
php.java.bridge.http.NPChannelFactory.doBind(NPChannelFactory.java:94)
php.java.bridge.http.FCGIConnectionFactory.runFcgi(FCGIConnectionFactory.java:88)
php.java.bridge.http.FCGIConnectionFactory$1.run(FCGIConnectionFactory.java:109)
I've tried restarting IIS as well as Tomcat several times
What am I missing (It's Hot and it's Friday ....)
I notice that
\webapps\JavaBridgeTemplate621\WEB-INF\cgi\x86-windows
has a text file called php-cgi.exe.MISSING.README.txt
where as
\webapps\JavaBridge\WEB-INF\cgi\x86-windows
has php-cgi.exe, php5ts.dll and php.ini
Is there another manual step required to get those in there not documented in the instructions?
Not reading the instructions clearly enough. I missed that you should copy the automatically created folder (from war) into the IIS web apps folder. I was trying use Tomcat as the HTTP server instead of IIS. Once I copied them to IIS and accessed via default port 80 (not 8080) it worked fine.
Hope my conversation with myself is of benefit to someone else

ASP.NET MVC 4 on IIS 7.5, returns 404. Something to do with extensionless route mapping

I have deployed an MVC 4 web-site to a Windows 2008 R2 server with IIS 7.5. .NET 4.5 is installed on the server.
The site works fine locally. All routing works fine. However, when I put it on the server, nothing works. I have confirmed that the DNS/binding is working by putting a static text file in the site and this works.
Here's a few things I've tried:
The default route / returns 403.13 - indicating directory browsing is disabled (correct). This should surely map to /home/index?
Any route (eg. /Organisation, Organisation/Index) simply returns 404.
Made sure all my DLLs are copied over (as per http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx)
I have tried/confirmed:
HttpRedirection is installed on IIS7 (as per http://support.microsoft.com/kb/2023146)
HttpErrors is installed on IIS7
All my DLLs are in place
Am I missing something? My next act of desperation is to install the full ASP.NET MVC 4 stack including Visual Studio Express, SQL Express, etc. just to see if it works. Which I really don't want to do. This is a production server!
Update:
I should add that the same site works on en equivalent configuration in-house, on a staging server.
I had this same issue. There's a hotfix you should try:
http://support.microsoft.com/kb/980368
It fixed the issue for me.