I've got a .Net 4 ASP.Net application developed with VS 2012. I'm publishing the app with a publish profile set to create a Web Deploy Package, which I'll be copying over and creating on a Win2008 IIS7.3 server.
When I run the deployment script, server-side, with a "/Y" parameter, it appears to work correctly.
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-source:package='C:\ReconTool\test\deploy\ReconTool.Presentation.Web.zip"
-dest:auto,includeAcls="False" -verb:sync -disableLink:AppPoolExtension
-disableLink:ContentExtension -disableLink:CertificateExtension
-setParamFile:"C:\ReconTool\test\deploy\ReconTool.Presentation.Web.SetParameters.xml"
Info: Adding sitemanifest (sitemanifest).
Info: Creating application (Default Web Site/ReconToolTest)
Info: Adding virtual path (Default Web Site/ReconToolTest)
...
But the new web site doesn't run for me - I get an 403.18 - forbidden error. When I look in inetmgr on the server for the new app, I only see the 'IIS' config section, where applications I've created manually have an 'ASP.Net' and the 'IIS' config sections.
It appears like it's not creating a full application, there are no error pages, etc, that are configured in the ASP.Net section. Wierd thing is I see the new app via appcmd as an application:
APP "Default Web Site/" (applicationPool:DefaultAppPool)
APP "Default Web Site/ReconToolDev" (applicationPool:ReconToolDevPool)
APP "Default Web Site/ReconToolTest" (applicationPool:ReconToolTestPool )
Both the Dev and Test application pools appear to be exactly the same, from what I can tell. The web.config in my Dev and Test applications are identical.
I'd appreciate any advice on additional steps I need to deploy an Visual Studio project and get it to config as an application in IIS.
Corey.
Related
I'm trying to deploy an ASP.NET Core Web API into an IIS site in windows 2012 server, I've installed IIS from 0 and when I deploy the app and test a petition with Postman I get the 500.32 error.
I've already installed the .NET Core hosting bundle v 6.0.14 also I've configured the application pool to no managed code and I restarted all the services including the IIS.
Restarted the server isn't an option because I can't get physical access to the server, I'm working from a remote location
This is my dotnet --info
I'm trying to deploy an ASP.NET Core 6 Web API.
I've already done:
Compile and publish the API
Installed the is
Create a site and application to deploy the API
Paste the files from the publish folder to the site folder
Installed the netcore hosting bundle
The problem was in the compilation and publish process.
i had to add the check for Ready to run in the publish configurations, i put that and solved the issue
I am trying to publish a ASP.NET Core Web project to IIS (remote server) using a non-admin account using Visual Studio 2017 and I have the following error on deploy:
Starting Web deployment task from source:
manifest(D:\Projects\Own\AspNetCore\CoreWithAngularTrial\CoreWithAngularTrialApi\obj\Debug\netcoreapp1.1\PubTmp\CoreWithAngularTrialApi.SourceManifest.xml)
to Destination: auto(). C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(134,5):
Error : Web deployment task failed. (Connected to the remote computer
("...") using the Web Management Service, but could
not authorize. Make sure that you are using the correct user name and
password, that the site you are connecting to exists, and that the
credentials represent a user who has permissions to access the site.
Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
Make sure the site name, user name, and password are correct. If the
issue is not resolved, please contact your local or server
administrator. Error details: Connected to the remote computer
("...") using the Web Management Service, but could
not authorize. Make sure that you are using the correct user name and
password, that the site you are connecting to exists, and that the
credentials represent a user who has permissions to access the site.
Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
The remote server returned an error: (401) Unauthorized. Publish
failed to deploy.
I have the following configuration for deployment:
Publish method = Web deploy
Server = servername:8172/msdeploy.axd
Site name = Default Web Site/CoreWithAngularTestApi
User name = username
Password = ******
The exact same configuration works when publishing a different application (ASP.NET MVC 5) under the same Web site (Default Web Site), so publishing configuration appears to be correct on the remote server.
Making username a local administrator unblocks the publishing process in Visual Studio 2017.
Also, publishing configuration files (*.pubxml) are virtually identical.
Event viewer on remote server catches the following error:
IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED
Only Windows Administrators are allowed to connect using a server
connection. Other users should use the 'Connect To Site or
Application' task to be able to connect.
Process:WMSvc User=username
Question: How can I enabled non-administration web publishing from Visual Studio 2017?
This issue has been fixed: https://github.com/aspnet/websdk/issues/146.
ASP.NET core project uses a different set of Publish targets (hence the change in behavior from MVC5). This project is available on GitHub - https://github.com/aspnet/websdk.
I managed to figure out why the publish fails with non-admin user. Server setup is correct, but Visual Studio publishing seems to treat ASP.NET Core Web app deployment differently from ASP.NET MVC 5 one.
I had to explicitly specify web site name within the publishing profile xml file. So, instead of:
<MSDeployServiceURL>servername:8172/msdeploy.axd</MSDeployServiceURL>
I put
<MSDeployServiceURL>servername:8172/msdeploy.axd?Site=Default Web Site</MSDeployServiceURL>
NOTE: This problem does not occur when publishing an MVC 5 project within VS2017.
I have a question as to how the Visual Studio 2013 debug emulator for Web API works.
I had built a Web API project in Visual Studio 2013 to access a database on an external server. The code was built using VS2013's ASP.NET Web Application project template for a Web API application. Once built, running debug opened a browser window for localhost port 56618, which allowed access from Fiddler to test Http requests.
Once I had the project finished, I published it to a website using Web Deploy to IIS. However, whilst the page would open (now at localhost:9812), an http request would throw an Internal Server Error 500.
Perusing the IIS FailedReqLogFiles, I noticed that the reason that it was failing was that the database server was refusing access to '<Domain>\<machine-name>$'.
I added '<Domain>\<machine-name>$' as a valid login (windows authentication, as the connection string included "Integrated Security=true") on the sql instance with read and write privileges, and the problem was resolved.
The question is, why didn't the Visual Studio debug emulator have the same issue?
Because the emulator was running the website under the context of your own account (e.g. <Domain>\You). Your account had access to the database, so there was no issue.
When you published it to IIS, it started running under the context of a different account (<Domain>\Machine-Name - but there are other variants depending on how IIS is configured, and the version of IIS), which didn't have access to your database.
I have a sub application underneath an IIS website, and I can deploy it using the publish wizard in Visual Studio no problem.
However, I'm automating our deployment from our build server so I prefer to use msdeploy.exe directly.
I can deploy the main website, but trying to deploy the sub application refuses to work.
This works (www.mymainwebsite.co.uk being the IIS website):
msdeploy.exe
-source:package='www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.zip'
-dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk',userName='xxx',password='xxx',authtype='Basic',includeAcls='False'
-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.SetParameters.xml"
-allowUntrustedInfo
This doesn't (SubApplication being the application path):
msdeploy.exe
-source:package='SubApplication\obj\Test\Package\SubApplication.zip'
-dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk/SubApplication',userName='xxx',password='xxx',authtype='Basic',includeAcls='False'
-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"SubApplication\obj\Test\Package\SubApplication.SetParameters.xml"
-allowUntrustedInfo
The error is:
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("testweb1") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
Error: The remote server returned an error: (401) Unauthorized.
As I said, this works from the Visual Studio publish wizard, setting the Site/application property to www.mymainwebsite.co.uk/SubApplication, so I know it's not a permissions issue on the server.
Am I missing something in the msdeploy parameters?
I use the following on the command line to set the web application:
-setParam:name="IIS Web Application Name",value="www.mymainwebsite.co.uk/SubApplication"
In order to do a web deployment to sub-application of a main site, go to TFS, Deploy IIS App step, update the Override parameters to something like this
name="IIS Web Application Name",value="MainSite/SubApplication"
It should do the trick!!
I have published a asp.net web app in ISV folder in CRM. and i am accessing this web app in IFrame. its working fine in online mode , but when i goes to offline mode it gives me error Server Error in '/' Application HTTP Error 404 - Not Found Version Information: Cassini Web Server 4.0.0.0 '. I wanna know how to make this web app working in offline mode?
Thanks in advance.
It looks like you haven't provisioned your web-application to the client. When the client is online, it shows only the pages which are deployed to the ISV directory.
In order to get them working offline, you have to manually deploy them to each clients local ISV directory. There is no automatic deployment.