In my development machine I can successfully deploy from Visual Studio 2015 to IIS 8.5 installed on Windows Server 2012 on my local network.
msbuild projectname.csproj
/p:VisualStudioVersion=14.0
/p:DeployOnBuild=true
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=https://myserver:8172/msdeploy.axd
/p:AllowUntrustedCertificate=True
/p:DeployIisAppPath=projectname
/p:Username=tc
/p:Password=pass
On my Windows Server I have installed msbuild, webdeploy and webdeploy for hosting services.
However, running the same command results in:
0 errors
1 warning (...Conflicts between different versions of the same dependent assembly...)
Build succeeded
And it doesn’t continue to deploy, no errors , no messages.
Do I have to resolve the warning message for msbuild to deploy or am I missing something else?
Thank you Microsoft for such a great verbose mode of this tool that says absolutely nothing when I tell it to deploy!!!
The solutions is here:MSBuild not triggering WebDeploy
It requires both folders to be present on the server:
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications
C:\ProgramFiles (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web
I was missing the second one (facepalm).
Related
Here are the technologies used in my work environment:
-Node JS version 8.10.0 win x64
-Visual Studio 2015 Community Update 3
-iisnode v0.22.1 x64
-IIS Express
When I installed iisnode, the iisnode configuration was located here:
C:\Program Files\iisnode\www\configuration\web.config
Within C:\Program Files\iisnode\www , there are directories ( one directory for each node application )
I created an ASP.NET MVC solution in Visual Studio.
Now when I run the aforementioned ASP.NET MVC solution in Visual Studio, the IISExpress will properly deploy and run the solution.
However, how can I configure IISExpress to run the iisnode that was installed? What steps do I have to take to make IISExpress to run the iisnode when IISExpress is run from Visual Studio?
The documentation says
Installing for IIS 7.x/8.x
* Install iisnode for IIS 7.x/8.x: x86 or x64 - choose bitness matching your system
* To set up samples, from the administrative command prompt call %programfiles%\iisnode\setupsamples.bat
* Go to http://localhost/node
Installing for IIS Express/WebMatrix
* Install WebMatrix using the Web Platform Installer
* Open WebMatrix, choose “Site from folder”, enter %localappdata%\iisnode\www, start the site, and play with the iisnode
samples, or
* Use node.js templates to get started quickly with an Express application or a skeleton Hello World
But WebMatrix is already end of life. So you need to manually create a site on IIS Express instead (or use a tool like Jexus Manager).
There does not seem to be any Visual Studio integration mentioned though.
I have just setup up IIS 10 on a clean Server 2016 hosted server, and installed the following packages that I have gleaned should be on the machine to allow IIS to host ASP.NET Core applications:
aspnetcore-runtime-2.1.0-win-x64.exe
dotnet-hosting-2.1.0-win.exe
dotnet-runtime-2.1.0-win-x64.exe
I have installed my app straight into the Default Web Site and replaced all files in C:\inetpub\wwwroot\ with my app files. I also did assign the web site an app pool with no managed code, so that isn't my problem.
Last time my app was built with 2.0, and I installed the latest versions of the above packages, which I'm sure was 2.0, and the only error I had was that the command dotnet that IIS uses to invoke Kestrel to run the site, was not in the PATH env. variable
Now when I try and browse to localhost on the Server 2016 machine, it gives me the following error, found in the Windows event log:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical
root 'C:\inetpub\wwwroot\' failed to start process with commandline
'dotnet .\QuickDrive.Mvc.dll', ErrorCode = '0x80004005 : 8000808c.
Initially I tried with the same build as before, which was 2.0, and when I got this error, I rebuilt the app to target 2.1. Nearly every search result and relevant SO answer I can find suggest a version conflict, but now there should at least be no version conflict between the runtime and hosting package on the server. Maybe there are other version conflicts I am not aware of though?
At very least I'm asking for some advice on how to get more detailed diagnostic information, even if I don't get an answer that tells me straight what config options and versions to check on Windows and on IIS.
You have to install the Core SDK for whatever version you want to target in Visual Studio. Installing the runtime alone won't do the trick. You may have the restart Visual Studio afterward to see it in the list.
Here is a link to the SDK 2.1 download (the latest as of this writing).
I solved the problem by running dotnet myWesite.dll in PowerShell, and first I found that dotnet.exe was not in the PATH environment variable, and after fixing that, running dotnet myWesite.dll again gave me a meaningful error message that an assembly was missing because it had not been included when I published the website.
I faced the same error on the dev machine in IIS Express. MVC App stopped working all of the sudden. Eventlog gave the 0x80004005 error code.
After trying multiple suggestions, the solution to debug the wired error code was to run the app in the console:
[Project bin folder]> dotnet [projectname].dll
It appeared that during the NuGet package update, the dotnet core version was accidentally updated to 2.1.4 where as the installed version was 2.1.3
[could be a bug in Nuget manager as the update was from there]
I edited the project file to reference the available version (2.1.3) and the app started to work properly.
I'm trying to publish the template project "ASP.NET Core Web Application (.NET Framework)" from Visual Studio 2015 to IIS.
I use the Visual Studio publish to File System feature.
I'm using Windows 10.
I followed the guide from here.
I set up a website in IIS and changed the Application Pool .NET CLR Version to No Managed Code
I instaled the .NET Core Windows Server Hosting bundle
I restarted my machine.
I get this error:
I added a logs folder, but no logs get created.
Any ideas on how I can solve this?
EDIT:
Output of running the .exe from powershell:
PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe
Hosting environment: Production
Content root path: C:\TestCoreWebsite
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Then I navigate to http://localhost:5000 and the sample site works.
Found the solution:
In the root web.config change:
processPath="%LAUNCHER_PATH%"
to:
processPath=".\Web_CoreWebNetFramework.exe"
I ran the following command in cmd
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
on the command prompt, which gave me a much more meaningful error:
"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was
not found. - Check application dependencies and target a framework
version installed at: C:\Program
Files\dotnet\shared\Microsoft.NETCore.App - The following versions are
installed: 1.0.0 - Alternatively, install the framework version
'1.0.1'.
I Installed the correct net core and the project worked correctly
With VisualStudio 2017, open up the .csproj file and add to the first block:
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
Usually the result will be:
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
For whoever faces the same issue as mine(running well in VS but got above issue when deploying into Local IIS), I missed Setting Environment Variable and It works after I added the Setting Environment Variable
Ref: How to add Setting Environment Variable in IIS
I read through many of the posts on here and never found a clear answer that worked. So after spending the time getting this to work, I figured I should post it.
Problem: The publishing profile would build on the server, but would not publish.
Solution:
Make sure you installed Microsoft Windows SDK and .Net Framework 4
From your client machine with Visual Studio 2012 update 2 installed, copy:
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\
To the same location on your server.
Then make a simple batch file:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag
YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true
/p:PublishProfile=YOURPROFILE
This is working for us on multiple build servers.
I hope this helps someone.
It seems insane to me that Microsoft hasn't provided a MSBuild update with all the publishing options. It seems to me that the command line tools are more important on the server....
Just moving Dave's solution into an answer.
Solution:
Make sure you installed Microsoft Windows SDK and .Net Framework 4
From your client machine with Visual Studio 2012 update 2 installed, copy:
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\
To the same location on your server.
Then make a simple batch file:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag
YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true
/p:PublishProfile=YOURPROFILE
This is working for us on multiple build servers.
I am using Team Foundation Service 2012, with a build controller hosted internally so I can deploy apps to our web servers. I setup the Build Definition, and am using the my Debug configuration, and have supplied the following MSBUILD arguments.
/p:DeployOnBuild=true /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=https://myserversname:8172/msdeploy.axd /p:AllowUntrustedCertificate=true /p:DeployIisAppPath="somesite.ourdomain.com" /p:Username=na\svc-users /p:Password=PASS /p:VisualStudioVersion=11.0
The solution builds just fine, I get no warnings, or errors. When I go my deployment server, the application is empty. I have setup the permissions to the web application folder, and inetsrv folder. I also installed/configured web deploy. If I am not getting any errors returned how can I tell what is going wrong with my Deployment? I have already checked the Event Logs on both the Build server, and the Deployment server, and neither have any errors or warnings. I can also do a publish from my dev machine and it works perfectly with the exact same parameters.
Copy these two folders, and their content, from your development environment to the build server:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications
These folders are a dependency which is caused by publishing through Visual Studio 2012. This dependency is referenced in the .sln file.
Unfortunately this means web deploy is failing silently.
Alternatively you could install Visual Studio on the build server but that would be a waste of a license.