(EDIT) - I decided to make this page more like instructions since i have figured this out.
Deploy my VS Express 2013 Web Application to an MS Server on my LAN running:
Windows Server 2008 Standard
IIS 7.0
MS SQL Express
This is some information to help anyone with a similar situation.
I can access the Web Application locally (from VS Express) when I click Debug - Start Debugging. ALSO - At this point it is connected to the MS SQL Express Server on my LAN and not a local database.
Time to publish the Web Application to my IIS 7 Server!!!
NOTE - The method below WORKS FOR ME. There might be better ways to do it but I found any info on this exact setup very limited.
VS Express 2013 Web Deploy pre-reqs:
(on IIS 7 Server)
-Web Deploy is installed, http://www.iis.net/downloads/microsoft/web-deploy
-Set Up Security on Web Deploy, this site helps:
http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy
In Project:
Right Click your project name, choose PUBLISH...
PROFILE - Name or import your profile
CONNECTION
-Server: LAN address of your IIS server
-Site Name: Name of Site on IIS
-User/Pass: (Credentials you set up earlier in Prerequisites)
-Destination URL: (I leave blank for now)
SETTINGS - Click the arrow below FILE PUBLISH OPTIONS and check the 'Exclude App Data' setting (this is assuming you are running MS SQL on the IIS Server).
Select your Database string, it should be in the drop down list)
PREVIEW - Web Deploy will give you errors when you try to PREVIEW, resolve these errors using MS Websties, Stack Overflow, etc. **WHEN YOU GET THIS ERROR: "#ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH" (full Error message below), your Web Deployment is ready
PUBLISH the web deployment, it wont work, thats okay. It creates a publish profile
Right-click the project and choose PUBLISH again, this time use under the CONNECTION tab choose WEB DEPLOYMENT PACKAGE, take note of your folder location (Step 8). All the database/file settings should be the same (doublecheck if you like), PUBLISH the Web Deployment package
Log onto your IIS Administration (on the Server), right click the NAME of the Server (top level) and choose DEPLOY - IMPORT SITE. Navigate to the folder where you saved the package in step 7. (or transfer it with a USB Stick, etc)
IMPORTANT - When importing the profile, at the second screen, UNCHECK the boxes related to .NET 32-Bit etc. (there are two of them)
Leave everything else on defaults and import the site (successfully?).
At this point when I browse the site from IIS I get a 403 Forbidden Error.
I fixed this using code from comment below:
After that my Web App was from the IIS Server. I'm continuing with MVC tutorials found here:
http://www.asp.net/mvc/tutorials/mvc-5
I'm hoping once I understand enough about MVC and EF6 I can connect the Web App to MySQL rather than MS SQL and still build Code First Applications. If anyone has info on that please post it in the comments.
If this post helped you please Vote up top, I'm new to the STACK.
**Full Error Message from post above:
Web deployment task failed. (The versions of the .NET Framework Configuration Provider (rootWebConfig32) are different on the source (4.0) and destination (2.0). Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH.)
I think your issue might be permissions. What is your authentication set to? In debug mode, you're typically working as yourself, whereas if you deploy, you are setup as a different user, most likely anonymous. With that in mind, you should be able to correct your problem.
Good luck!
It was a combination of things. I finally got it working.
I created a Deployment package following instructions found on MS site and others.
Before Publishing my deployment package, I ran a "Preview" (PREVIEW section of the wizard). This was bringing up various errors related to Security and other issues I fixed using MS support sites.
WHAT I FOUND ON MY OWN - (Its fairly simple), after you create the Deployment package without issue, go to IIS on the Server side, click the Server Name in IIS (top level) and choose Deploy - Import Package. In the second or thu=ird step there is a screen where you select items to be imoported (mine had everything checked). I UNCHECKED the two related to .NET Config files and imported it. Voila, it worked.
It still wasn't letting me view the site. I had to add this line to the web.config file and it fixed everything.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
If anyone wants a mored etailed description of what I did let me know and I will try and redo my process/tutorial with more exact instructions.
to get the same publish behaviors with direct publish from VS, you can uncheck following box : properties\Package/PublishWeb\include IIS express settings as configured in ISS express
Related
All,
I am migrating a working .Net Framework Website from IIS 8.5 on a Microsoft Windows Server 2012 to IIS 10 on a Microsoft Windows Server 2019.
The new web site is showing the error
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
As far as I can see the website on the new server is configured the same as on the existing.
Neither have directory Browsing enabled nor a default file set as is recommended by most of the posts which exist discussing this error.
I have run the following which is also recommended.
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
The problem still exists.
I came across a post saying there might be an issue if paths referenced in the web.config are not correct but they look fine.
Has anyone got any insight into what else might cause this issue?
Are there any differences between IIS 8.5 and IIS 10 or between windows servers 2012 and 2019 which might cause this issue?
Thanks
This problem occurs because the website doesn't have the Directory Browsing feature enabled. Also, the default document isn't configured. To resolve this problem, use one of the following methods:
Method 1: Enable the Directory Browsing feature in IIS
To resolve this problem, follow these steps:
Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
In the Features view, double-click Directory Browsing.
In the Actions pane, select Enable.
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do it, select Start, select Run, type inetmgr.exe, and then select OK.
In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change.
In the Features view, double-click Default Document.
In the Actions pane, select Enable.
In the File Name box, type the name of the default document, and then select OK.
More information you can refer to this link: HTTP Error 403.14 - Forbidden when you open an IIS webpage.
All those clowns glibly posting that "HTTP Error 403.14 - Forbidden: The Web server is configured to not list the contents of this directory" can be fixed by configuring the web site by either enabling the Directory Browsing feature or adding a default document are really not understanding what they are talking about. Anyone can copy a solution from one post and paste to another.
I'm not going to pretend I know what I am talking about but I have fixed my issue and will share what I did here to see in the hope it helps others.
I created a project (of the same type as the application I was trying to deploy) using my IDE (MSVS) in the same .Net version of the application I was trying to deploy. In this case it was creation of an MVC project in .Net Framework 4.5.
I did nothing to it. All I wanted was a skeleton.
I replaced all the files in the home directory of the web site I had an issue with, with the files of this skeleton project.
I attempted to browse to the web site and it worked successfully. Note the directory browsing was not enabled nor was a default directory set.
This proved to me that those settings were irrelevant.
Having googled around, some sites point to paths in config files causing an issue if they do not exist, eg a logging path to d:\logs where that directory was missing. It didn't fix my issue but there's no harm checking.
I stumbled across a post which talked about the roles and features enabled on the server. In Web Server (IIS)/Web Server/Application Development they had selected "Application Initialisation" and "ASP".
The Windows Sever 2012 server I was moving the application from, where it work without a hitch, did not have those selected so had not selected them on the Windows Server 2019 I was moving them to when I set that server up.
It made no sense that this would be the solution but having tried everything else I activated those two options.
Stone me if the issue was resolved.
As a check I removed those two options and the problem came back and when I reselected them it went away again.
This struck me as pretty conclusive only having thought I'd found the cause of the problem I built the website from scratch and the problem came back again.
It took a number of iterations but eventually I got there, more by luck than judgement and whatever the cause was it was due to an issue in the application which wasn't being logged in event viewer so focus on permissions to files being written to: not only that the app pool account is set up on the directories it needs access to but also that it has modify or even full control.
All those muppets robotically posting advice on configuring the web site by either enabling the Directory Browsing feature or adding a default document will no doubt copy this and paste it into their posts to claim the credit but c'est la vie.
I hope this post is of use to someone, apart from those muppets.
I'm deploying a new Umbraco 6 installation to Azure, and I've run into a problem I can't seem to diagnose.
Here are the steps I took to get the site deployed:
Created new MVC 4 project in VS2012
Installed UmbracoCms 6.0.0 via NuGet
Tested locally: SUCCESS
Set up correct connection string for Azure in Web.config (via transform)
Deployed to Azure using Web Deploy
Unfortunately, when I navigated to the Azure instance, I get a blank page with "The service is unavailable." I enabled detailed logging in Azure, and looked at the log files. There wasn't much that suggested a solution to me. This is what the detailed error says:
Module: UmbracoModule
Notification: ResolveRequestCache
Handler: PageHandlerFactory-Integrated-4.0
Error Code: 0x00000000
I'm out of ideas at this point...any ideas?
I've just gone through the steps of what you describe. I created a MVC4 project and downloaded Umbraco 6 via Nuget. What I did notice was that I had to 'include' a fair number of file into the project structure in the VS solution explorer.
I ran the website locally and ran an install just using SQL CE.
I created a website on Azure and I downloaded the .PublishSettings file and imported this into the Web Deploy options in VS. I then published the site 'as is' just to see what happened. I didn't expect the database to work but I just wanted to make sure that the application ran ok and I could at least access the Umbraco login screen.
When I accessed the site, it worked as expected and I could access the login screen at /umbraco/
Given the problems you are having, although this sounds simple, did you 'include' all the files in the solution explorer before deploying?
If you are still having issues, I would doing what I have done and just setting up another very simple site to test your deployment process. I have to be honest, I was surprised how easy it is.
I've just been through the same steps with the simple blog and it was quite hard. I didn't include anything into Visual Studio (except it's 2010 and I downloaded the publish profile) and the site ran fine locally.
On uploading Umbraco 6 to azure I got 'Could not load file or assembly MySql.Data, ' etc. .net error. Of course, it was there.
On repeating my deployment steps, swapping between Visual Studio, Web Matrix and Sql Azure Migration Wizard, checking it was release config on build etc. (not that it should need building) I got various 'The page cannot be displayed because an internal server error has occurred' on a blank white screen, and 'Could not load My.Sql' errors.
Coming back to it the next day, I deployed again, and my user had lost its role membership in the database. I ran the EXEC sp_addrolemembers again, and lo, the site now works. I wish I could be more specific on what went wrong and what got fixed, but it's all a bit voodoo.
I second what Digby said - make sure all your includes are, well, included and keep on deploying. I think azure is having a bit of a do lately, there was an outage last week on 23rd Feb.
I have seen many posts here and elsewhere regarding this error. In every case the solution is to either uninstall any 32-bit office components, or to change the target platform of the .NET project that's trying to access the driver to x86 instead of Any CPU. Neither of those solutions worked for me.
Here are the details. I have two ASP.NET sites on the same server running Windows Server 2008. One is a production site and the other is a staging site. I am trying to generate an Excel file via OLEDB. The production site produces the file with no problem. The staging site throws this error. Both sites are identical except for the host headers and the SQL Server database they connect to. The target framework for both is 4.5 and the App Pool is set to use 4.0.
Has anyone else come had this problem?
Turned out to be an IIS7 configuration problem. Each site had its own App Pool. On the advanced settings dialog, under (General), there is an attribute named Enable 32-Bit Applications. This attribute was set to True on the stage site. Changing it to False resolved the issue.
I'm in the process of setting up a new machine as a development environment and I'm having issues getting an existing code base that hosts a Silverlight application to work. The code runs fine on all other machines that my team uses.
Here is the error:
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
I have had a Google around for some answers on this and I realize there is a duplicate question on StackOverflow already, but it does not provide enough information and the answers have not worked for me.
I am attempting to run the solution through Visual Studio 2010 Ultimate, using IIS Express 7.5 integration (as opposed to the Cassini web server). This approach works perfectly fine on all other machines, except for this one.
I have found that if I specify to use full IIS integration (instead of Express) and select the SilverlightTestPage.aspx as the start up page, then the application runs (although not perfectly). Also, if I publish the application and host it on IIS, it again works fine. However, when running through Cassini or IIS Express 7.5 integration, or when trying to get it to run through the Default.aspx or correct start up page it does not work.
Does anyone have any ideas what this might be? I've already checked that the MIME type in IIS is correct (not sure if I can do this in IIS Express as well?) and that the XAP files are building into the correct directory.
Check MIME types in IIS Express configuration file %userprofile%\documents\iisexpress\config\applicationhost.config and make sure that you have MIME types set correctly and restart IIS Express.
Please check the aspx file whether it has the "minRuntimeVersion" correctly for the Silverlight plug in.
<param name="minRuntimeVersion" value="4.0.50826.0"/>
also check the following link for hosting the Silverlight application .
Configuring IIS for silverlight
I've a site that I'd like to publish to a co-located live server. I'm finding this simple task quite hard.
My problems begin with the Web Deploy tool (1.1) giving me a 401 Unauthorized as the adminstrator because port :8172 comes up in the errors and this port is blocked - but the documentation says "The default ListenURL is http://+:80/MsDeployAgentService"!
I'm loathe to open another port and I've little patience these days so I thought bu66er it, I'll create a Web Deploy package and import it into IIS on the server over RDP.
I notice first that Visual Studio doesn't use a dialog box to gather settings, or use my Publish profiles but seems to use a tab in the project properties, although I think these are ignored when importing the package anyway?
I'm now sitting in the import wizard with Application Path and Connection String. I've cleared the conn string as I think this is for some ASP stuff I don't use but when I enter nothing in the Application Path, the wizard barks at me saying that basically I'm a weirdo because most people publish to folders beneath the root site.
Now, I want my site to be site.com/Home/About and not site.com/subfolder/Home/About and I think being an MVC routed site that a subfolder will introduce other headaches. Should I go ahead and use the root?
Finally, I also want to publish a web service to www.site.com/services/soap which I think IIS can handle.
While typing this question, Amazon have delivered my IIS 7 Resource Kit, and I've been scouring the internet but actually I'm getting more confused.
Comment here seems to show consensus opinion that Publish isn't for production sites and that real men roll their own.
ASP.NET website 'Publish' vs Web Deployment Project
...I guess this was pre- Web Deployment Tool era?
I'm going to experiment on a spare box for now but any assistance is welcome.
Luke
UPDATE
The site was imported (to the root) manually with Web Deploy and it worked. If you get the error "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' " its because your app pool is 4.0 and should be 2.0.
If you are using VS 2010, may I recommend Scott Hanselman's Web Debloyment Made Awesome?
http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx
Even if you are using VS2008, there are nice concepts there that will probably help.
I've experienced the same frustration and trouble with this as well. Coming from a Java web background where we can package everything as a single WAR and toss it on the server, the deployment process with ASP.NET seems archaic.
I currently have a python script that uses FTP to transfer the needed files to my test instance on the remote server. I have another python script that transfers those files to my live site. These scripts are smart enough to take care of differences between some of the configuration files etc..
I've found it much easier than trying to setup permissions or using the Microsoft deploy tools.
Hi you can use filezilla software to upload