I am trying to deploy a console application to a folder on a DMZ server using autodeploy with MSBuild and Team Foundation Server.
I am already deploying multiple sites to that same server and it works great. I have tried multiple ways but the files are not deployed.
First, I tried to deploy the console app in the same way as i do for my web site, ie:
<MSBuild
Projects="$(SolutionRoot)\MySolution.sln"
Properties="AllowUntrustedCertificate=True;AuthType=Basic;
Configuration=DEBUG;CreatePackageOnPublish=True;
DeployIisAppPath=Default Website/dummy.dev.myapp;
DeployOnBuild=True;DeployTarget=MsDeployPublish;
MSDeployPublishMethod=WMSvc;
MsDeployServiceUrl=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd;
UserName=userid;Password=password;UseMsdeployExe=True"
/>
Without success.
EDIT: No error message is returned. It all seems to go well.
Then, I also tried to deploy the console app as follows:
<Exec Command=""C:\Program Files\IIS\Microsoft Web Deploy V2\MSDeploy.exe"
-verb:sync
-source:contentpath="$(OutDir)\MyApp.Precompiled"
-dest:contentpath="D:\dev.myapp",computername=xxx.xxx.xxx.xxx,username=userid,password=password"
ContinueOnError="false" />
I actually also tried with computername as https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd.
EDIT: The following is what I got.
EXEC: FileOrFolderNotFound
EXEC: Object of type 'contentPath' and path 'E:\Builds\1...\dev.myapp' cannot be created.
EXEC: The path '\?\E:\Builds\1...\dev.myapp' is not valid.
EXEC: 1.
E:\Builds\1...\BuildType\Targets\Deploy.targets (142): The command ""C:\Program Files\IIS\Microsoft Web Deploy V2\MSDeploy.exe" -verb:sync -source:contentpath="E:\Builds\1...\dev.myapp" -dest:contentpath="D:\dev.myapp",computername=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd,username=userid,password=password" exited with code -1.
I realize I haven't read all of the error, Do I really need an UNC path?
Does anyone know how to do this?
I finally found out how to make it work.
<Exec Command=""C:\Program Files\IIS\Microsoft Web Deploy V2\MSDeploy.exe"
-verb:sync
-source:contentpath="$(OutDir)\MyApp.Precompiled"
-dest:contentpath="D:\dev.myapp",computername=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd,username=userid,password=password,authtype=Basic
-allowUntrusted=True"
ContinueOnError="false" />
I changed computername to computername=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd, added authtype=Basic and allowUntrusted=True and voila it worked.
It was quite frustrating not having any kind of feedback of what went wrong with the first option. But when I was using the second alternative I got feedback to work with.
If anyone know how to make this work using the MSBuild task, please feel free to enlighten me.
Try dirPath provider instead of contentPath, it'll behave more like a folder sync rather than IIS web site deployment.
Considering the sync worked using the EXEC task, did you make sure you have the Microsoft.WebApplication.targets in your csproj (or vbproj) file? I could see it just ignoring that msbuild task without the correct targets file included.
For example in my web service project files, I have this towards the bottom of my csproj file
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
Related
Ok it could be a singular combination...
INTRODUCTION
I have an existing ASP.NET MVC 5 project.
It contains a private "Admin" area. I'm planning to change this area migrating it to Angular2 (+ WebAPI) :)
Due to some business requirements, I can't change the architecture of the original "Main" website (separating the Admin section into another website) so I must host inside it the new "Admin" area written in Angular2.
Main website url: http://www.example.com
Admin area url: http://www.example.com/admin
This is also true for the Visual Studio Project:
I created a folder "admin" and put all Angular2 stuff in it.
All works fine...
THE ISSUE
My ASP.NET project uses the MvcBuildViews parameter to build the MVC views on Release mode.
Now when I run the build in Release mode I receive this error:
\node_modules\selenium-webdriver\lib\test\data\web.config(29): error
ASPCONFIG: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.
The error doesn't have sense for me...
MSBUILD has analyzed a web.config file inside the "node_modules".
The node_modules folder has been created in the project root folder after "npm install" (necessary to prepare angular2's stuff).
These folder should be ignored by msbuild... IMHO
HEY... node_modules IT IS NOT included in the VS project. MSBUILD is scanning the folder because it is only present inside the project...
WORKAROUNDS
Give up the MvcBuildViews... but I think this setting is very useful to detect errors during development phase
Hide the node_modules folder. This is the current workaround I'm using. I've added this pre-build event attrib +h "$(ProjectDir)node_modules"
Some other solution?
I've googled with no success...
I had the same issue recently. I found the solution to this issue in the following article:
Excluding node_modules folder from ASP.NET compilation
The article suggest to replace the AspNetCompiler task in your csproj for a direct call to aspnet_compiler.exe which support excluding folders. In the article, it does so by hardcoding the path to that .exe file. Which for most of the cases is Ok.
You may also use $(FrameworkDir) and $(FrameworkVersion) to avoid hardcoding the path or if you are unsure where the aspnet_compiler.exe may be:
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<Exec Command="$(FrameworkDir)\$(FrameworkVersion)\aspnet_compiler.exe -v temp -p $(WebProjectOutputDir) -x node_modules"/>
</Target>
My situation:
I am working on an ASP.NET MVC project and debug in IIS-Express. Sometimes when we create a temporary branch, this branch will use the same port for debugging. This means the virtual directory in IIS is the same and I can't run them both at the same time.
How it used to work in vs2010:
This is not really a problem because I don't want to run them at the same time. However, in VS2010, I would get a warning when opening the branch for the first time. It asked me if I wanted to remap the URL. When I later returned to open the trunk, I would get the same warning (See https://stackoverflow.com/a/3093534/210336).
How it doesn't work in vs2012:
Now in VS2012, I don't get the warning anymore. If I forget to manually go to the settings and press "Create Virtual Directory" (This has happend a few times), then when I click run in the branch, it will actually run the trunk. This can be extremely confusing. Especially if I try to debug or the system breaks on an exception. A source file from the trunk will be opened in the branch solution. I then think I'm editting the branch, but I am in fact editting the trunk...
Is there anyway to let VS2012 perform the same check as VS2010?
Or am I doing/understanding something else completely wrong?
VS actually edits the IIS Express configuration file found in one of these paths
%userprofile%\documents\iisexpress\config\applicationhost.config
%userprofile%\my documents\iisexpress\config\applicationhost.config
When leaving it up to VS, I tend to see duplicated and conflicting configurations.
For local development, I prefer to start IIS Express from cmd or powershell script as it does not require attaching (but can be attached) and gives me control over the configuration. I make a copy of the iis config and specify the config file in the iis express command. I have a powershell script that sets the path based on the executing directory so no matter which branch, it is always set to the one I'm working in.
Here is some information about running iis express from the command line:
http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
And here is a good resource for running iis express from powershell:
https://blog.differentpla.net/post/UaYcAPDfiVJBAAAC/running-iis-express
i am getting this
Windows could not start the SphinxSearch service on Local Computer.
Error 1067: The process terminated unexpectedly.
i got installation instruction from this .
http://blog.robbsnet.com/2011/07/how-to-install-and-implement-sphinx.html
build process is complete but when i start the sphinx search service i got errors .
Try running searchd manually from Command Prompt. Maybe it will give you a useful error message.
Try also looking in searchd.log
For anyone who is still having problems with the Windows service:
Make sure your configuration is correct for both database and paths and the needed folders & files are created.
Make sure that the service "command" matches the correct paths and files, to do so you have to:
Run administrative tools, click on local services, then find SphinxSearch. Click on its properties and read the line the service is trying to execute. If the configuration path doesn't match the service start command, it will fail to start.
FYI, this can also happen because your search data files are corrupt. Easy fix for that is to nuke the files and refill them.
I'm trying to get TFS to automatically publish (not package at the moment) my web app on a build to a Win2k3 server with IIS6. The remote agent service is started.
The build fails giving me a 401. I'm now trying to manually run a cmd line from the build server itself (just incase the MSBUILD was doing something strange with the params set on the build definition) and it's giving me the same thing. Here is the command I'm trying to run:
msdeploy.exe
-source:contentPath='C:\Builds\1\Test\DummyTFSWebApp Submission Build\Binaries\_PublishedWebsites\DummyTFSWebApp'
-dest:contentPath='Default Web Site',
computerName='http://ipm-vm-dev/MSDEPLOYAGENTSERVICE',
userName='Domain\AdminUser',
password='Password',
authType='basic',
includeAcls='False'
-verb:sync -allowuntrusted
But like the build report, it's giving me:
I can't understand why! The username & password provided is an Administrator on the destination machine. I've even made the build server machine and admin (clutching at straws), and I've made the destination folder a share for everyone with write permission.
Help appreciated as this is really frustrating me!
I changed the authType='NTLM' and it now works!
/p:AuthType=NTLM
I am using the Ant wldeploy task to deploy a war file.
It is working fine, but the war file path in the deployed server is set to something like
servers/myadminservername/upload/mywarfilename/app
Instead, I would like to set this path myself in the Ant buildfile.
Can any one please help me with that?
The task I am using for this is:
<wldeploy action="deploy" verbose="false" debug="true"
name="ClientProfileSyncPortTypeImplV8"
source="${results.war.file.dir}/ClientProfileSyncPortTypeImplV8.war"
upload="true" adminurl="t3://${serverip}:${port}"
user="${admin_id}"
password="${admin_pw}"
usenonexclusivelock="${lock}"
targets="${target_managed1}">
</wldeploy>
I think you can edit the config.xml and specify the path of your deployment.
The upload, targets and stage / nostage / externalstage attributes of the wldeploy task give some control over where the deployment is made to.
I ended up deleting the app and the deploying it from ant, accepting the path it chooses. Now I can deploy and redeploy just fine. It's really neither here nor there to me where the ear lives - I was just sad that when I deployed in the UI I couldn't redeploy using ant.
I know this is an old post but I have a partial solution for anyone who stumbles across this question
From the path: "domain/servers/myadminservername/upload/mywarfilename/app" you can change the first part of this (You can edit the "servers/myadminservername/upload") to go to any directory relative to the WLS domain.
Go to the Administrator Console (using: serverIP:serverPort/console) and in the left hand side follow the tree:
environment -> servers -> (AdminServerName) -> Configuration -> Deployment -> Upload Directory Name
The "Upload Directory Name" can contain a path to a directory that is relative to the domain.
So at least "domain/servers/myadminservername/upload/mywarfilename/app" can become "domain/path_of_your_choice/mywarfilename/app"
Hope this helps someone