I've been struggling with this error for quite some time.
I've scrubbed the paths, but I've checked the paths and the sources and they are correct. I've checked the proxy and it works. I've run the command in a command line and it works fine, but ccnet / msbuild logs these errors.
<message level="high"><![CDATA["C:\Develop\Web\.nuget\NuGet.exe" install "C:\Develop\Web\MyCompany.MyProject\packages.config" -nocache -source "https://www.nuget.org/api/v2/;http://ec2-54-201-44-121.us-west-2.compute.amazonaws.com/nuget/" -NonInteractive -solutionDir "C:\Develop\Web\ "]]></message>
<error file="WARNING" line="0" column="0" timeStamp="02/27/2014 11:40:52"><![CDATA[(403) Forbidden.]]></error>
<error file="WARNING" line="0" column="0" timeStamp="02/27/2014 11:40:52"><![CDATA[(403) Forbidden.]]></error>
<error file="WARNING" line="0" column="0" timeStamp="02/27/2014 11:40:52"><![CDATA[(403) Forbidden.]]></error>
<error file="WARNING" line="0" column="0" timeStamp="02/27/2014 11:40:52"><![CDATA[(403) Forbidden.]]></error>
<message level="high"><![CDATA[Installing 'MyProject.MyCompany.Common 1.0.0'.]]></message>
<message level="high"><![CDATA[Installing 'MyProject.EnterpriseLibrary.4.1 1.0.1'.]]></message>
<message level="high"><![CDATA[Installing 'MyProject.Web.Cms.Libraries 1.0.0'.]]></message>
<message level="high"><![CDATA[Installing 'MyProject.MyCompany.Interactive.DataAccess 1.0.0'.]]></message>
<message level="high"><![CDATA[Successfully installed 'MyProject.MyCompany.Interactive.DataAccess 1.0.0'.]]></message>
<message level="high"><![CDATA[Successfully installed 'MyProject.MyCompany.Common 1.0.0'.]]></message>
<message level="high"><![CDATA[Successfully installed 'MyProject.EnterpriseLibrary.4.1 1.0.1'.]]></message>
<message level="high"><![CDATA[Successfully installed 'MyProject.Web.Cms.Libraries 1.0.0'.]]></message>
<error code="MSB3073" file="C:\Develop\Web\.nuget\NuGet.targets" line="88" column="9" timeStamp="02/27/2014 11:41:03"><![CDATA[The command ""C:\Develop\Web\.nuget\NuGet.exe" install "C:\Develop\Web\MyCompany.MyProject\packages.config" -nocache -source "https://www.nuget.org/api/v2/;http://ec2-54-201-44-121.us-west-2.compute.amazonaws.com/nuget/" -NonInteractive -solutionDir "C:\Develop\Web\ "" exited with code -1.]]></error>
</project>
Log in as the IDENTIY (domain\username) that CC.NET service is running.
I had something similar with a source-control command line tool.
Once I logged in as the identity the service was using.......and ran the command line (that you say works ), I saw the error quickly.
So this is kind of an educated guess. But I've seen something similar.
If you don't have a dedicated identity (domain\username) to run the CC.NET Service.........I'd create one.
You can also stop the service..and (temporarily) run cc.net from the command line........but again.....logged in as the identity that runs the cc.net-service.
Related
My project has a different behaviour locally and on production.
I have concluded that some Tasks in my .vbproj don't get executed locally neither in DEBUG or RELEASE mode. For example, I have a Message in a element, and it doesn't appear in the OUTPUT window after build.
Is my conclusion wrong? Am I missing something here?
doesn't display message in console:
<Target Name="test12345">
<Message Text="This is a test message" Importance="high" />
</Target>
displays message in console:
<Target Name="AfterBuild">
<Message Text="This is a test message" Importance="high" />
</Target>
The AfterBuild name makes it automatically run after a project is built (to be specific, AfterBuild is already defined but meant to be overwritten in custom projects).
When you define a target with a custom name, you need to hook it into the build as well, e.g. by using AfterTargets:
<Target Name="test12345" AfterTargets="Build">
<Message Text="This is a test message" Importance="high" />
</Target>
I have a C# project (vs2013) and for this project, i want to do always a clean solution before the build. Now i can (again and again) choose clean project before building, but this should be possible using a Target tag in the .csproj file. I started looking on the internet and came up with a solution that did not work:
<Target Name="Clean"
BeforeTargets="Build">
<Message Text="### Start Clean before build"
Importance="high" />
<Exec Command="CALL "$(MSBuildBinPath)\msbuild.exe" "$(MSBuildProjectFullPath)" /t:Clean" />
<Message Text="### Finished Clean before build"
Importance="high" />
</Target>
But this results in an infinite loop, starting msbuild over and over again.
You've defined the target recursively. Don't name it "Clean", name it "PreBuildClean" or something similar.
Also you don't have to call out to msbuild externally using Exec. You can use the CallTarget task to invoke a target directly.
<Target Name="PreBuildClean"
BeforeTargets="Build">
<Message Text="### Start Clean before build"
Importance="high" />
<CallTarget Targets="Clean" / >
<Message Text="### Finished Clean before build"
Importance="high" />
</Target>
The Rebuild target is just Clean followed by Build, so I'm not sure why you'd need this, unless it is only for one specific project in the solution.
I am using MSTest to execute my unit tests against a web service on a remote server.
Is there way to change the path to where the results file(.trx) is generated. Currently my test results is generated in the directory which the Exec command is invoked from:
<Target Name="ExecuteTheTests" AfterTargets="StartService" Condition="'$(ServiceStarted)' == 0 And '$(Configuration)' == 'Release'">
<Message Text="Executing the Unit Tests" Importance="high" />
<PropertyGroup>
<TestSuccessOrNot>0</TestSuccessOrNot>
</PropertyGroup>
<Exec Command=""C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\MSTest.exe" /testcontainer:..\..\..\..\\_MyOutput\\UnitTests.dll /detail:testname ">
<Output TaskParameter="ExitCode" PropertyName="TestSuccessOrNot" />
</Exec>
<Error Condition="$(TestSuccessOrNot) == 1" Text="Unit tests fail!" />
Thanks,
Many Bothans died* to bring you this message:
mstest.exe /resultsfile:c:\BadPlaceForTestResults.trx
j/k, many Bothans didn't die, they just typed "MsTest.exe /?"
I'm currently working on wiring up Selenium tests to be run by CCNET which runs as a service in our build server.
This is my Project.build file:
<Target Name="AutomationTests">
<Message Text="~~~~~~~~~~~~~~~~$(HARD_NEW_LINE)" />
<Message Text="cmd.exe /interactive /c $(MSBuildProjectDirectory)\Nunit.bat $(SourceFolder)\Project.Web.UI.Automation\bin\Release\Project.Web.UI.Automation.dll"/>
<Exec Command="cmd.exe /interactive /c $(MSBuildProjectDirectory)\Nunit.bat /run:Project.Web.UI.Automation.Test.login $(SourceFolder)\Project.Web.UI.Automation\bin\Release\Project.Web.UI.Automation.dll" ContinueOnError="true" />
</Target>
Note : I resorted to run Nunit from a batch file following the advice in this post.
This is my CCNET.config file:
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>C:\Projects\Project\AutomationUpdate\</workingDirectory>
<projectFile>Project.build</projectFile>
<buildArgs>/p:Configuration=Debug</buildArgs>
<targets>AutomationTests</targets>
<timeout>1800</timeout>
<logger>C:\CCNET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
</msbuild>
My problem is that, even though Nunit starts up (I can see it's output in the MSBUILD log), Selenium is throwing a timeout exception. This is an excerpt from the build log as seen in CCNET.
<message level="high"><![CDATA[ProcessModel: Default DomainUsage: Single]]></message>
<message level="high"><![CDATA[Execution Runtime: net-4.5]]></message>
<message level="high"><![CDATA[Selected test(s): Project.Web.UI.Automation.Test.login]]></message>
<message level="high"><![CDATA[.F.F.F.F.F.F]]></message>
<message level="high"><![CDATA[Tests run: 6, Errors: 6, Failures: 0, Inconclusive: 0, Time: 223.3787765 seconds]]></message>
<message level="high"><![CDATA[ Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0]]></message>
<message level="high" />
<message level="high"><![CDATA[Errors and Failures:]]></message>
<warning file="EXEC" line="0" column="0" timeStamp="10/29/2013 12:38:16"><![CDATA[Project.Web.UI.Automation.Test.login.TestLogin.BlankPassword]]></warning>
<message level="normal"><![CDATA[The previous error was converted to a warning because the task was called with ContinueOnError=true.]]></message>
<message level="high"><![CDATA[ Selenium.SeleniumException : Timed out running command]]></message>
<message level="high"><![CDATA[ at Selenium.Internal.CommandTimer.Execute(SeleneseCommand commandToExecute, IWebDriver commandDriver, String[] commandArguments)]]></message>
<message level="high"><![CDATA[ at Selenium.WebDriverCommandProcessor.DoCommand(String command, String[] args)]]></message>
<message level="high"><![CDATA[ at Project.PageObjects.LoginPage.LoginToProject(String username, String password) in c:\Projects\Project\AutomationUpdate\Source\Project.Web.UI.Automation\PageObjects\login\LoginPage.cs:line 21]]></message>
<message level="high"><![CDATA[ at Project.Web.UI.Automation.Test.login.TestLogin.BlankPassword() in c:\Projects\Project\AutomationUpdate\Source\Project.Web.UI.Automation\Test\login\TestLogin.cs:line 60]]></message>
<message level="high" />
Anything I'm doing wrong here?
EDIT :
The previous error was due to an outdated Selenium driver. Now we're getting a different Exception:
SetUp : OpenQA.Selenium.WebDriverException : An error occurred while connecting to Firefox
----> System.IO.IOException : The directory is not empty.
at OpenQA.Selenium.Firefox.FirefoxDriver.StartClient()
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout)
at Project.Web.UI.Automation.Test.login.TestLogin.SetUp() in c:\Projects\Project\AutomationUpdate\Source\Project.Web.UI.Automation\Test\login\TestLogin.cs:line 16
--IOException
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at OpenQA.Selenium.Firefox.FirefoxExtension.Install(String profileDir)
at OpenQA.Selenium.Firefox.FirefoxProfile.InstallExtensions()
at OpenQA.Selenium.Firefox.FirefoxProfile.WriteToDisk()
at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Start()
at OpenQA.Selenium.Firefox.FirefoxDriver.StartClient()
The same code runs perfect when run under CCNET console. Any ideas?
probably a security problem, or a 'user interactive one'
since ccnet runs as local system, it does not have a real 'home' folder.
so probably it can not find the firefox exe, did you specify a path to it?
or it may not access the path
there are a few things you can do :
run ccnet service as the same user you do interactively
alter the security of the folders, so that local system may access them
option 1 is the easiest :-)
Seems my requirement cannot be met by CCNET after all. This is a technical impossibility. We chose to go with another CI server.
My team has a large solution (~500 csproj's). We use VS2012, and build using TFS Build, which uses MSBuild 4. Currently we build serially, but we want to build in parallel (using msbuild /maxcpucount:4). However, when I try it on my 4-proc machine, I get a weird failure:
11:2>CSC : fatal error CS0042: Unexpected error creating debug information file 'C:\Common\obj\Debug\Common.PDB' -- 'C:\Common\obj\Debug\Common.pdb: The process cannot access the file because it is being used by another process. [C:\Common\Common.csproj]
Looking at the log, 2 msbuild nodes were trying to build that same csproj, and thus colliding on writing some output:
10>Project "C:\Utils\Utils.csproj" (10) is building "C:\Common\Common.csproj" (11) on node 4 (default targets).
46:2>Project "C:\Objects\Objects.csproj" (46:2) is building "C:\Common\Common.csproj" (11:2) on node 1 (default targets).
Why would MSBuild try to build the same project twice?
Cause: Someone was calling <MSBuild Projects="Common.csproj" Properties="..." />. Then, MSBuild thinks that it should build Common.csproj again with those different properties, and it happened to occur at the same time with the regular compilation of Common.csproj.
Fix: Call <MSBuild ... /> without those unneeded properties.
Test:
Common.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<Message Importance="high" Text="Build in $(MSBuildThisFile)" />
</Target>
<Target Name="After" DependsOnTargets="Build">
<Message Importance="high" Text="After in $(MSBuildThisFile)" />
</Target>
</Project>
Other.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build">
<Message Importance="high" Text="Build in $(MSBuildThisFile)" />
<MSBuild Projects="common.targets" Targets="Build" /> <!-- regular builds -->
<MSBuild Projects="common.targets" <!-- custom invocation with properties -->
Targets="After"
Properties="myprop=myvalue"
/>
</Target>
</Project>
Run:
> msbuild other.targets /clp:verbosity=minimal
Build in other.targets
Build in common.targets
Build in common.targets <<<< Common.targets Build is invoked again
After in common.targets
And indeed, removing Properties="myprop=myvalue" solves the issue.
I found someone had added two project references (from the same project) and that apparently caused msbuild to build twice also.. something to watch out for