MS Deploy & IIS6 - 401 Unauthorised Error - tfs

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

Related

Xcode Server Bot won't connect to Gitlab server (Fails to integrate)

I'm trying to integrate a simple Xcode Bot with my Xcode server.
I'm using OS X Server 5 Beta 3 and Xcode 7 Beta 5
I create a bot and everything goes great. I use an existing ssh key for connecting to this git repository on gitlab and that works fine everywhere else and even Xcode (in accounts preferences) seems to not have a problem with the repo.
But when I go to integrate the bot, it fails to check out the source with:
Failed to authenticate SSH session: Callback returned error (-1)
I've tried changing this to use my actual gitlab credentials instead of the ssh key and I get the same error. It doesn't seem to matter what I use for the bot, it fails to sign in. Yet all of those credentials work on gitlab using git and Xcode itself just fine.
Anyone else run into this? And/or are there any better logs somewhere of what's going on?
Not much in the verbosity in the xcodebuild logs on the server either:
2015-08-10 09:42:28.303 xcsbuildd[14203:84978] XCSIntegrationExecutor.m:229 [XCSIntegrationExecutor integrationStep:didFinishWithError:result:] [BuildService, Error] XCSCheckoutIntegrationStep finished integration with an error: Error Domain=XCSBuildServiceDomain Code=-1 "Could not checkout sources because the source control information is in an invalid format. UserInfo=0x7fb8ece65810 {NSLocalizedDescription=Could not checkout sources because the source control information is in an invalid format., XCSErrorFixItType=scm-failure}
Not sure what it means by invalid format?:
Could not checkout sources because the source control information is
in an invalid format

Jenkins Cannot import the following key file

I am able to build my application on Visual Studio without any problem. I am trying Jenkins out on the same machine. When I try to build my application from my git remote repository (It contains the .pfx file in the SVC) I get the error
error MSB3325: Cannot import the following key file: Key.pfx. The key
file may be password protected. To correct this, try to import the
certificate again or manually install the certificate to the Strong
Name CSP with the following key container name: VS_KEY...
error MSB3321: Importing key file "Key.pfx" was canceled.
I had already run the command shown on the answer of this question Cannot import the keyfile 'blah.pfx' - error 'The keyfile may be password protected' and that is the reason my application runs in Visual Studio (I've done it through the command prompt as administrator fyi), which means when I try running it again the object already exists and if I uninstall and reinstall the same problem happens again.
Anyone has any ideas of how I can solve this problem?
Its the IIDentity (the windows account/identity) that is running Jenkins, most likely.
As a quick test, edit the Jenkins service and put in your credentials.
..
If that works, either keep it that way, or do your manual import voodoo using the identity that you want Jenkins to run under.

How can I let Visual Studio 2012 detect if virtual directories need to be remapped?

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

Using MSDeploy for deploy of console application to a DMZ server

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" />

Can we run sample-app that comes with BB Push SDK without app.id?

I am trying to deploy the sample-app war file that comes with PushSDK.But was not able to deploy the application successfully.Steps followed till now
1) I was able to configure PushSDK.properties log4j.xmlbut didn't change value of ${sampleapp.appid} in sample-app-context.xml.
2)then made the war file using cmd
3) Deployed on the server.
during deployment an error was coming.
Invalid bean definition with name 'registerListeners' defined in class path resource [sample-app-context.xml]: Could not resolve placeholder 'sampleapp.appid'
Tried to register on link but was unsuccessful
I have just started down the path of using the Push SDK, but from what I've read I conclude that you need to get your development registration completed at least before you can run the sample code; unles you're using your own BES.

Resources