I'm running msbuild in a build script and I get this error:
MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
I cannot find the file MSBuild_*.failure.txt on my machine. Is it something that needs to be configured? If not, what would the default location for that file be?
You can run
msbuild /v:diag > c:\log.txt
to force your log file to go to c:\log.txt.
Alternative, you may use /flp:filename=c:\log.txt, more information here.
Related
Error MSB3027 Could not copy "C:\Users\surendra.reddy.nuget\packages\system.security.cryptography.protecteddata\4.5.0\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll" to "bin\Debug\netcoreapp3.1\bin\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll". Exceeded retry count of 10. Failed. PublishReportNotification C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4679
This Error arrives because of the exceeded count of the retry method.
MSBuild has certain number of limit to copy the file.
If that limit has exceeded, this error will occur.
This will also occur when the destination file is in use by another program.
For example: If you try to move the program from one to another destination when running, It will give MSB3027
The detailed problem will be here.
I had the same issue. It was because the name of the destination of the project was too long. If you have something like D:\someFolder\SomeFolder\AnotherFolder\Folder\Folder\etc\myApp, Visual Studio would throw this error. There is a restriction on the destination length.
I generate a ProcessStartInfo by referencing a filename-only executable, without giving the absolute path. I expect the operating system to resolve the concrete location by using the PATH environment variable.
However, on some installations, the PATH variable is not set correctly and upon starting the Process by calling Process.Start() it will throw a
System.ComponentModel.Win32Exception
The system cannot find the file specified
Are there programmatic options to check if the Process.Start will work beforehand?
I tried to use File.Exists(fileName), but this does only work for files located in the applications working directory.
In the command prompt you could use the following call to determine if it will work:
//example where a file is found
C:\>where calc.exe
C:\Windows\System32\calc.exe
//example where a file is not found
C:\>where foo.exe
INFO: Could not find files for the given pattern(s).
Is there something alike in .net to determine beforehand if the file path can be resolved so that Process.Start() will not throw?
We have a problem with the Kinect V2.
We use Google and the Microsoft documentation to find a solution but we found nothing.
We get a Exception when we try to load the gesture from the database:
private readonly string gestureDatabase = #"Database\ChiMoGestures.gbd";
.
.
.
VisualGestureBuilderDatabase database = new VisualGestureBuilderDatabase(this.gestureDatabase)
When the program comes to this position,it throws a System.InvalidOperationException , exactly:
An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.Kinect.VisualGestureBuilder.dll
Additional information: This API has returned an exception from an
HRESULT: 0x80004005
Maybe the database self is not correct but we got it with the VisualgestureBuilder?
I am glad if anyone has a solution for this problem?
Not sure if this is relevant since the question is quite old, but I will answer it anyway.
The Visual Gesture Builder dll is throwing this error because it is missing some files it needs to work. Specifically, it needs the dlls of the two algorithms that perform the gesture recognition - AdaBoost and RFRProgress. These two dlls are available under your Kinect SDK folder, usually located at:
C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Redist\VGB\x86\vgbtechs
or
C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Redist\VGB\x64\vgbtechs
depending on your platform.
Luckily, there is a way to automate this process via Post-build command in Visual Studio. Go to Project -> Properties -> Build Events -> Edit Post-build ...
and paste
xcopy "$(KINECTSDK20_DIR)Redist\VGB\$(Platform)\vgbtechs" "$(TargetDir)\vgbtechs" /S /R /Y /I
This will ensure that you have the dlls in your Build directory no matter what your platform setting is.
In addition to the previous comment you must have your database added to your project solution and click on the database inside the solution and set its Copy to Output Directory property to Copy always and Build Action property to Content
When using TeamCity and running a build I get the following error message.
13:20:31]Step 1/1: MSBuild (1s)
[13:20:32][Step 1/1] src\DystopiaOnline.proj.teamcity: Build target: BuildSolution
[13:20:32][src\DystopiaOnline.proj.teamcity] BuildSolution
[13:20:32][BuildSolution] C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.proj(36, 5): error MSB4062: The "DystopiaOnline.Build.Tasks.GetUnixTimestamp" task could not be loaded from the assembly C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Build.Tasks/bin/Release/DystopiaOnline.Build.Tasks.dll. Could not load file or assembly 'file:///C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Build.Tasks\bin\Release\DystopiaOnline.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
[13:20:32][Step 1/1] Step MSBuild failed
However when I run the build from the developer command prompt the build works fine. Taking a look inside the C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\D ystopiaOnline.Build.Tasks\bin only shows a Debug folder rather than a Release folder. Running the build from the developer command prompt works ok just building from Team City doesn't.
shouldn't the Release folder be created when the build is run from Team City with the Env variable set to prod? what could be causing this? Anyone any ideas?
In my project solution .proj file have the following conditions set to determine a build configuration. can anyone with any experience working with team city offer any advice as to what the problem may be? thanks.
<PropertyGroup>
<Env Condition="'$(Env)' == ''">dev</Env>
<VersionNumber Condition="'$(VersionNumber)' == ''">1</VersionNumber>
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)/Tasks</MSBuildCommunityTasksPath>
<UnityPath Condition="'$(UnityPath)' == ''">c:\Program Files (x86)\Unity</UnityPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Env)' == 'dev'">
<BuildConfig>Debug</BuildConfig>
<Domain>mmo.dystopiaOnline.dev</Domain>
<SetParamsFile>Parameters.Local.config</SetParamsFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Env)' == 'prod'">
<BuildConfig>Release</BuildConfig>
<Domain>mmo.DystopiaOnline.com</Domain>
<SetParamsFile>Parameters.Production.config</SetParamsFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Env)' == 'sta'">
<BuildConfig>Release</BuildConfig>
<Domain>mmo.DystopiaOnline.sta</Domain>
<SetParamsFile>Parameters.Staging.config</SetParamsFile>
</PropertyGroup>
TeamCity build log
[11:45:53]Checking for changes
[11:45:53]Collecting changes in 1 VCS root (1s)
[11:45:55]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[11:45:55]Publishing internal artifacts
[11:45:55]Checkout directory: C:\TeamCity\buildAgent\work\8c8eb5050252f271
[11:45:55]Updating sources: server side checkout
[11:45:55]Step 1/1: MSBuild (4s)
[11:45:55][Step 1/1] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\8c8eb5050252f271 "/msbuildPath:C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe"
[11:45:55][Step 1/1] in directory: C:\TeamCity\buildAgent\work\8c8eb5050252f271
[11:45:59][Step 1/1] src\DystopiaOnline.proj.teamcity: Build target: BuildSolution
[11:45:59][src\DystopiaOnline.proj.teamcity] BuildSolution
[11:45:59][BuildSolution] MSBuild
[11:45:59][BuildSolution] C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.proj(36, 5): error MSB4062: The "DystopiaOnline.Build.Tasks.GetUnixTimestamp" task could not be loaded from the assembly C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Build.Tasks/bin/Release/DystopiaOnline.Build.Tasks.dll. Could not load file or assembly 'file:///C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Build.Tasks\bin\Release\DystopiaOnline.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
[11:45:59][Step 1/1] Process exited with code 1
[11:45:59][Step 1/1] MSBuild output
[11:45:59][Step 1/1] Step MSBuild failed
[11:45:59]Publishing internal artifacts
[11:45:59]Build finished
This is how my project setup look witht the build folder.
link to .proj file on OneDrive
Error after copying release file into TeamCity manually
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797, 5): error MSB3027: Could not copy "C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Base\bin\Release\DystopiaOnline.Base.dll" to "bin\Release\DystopiaOnline.Base.dll". Exceeded retry count of 10. Failed.
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3797, 5): error MSB3021: Unable to copy file "C:\TeamCity\buildAgent\work\8c8eb5050252f271\src\DystopiaOnline.Base\bin\Release\DystopiaOnline.Base.dll" to "bin\Release\DystopiaOnline.Base.dll". The process cannot access the file 'bin\Release\DystopiaOnline.Base.dll' because it is being used by another process.
There is a typo in your DystopiaOnline.proj file in the word "Configuraton":
<MSBuild Projects="DystopiaOnline.Build.Tasks/DystopiaOnline.Build.Tasks.csproj" Properties="Configuraton=$(BuildConfig)" />
I think that this is the reason of the incorrect configuration building.
How have you setup the parameter in the build? It's most likely that it's value is not being passed to the build runner so it defaults to dev
<Env Condition="'$(Env)' == ''">dev</Env>
If you are using teamcity parameters it should be a system or environment parameter. You can also check the parameters used in a build by clicking on it and going to the parameters tabs, might want to double check that it has the value you want.
First keep in mind, that Windows path is '\' NOT '/'. In normal cases there is not any different (eg. when you want to put path in Explorer), but sometimes (I run in to some problems with some task in MsBuild) the mechanism doesn't recognize that this is proper path. So change the path to
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)\Tasks\</MSBuildCommunityTasksPath>
(Also MsBuild convention told us to put trailing slash)
And whenever you have reference to "DystopiaOnline.Build.Tasks.dll": [...]src\DystopiaOnline.Build.Tasks\bin\Release\DystopiaOnline.Build.Tasks.dll.
In the build log, there is not any sign that the MsBuild try to build the DystopiaOnline.Build.Tasks. HOW you specify the order of building your projects? Can you add this project that we can see exactly what MsBuild want to do and in what order.
If you use <UsingTask> inside the same project file that want to build DystopiaOnline.Build.Tasks... It will never work, because MsBuild first try to resolve task and then run targets to build.
It could work on your machine when you already build the project but not in clean environment when there is not (yet) any task.
try creating new system parameter called system.Configuration and set value "Release"
I'm trying to develop a Notepad++ plugin using a nppPlugin.netV0.6 template.
Downloaded from http://sourceforge.net/projects/sourcecookifier/files/other%20plugins/NppPlugin.NET.v0.6.zip/download
I got a build error [SDK path is empty.]
The same template is working in other system (XP also).
Can anyone give me an resolution for this issue?
The build process calls program ildasm.exe. The directory for that program may not have been added to the PATH environment variable. When I installed Visual Studio 2012 Express installer the directory was not added so I added it to the PATH and the build succeeded.
I tracked the problem down by increasing the amount of logging output written by the build process. (Via Tools => Options => Projects and Solutions => Build and run => MS Build ... verbosity.)
Not sure whether your error is identical. Before adding the directory to the PATH the errors below were generated:
1>------ Rebuild All started: Project: NppManagedPluginDemo.VS2010, Configuration: Debug Any CPU ------
1> NppManagedPluginDemo.VS2010 -> C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll
1> ILDasm: calling 'ildasm.exe' with /quoteallnames /unicode /nobar /linenum "/out:C:\Users\Adrian_2\AppData\Local\Temp\tmpAB1F\Demo.il" "C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll"
1>C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\DllExport\NppPlugin.DllExport.targets(8,5): error : The system cannot find the file specified
There are several versions of ildasm.exe in sub directories of c:\Program Files (x86)\Microsoft SDKs\Windows\ of my current computer.