This is my current MVC Project setup for a project named ABC.sln
Project ABC.sln with following projects
A.csproj, B.csproj, C.csproj
I am trying to publish A.csproj to IIS via VSTS Visual studio build (version 2019)
Here is my msbuild arguments:
/p:SolutionDir="$(Build.SourcesDirectory)" /p:DeployOnBuild=True /p:Configuration=$(BuildConfiguration) /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=serverpath.com /p:DeployIISAppPath=mysite.com /p:OutputPath=$(Build.BinariesDirectory) /p:AllowUntrustedCertificate=true /p:UserName= /p:AuthType=NTLM /p:DeleteExistingFiles=True /p:SkipExtraFilesOnServer=False
Solution:
$(Build.SourcesDirectory)/A/A.csproj
Platform: AnyCPU
Build runs successfully, and I do get the:
Successfully executed Web deployment task.
Package "A.zip" is successfully created as single file at the following location:
file:///C:/agent/_work/54/b/_PublishedWebsites/A_Package
To get the instructions on how to deploy the web package please visit the following link:
https://go.microsoft.com/fwlink/?LinkId=124618
GenerateSampleDeployScript:
Sample script for deploying this package is generated at the following location:
C:\agent\_work\54\b\_PublishedWebsites\A.deploy.cmd
For this sample script, you can change the deploy parameters by changing the following file:
C:\agent\_work\54\b\_PublishedWebsites\A.SetParameters.xml
PipelineDeployPhase:
Publish Pipeline Deploy Phase
Done Building Project "C:\agent\_work\54\s\A.csproj" (default targets).
However, I do not see where it was published. I do not see any of the files published in any folder on my IIS server for this app pool.
Why does it say package? Shouldn't the files from A.csproj be directly published to the mentioned p:DeployIISAppPath?
Why does it say package? Shouldn't the files from A.csproj be directly
published to the mentioned p:DeployIISAppPath?
One of the workaround you can follow,
To check if the .csproj file exist or not please check the scm site whether its available or not under D:/home/site/wwwroot . And make sure that deployed file structure is same as on Azure and IIS. Please find the reference image to check the scm site.
For complete setup to deploy ASP.Net MVC app to IIS on Windows please refer this BLOG by#Asma Khalid .
For more information please refer the below links for the similar issues:-
SO THREAD| How to deploy the entire project to IIS ,
Automatically publish web application on build from Visual Studio ,
How to deploy an ASP.NET MVC application on build using MSBuild in Visual Studio .
Related
When I develop a web application via Visual Studio 2013 (version 12.0.21005) and compile/build and run locally (Citrix Desktop) it works fine. However, when the same project is built in our BUILD server it fails with the following error.
"error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found."
Looking at the build server (under C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio folder) I can find that there are v10.0 and v14.0 installed.
What instructs the system to look for v11.0 when other versions are avaiable on the server. is there some setting on the csproj or the solution file (as my WindowsForms based projects compile fine in the BUILD server)
Unfortunately I do not have the rights to install MSBUID in either the Citrix Desktop or the Build Server
Logged into the servers to find the available build versions
Found the answer in the following post.
https://devblogs.microsoft.com/aspnet/visual-studio-project-compatibility-and-visualstudioversion/
Als refer to https://en.wikipedia.org/wiki/MSBuild for version history
I have a hard requirement from the developer to use a website project instead of a web app project for a .net deployment. I am able to connect and use continuous integration just fine with a web app project, but when using website, it fails to find the compiled files for deployment:
#[debug]check path : D:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-
0ae63477cebe\1.142.2\task.json
##[debug]set resource file to: D:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-0ae63477cebe\1.142.2\task.json
##[debug]system.culture=en-US
##[debug]PathtoPublish=D:\a\1\a
##[debug]check path : D:\a\1\a
##[debug]ArtifactName=drop
##[debug]ArtifactType=Container
##[debug]system.hostType=build
##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
Looking at the build process, it's compiling a copy of the deployment to the PrecompiledWeb folder instead of the debug folder, which seems to explain why it cannot find the results. Has anyone had luck deploying with a website project or have you run into the issue above?
Azure DevOps Continuous Integration with asp.net website project instead of web application
Since the project is asp.net website, you may need use the website.publishproj file instead of the .sln file when you publish the asp.net website project with MSBuild.
The command line like:
msbuild.exe "<PathToTheFile>\website.publishproj" /p:deployOnBuild=true /p:publishProfile=WebsiteTestDemo /p:VisualStudioVersion=1x.0
With this setting, MSBuild does not create the PrecompiledWeb folder and the publish uses the setting in the profile.
Check my previous thread for some more details.
The website project the publish process is not plumbed into the build
process. For website project since there is no formal build process
there was nothing for us to really extend.
Hope this helps.
Finally, i have completed my asp.net mvc5 project.
I have used EF code first for database and my solution included two part, the core included Model and frontend included the views and the controller.
Now i want to send the project to my friend that he can publish it in his windows server with IIS server.
My question is which file i have to copy for him that he can publish the WebApp with out installing visual studio in his windows server.
Right click on main MVC project in your solution -> Publish.
Publish method: File System
Target location: your location
In settings Configuration you can set Release or Debug as you need.
After publish you can send whole folder to your friend. Everything that you need should be there (Your bins, views, scripts, css).
Your friend should just create new WebSite in IIS and place all files in folder that he selected.
Ofcourse he should change connection strings and set right settings for ApplocationPool that runnig WebSite.
I am trying to run Visual Studio Team Services automated build and deploy but having trouble with copying built windows service to Azure VM.
These are my steps:
Build
Tried with Windows File Copy
Tried with Azure File Copy
When I copy files from web projects (ASP.NET MVC 5) with Azure File Copy, everything works fine and the files are transfered. When I try to copy Windows Service built files, it failes silently. The task passes successfully but when I open the VM through remote desktop, the folder is empty. Any ideas?
Windows Service project is different with Asp.Net MVC project. With the arguments you specified in "MSBuild Arguments" of "Visual Studio Build" step, there is no file generated in "$(build.stagingdirectory)" folder. So "Azure File Copy" task just passed and copied nothing.
To fix this, changing the argument to following and then try the build again:
/p:outputpath="$(build.stagingdirectory)"
I have created a simple MVC3 application in Visual studio 2012. Earlier I was using VS2010. Both are currently Installed on my System.
The Problem is that when I publish and Deploy the application on IIS It doesn't works.
It gives Error Code 0x00000000
I tried with different applications but problem remains the same. Any of the application created in VS2012 is not deploying Successfully. Please Help.
I am adding snapshot of publish and error message.
looks like you are publishing an mvc3 app.
If I remember correct for that version you either have to install mvc on the server or include mvc binaries in your output directory.
There was a menu item for mvc project (right click on a project in solution explorer) to add mvc dependencies to some binpub folder. You should look for that.
oh and here is a Hanselman post on the topic
http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx
And another SO question: Why is the _bin_DeployableAssemblies folder specific to web applications?