Web Package gets wrong IIS Website name - visual-studio-2010

I'm trying to utilise TFS Team Build to deploy web applications from a solution as part of the build process, however I'm having a problem with the IIS website name when using package .zip and cmd files.
In the web application project settings "Package/Publish Web" tab I can set the IIS website name (eg "mobile") and when the project is built using the MSBuild action from the workflow the resulting .zip and .xml files are created correctly. However, upon opening the SetParamters.xml file, the IIS Web Application Name parameter has an old value, something like "Default website/mobile_deploy".
If I build a package directly from within Visual Studio 2010 the SetParameters.xml has the IIS Web Application Name I set in the project file settings.
The build template is set to clear the workspace on each build and I've confirmed this by watching the binaries folder being cleared on the build agent during the build so I'm certain its not the value hasn't been overwritten.
Any suggestions to get the project's IIS Web Application Name pulled through properly?

Maybe, when you build your project through MSBuild you don't set the same Configuration in which you have changed the IIS Web Site/application name through Package/Publish Web settings on Visual Studio 2010.

The deploy path can be different for each Project Configuration. Perhaps you set the Debug value while TFS is using Release?

Related

Why isn't the Publish.htm file being created?

I'm trying to create a ClickOnce deployment of a WPF app, using VS 2019. I'm testing it by having it create the Publish.htm file in a website on my machine. Here's what I have in the project's Publish Options tab:
However, when I publish from VS 2019, the publish.htm file does not get created on the website. The web.config file is there, but that's all that's there. Why isn't it creating the publish.htm file?
If test via iis, you need to fill the Publishing Folder Loaction with the physical path of iis website.
The setting of iis website,

WebDeployment is not

I am trying to deploy an web application that was created on VB with the .NET Framework 2.0 using the TFS 2017 continuous deploy. It doesn’t have a solution file inside like vbproj or csproj, so I needed to avoid all the suggestions to include extra information on the vbproj.In order to run the MSBuild even locally I need to change in my .sln this tag, so all my compiled code is also there
Debug.AspNetCompiler.TargetPath = "....\PrecompiledWeb\ARB\Debug\"
Unfortunately, I can’t deploy the application using the TFS. So far I tried to deploy it through my Visual Studio project, and is working fine with every option: I tried MSDeploy, Web Deploy Package, and FileSystem, and is working fine from the Visual Studio Publish Option
With that, even my transformation take place.
Now lets say I go to my TFS and I put this parameters on the MSBuild
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsASingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="\\MyServer\Content"
My files are compiled but never stored in my Content folder. No one of them!!! I can’t figure out what is going on here.
From your screenshot, you are using a Web Site project, not a Web Application project. The output structure of a Web Site project in TFS is different from build in VS (you can see a PrecompiledWeb folder in your build source directory on build agent server). Instead of using MSBuild argument, you can consider add tasks below to copy the files you want to publish:
We strongly suggest you switch from Web Site projects to Web Application projects to avoid these issues.

Build not publishing Web API project in Visual Studio Team Services (was VS Online)

I have created a VS build definition on Team Services. The build runs successfully when I queue it and it also outputs the dlls for all the projects in the solution except the service layer which I have created using Web Api2.
when I download the artifacts from the drop location, I have folders holding the dlls for the data layer, the business layer and other helper projects. What I don't have is the main service layer dll which I can deploy to my IIS.
Here is a screenshot of my publish settings.
What could I be missing ?
It seems that you are using the default settings for the build definition. With these settings, the contents for "Copy Files" task is "**\bin\$(BuildConfiguration)**" while web api project does not have buildconfiguration folder. So it cannot find the files for web api project. To copy these files, add one more "Copy Files" task and configure the settings as following:
If you want the deployment files for the project, you need to set you build definition as following:
Add arguments /p:DeployOnBuild=true;OutDir="$(build.artifactstagingdirectory)" for Visual Studio Build step.
Remove Copy Files step.
Set Path to Publish to $(build.artifactstagingdirectory)\\_PublishedWebsites for Publish Build Artifacts step.
Then you should get the deployment files in the drop folder.
Open the Configuration Manager in VisualStudio and ensure the WebAPI project is included for the configuration (Debug, Release, etc) that you are building.

Why Visual Studio 2010 publish website with source code?

I'm using Visual Studio 2010 with the new website publish dialog. I have a Web Application website. When published, in theory it should compile all the code into an single assembly. However, in both Debug and Release, after publishing the directory always contains source code of page and user controls (even with the untransformed web.config files Web.Debug.config and Web.Release.Config). This is very confusing.
But with package/publish web project configuration and Generate Deploy package context menu item, the Package\PackageTmp directory is clean.
Why doesn't Visual Studio use this Package to publish the website?
Where is the precompile option?
Web.config xml transform seems not work, why does Visual Studio bring this feature to confuse me?
The correct answer is to look in the Package/Publish Web settings (in the web application project properties) and look for the "Items to deploy".
For a web application you'd want "Items to deploy" to have "Only files needed to run this application" which would NOT copy the source code files, since they've been compiled into the DLL in the bin folder.
Note that this setting varies for your current Build type (Debug/Release/etc), so plan accordingly...
Ciao!
You need to understand the differences between Web Application Projects versus Web Site Projects.
To deploy a Web application project, you copy the assembly that is
created by compiling the project to an IIS server. In contrast, to
deploy a Web site project, you typically copy the project source files
to an IIS server.
For Web application projects, you typically build the project in
Visual Studio or by using the ASP.NET batch compiler on a computer
that is not the production IIS server. All code-behind class files and
standalone class files in the project are compiled into a single
assembly, which is then put in the Web application project's Bin
folder. (The .aspx and .ascx files are compiled dynamically in a
manner similar to what is done for Web site projects.)
For Web site projects, you do not have to manually compile the
project. Web site projects are typically compiled dynamically by
ASP.NET (on both the development computer and the production IIS
server). You can choose between batch compilation mode, which
typically produces one assembly per folder, and fixed compilation
mode, which typically produces one assembly for each page or user
control.
In visual studio 2013/2015, select an option "Precompile during publishing"

VS2008 How to deploy a WebSite Application Project

So I have created a Web Site Application project in VS2008 and is fine on my local machine. Just wondering how to I deploy this to a dev server i.e via FTP i.e. do I need just copy over all files i.e.
Microsoft Visual Studio Solution
Visual Basic Project File
Visual Studio Project User options File
and the rest of my customer folder and files & web.config ?
And then when I have those moved and i.e I want to change the config file on the dev server, can I just change the web.config directly on that server or do I need to then open it visual studio on that server and recompile again ?
You can use the Publish Web Site options under Build Menu.
This option can deploy directly on the remote site whit FTP or can publish the file needed on a foolder on your local computer, so you only have to upload on the remote site.
After you deploy the web site if you have only to change the web.config you can use Notepd for it and don't need to recompile nothing... only if you change CodeBehind you have to recompile and upload only the DLL.
This link can Help you understan all the process

Resources