I am working on VS 2015. I need to deploy my C# web project into IIS 7. The problem is, I have all my pages in sub-folders (Segregated). Now, I need to take the default page from a sub folder. I do not have any web.config files in the sub-folders. Please
help me by telling me how to do it. My process for deployment is:
1. Publish the project in release mode.
2. Open IIS 7, Click Add website by right clicking Sites,
3. choose the site name, Give apppool for .Net 4.0 version
4. Provide physical path as the Published code folder.
5. Choose an IP address and Port.
6. A site will be added in the IIS. Now, goto default document in IIS
7. Provide the name as ~/Reports/DailyReport.aspx
If I follow this process, I get the error: "A default document is not selected." Please tell me how I can configure the default document in the above process or in the web.config file. Please give me a step by step process to do this.
Sorry for late reply. Unfortunately, Both the methods return error for me. Also, If possible, Please give me a solution if I publish the project and then host the published files. The Error message I have is:
Error Summary
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Detailed Error Information
I have tried that as well. Then I get the following error.:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 27: <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
Line 28: </httpHandlers>
Line 29: <compilation targetFramework="4.5" debug="true">
Line 30: <assemblies>
Line 31: <add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4253; ASP.NET Version:2.0.50727.4257
I have deployed another project on same machine by publishing the files but not by copying the whole project. I did not get this error then. It was a smooth publish. I have changed the app pool to version 4.0 but still I get this issue. Please help me in
this.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4253; ASP.NET Version:2.0.50727.4257
I have deployed another project on same machine by publishing the files but not by copying the whole project. I did not get this error then. It was a smooth publish. I have changed the app pool to version 4.0 but still I get this issue. Please help me in
this.
If your application doesn't use any new 4.5 features, you could just change your application to target .NET 4.0. This will allow it to run on a .NET 4 server. If you do use some new features that are only available in 4.5, you need to install 4.5
on the server.
Anyway the point is not to enable directory browsing if you don't want it. My understanding is rather that you want to define a default document name for some folders ?
According to the error message you shown it seems to use .NET 2.0.50727.4253. To start with :
- make sure you are using a 4.0 application pool ?
Which .NET version is targeted by your project and which one is available on the server? For now I suspect that to start with you are trying to install an application that targets a .NET Framework version which is maybe not available on this server ?
Once fixed and make sure first that your web app works, then see for fixing this default document issue.
Likely too late now but my personal preference is to keep things simple so I' just name my page default.aspx if I want it to be the default page and then I'm no additional configuration to do because I wanted mypage.aspx to be used as a default...
My Project is targeted to .NET 4.5 and the server has .NET 4.0 APP pool. I have used 4.0 app pool for this project and another project in my machine as well. I have used it before while deploying another application. This is the same server I have used before.
The latest message shows Microsoft .NET Framework Version:2.0.50727.4253; at the bottom. This is why I strongly suspect some kind of version related configuration issue. Double check the app pool is properly configured and that it has been
restarted since you changed that...
Also we are now quite far from your initial post. Try to solve the current problem, and close the thread to start a new one if you then start trying to solve an entirely different problem.
Member
168 Points
497 Posts
Need deployment method to make the aspx page in subfolder as default page
Apr 17, 2017 06:47 AM|acmedeepak|LINK
I am working on VS 2015. I need to deploy my C# web project into IIS 7. The problem is, I have all my pages in sub-folders (Segregated). Now, I need to take the default page from a sub folder. I do not have any web.config files in the sub-folders. Please help me by telling me how to do it. My process for deployment is:
1. Publish the project in release mode.
2. Open IIS 7, Click Add website by right clicking Sites,
3. choose the site name, Give apppool for .Net 4.0 version
4. Provide physical path as the Published code folder.
5. Choose an IP address and Port.
6. A site will be added in the IIS. Now, goto default document in IIS
7. Provide the name as ~/Reports/DailyReport.aspx
If I follow this process, I get the error: "A default document is not selected." Please tell me how I can configure the default document in the above process or in the web.config file. Please give me a step by step process to do this.
Thanks,
Deepak
All-Star
17652 Points
3510 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 18, 2017 04:24 AM|Chris Zhao|LINK
Hi Deepak,
Test project with default page
Follow these steps to add default document
1. Right click Sites -> Add WebSite
2. Right click MySite -> Add Application
3. Add Default Document
or add following in web.config
MySite
Best Regards,
Chris
Member
168 Points
497 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 25, 2017 10:17 AM|acmedeepak|LINK
Hi Chris,
Sorry for late reply. Unfortunately, Both the methods return error for me. Also, If possible, Please give me a solution if I publish the project and then host the published files. The Error message I have is:
Error Summary
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Detailed Error Information
Module
DirectoryListingModule
Notification
ExecuteRequestHandler
Handler
StaticFile
Error Code
0x00000000
Requested URL
http://192.168.108.26:8011/
Physical Path
D:\Sample
Logon Method
Anonymous
Logon User
Anonymous
Most likely causes:•A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
I get the same error with default page in web.config or in the IIS. Please help me in this.
Thanks,
Deepak
All-Star
17652 Points
3510 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 26, 2017 02:04 AM|Chris Zhao|LINK
Hi Deepak,
Follow these steps to enable Directory Browsing.
1. Select Your Site, double click Directory Browsing.
2. Enable Directory Browsing.
Best Regards,
Chris
Member
168 Points
497 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 26, 2017 05:37 AM|acmedeepak|LINK
Thanks Chris,
I have tried that as well. Then I get the following error.:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 27: <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
Line 28: </httpHandlers>
Line 29: <compilation targetFramework="4.5" debug="true">
Line 30: <assemblies>
Line 31: <add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
Source File: D:\Sample\baystateflowers_inventorycosting\baystateflowers_inventorycosting\web.config Line: 29
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4253; ASP.NET Version:2.0.50727.4257
I have deployed another project on same machine by publishing the files but not by copying the whole project. I did not get this error then. It was a smooth publish. I have changed the app pool to version 4.0 but still I get this issue. Please help me in this.
Thanks,
Deepak
All-Star
17652 Points
3510 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 26, 2017 06:20 AM|Chris Zhao|LINK
Hi Deepak,
If your application doesn't use any new 4.5 features, you could just change your application to target .NET 4.0. This will allow it to run on a .NET 4 server. If you do use some new features that are only available in 4.5, you need to install 4.5 on the server.
Installing the .NET Framework
https://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx
Best Regards,
Chris
All-Star
48570 Points
18081 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 26, 2017 05:26 PM|PatriceSc|LINK
Anyway the point is not to enable directory browsing if you don't want it. My understanding is rather that you want to define a default document name for some folders ?
According to the error message you shown it seems to use .NET 2.0.50727.4253. To start with :
- make sure you are using a 4.0 application pool ?
Which .NET version is targeted by your project and which one is available on the server? For now I suspect that to start with you are trying to install an application that targets a .NET Framework version which is maybe not available on this server ?
Once fixed and make sure first that your web app works, then see for fixing this default document issue.
Likely too late now but my personal preference is to keep things simple so I' just name my page default.aspx if I want it to be the default page and then I'm no additional configuration to do because I wanted mypage.aspx to be used as a default...
Member
168 Points
497 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 27, 2017 05:41 AM|acmedeepak|LINK
Thanks Patrice,
My Project is targeted to .NET 4.5 and the server has .NET 4.0 APP pool. I have used 4.0 app pool for this project and another project in my machine as well. I have used it before while deploying another application. This is the same server I have used before.
Thanks,
Deepak
All-Star
48570 Points
18081 Posts
Re: Need deployment method to make the aspx page in subfolder as default page
Apr 27, 2017 08:31 AM|PatriceSc|LINK
The latest message shows Microsoft .NET Framework Version:2.0.50727.4253; at the bottom. This is why I strongly suspect some kind of version related configuration issue. Double check the app pool is properly configured and that it has been restarted since you changed that...
Also we are now quite far from your initial post. Try to solve the current problem, and close the thread to start a new one if you then start trying to solve an entirely different problem.