I'm getting the following error:
Error 17 System.IO.FileLoadException: Could not load file or assembly
'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
File name: 'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' --->
System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
I don't even use github, but it seems like I need to have this reference in.
I have tried adding version 14.0, 14.1, 15.0 and 21, but they all throw this error. It seems like it wants version 14.30212.0 exactly and won't accept any other versions. I've tried to manually change version 14.1 to 14.30212.0 and rebuild it, but since I don't have the .snk or .pfx file to sign it with, the public key is different, so it won't accept that assembly either.
How can I remove this reference completely (Microsoft.Teamfoundation.Build.Activities references it too), or at least where can I find this specific version (can't find it anywhere).
Sorry , I would like to add a comment but I don't have enough reputation. I would like to share with you that I have the same issue. And I found that it seems to be a bug in my case with TFS 2015 CTP/VsoAgent
The LibGit2Sharp version inside C:\Program Files\Microsoft Team Foundation Server 14.0\Tools is a different version that the one that the VsoAgent is looking for. In mi case VsoAgent is looking for Version=0.19.30619.0 but the version installed with the TFS CTP 2015 was 0.17.XXX
Moreover, the LibGit2Sharp version shipped with TFS is a custom one, so is likely that is not going to work if you try to replace it with the one from GitHub.
So, I'm looking at this at the moment. My legacy Git build still working on TFS 2015 but I can't create a vNext currently :(
I finally got it semi-working.
I went on TFS in my custom activities directory and deleted all of the Microsoft.Teamfoundation.* files.
I still get the error when I build my project, but I just set the "Build Action" to "none" on the xaml file's properties, so it doesn't build the xaml file.
The build server now executes like it did before, without throwing the missing assembly error.
If you have a better way of fixing this, feel free to post it and I'll mark it as the answer :)
You should disable strong name signing in order to run the build in VSO. If you have installed VS 2015 CTP, you should use below commands in build agent machine to achieve this:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe -Vr *,*
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\sn.exe -Vr *,*
Please not that the switch -Vr is case sensitive.
Related
I am receiving this type of warning:
##[warning]C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "PatientEquipment".(Should not be looking for the assembly on the C:\Drive.)
Shortly after, I am getting this error:
##[error]Full\Source Code\EA\DeviceApi\Controllers\Prescription.cs(18,31): Error CS0234: The type or namespace name 'BW' does not exist in the namespace 'PatientEquipment' (are you missing an assembly reference?)
I am in the process of moving builds from tfs 2013 to tfs 2017 and know that these builds have worked previously so there should not have to be any changes to the files, only to the build machine and in the tasks I create for the build. What ideas would you have for solving this error?
Open your project files in a text editor (could also open as XML file in Visual Studio) and search for PatientEquipment reference. It should have a HintPath. Make sure that this path is mapped in the build definition. Whether it is a file reference or a project reference, the path to that file (or project) seems to be missing in TFS build mapping
The issue was missing .dll files which were pulled from another project and copied over to another project. On another project, I was having similar issues and just changed the version of Visual Studio that I was using in my tasks. It is interesting that the build needed 2017 instead of 2010 like it had been asking for in one of the csproj files.
Go to concerned DLL, do right click and change Specific version option to False. Build project once again. And try to check-in.
In this way we do not need to change anything in .csproj
I am running into an issue when using a TFS build failing due to not being able to write to the Web.config file. I have a Web.config transformation so I believe it is failing there.
I have compared my TFS build definition to a different project that is working and I do not see any differences. The only thing I can think is that I renamed the TFS project before checking-in.... not sure if that could have caused the issue.
I am using TFS 2013 and Visual Studio 2015
I was able to resolve the issue by removing the TransformXML beforeBuild from my csproj file.
Everything was fine about an hour ago, when i tried to checkin something, the policy friendly reminded me to "provide a comment for the check-in". Then I installed VS2015 Update 1, like some of my colleagues did, and after that, i receive the following error message when trying to check something in:
Internal error in Changeset Comments Policy. Error loading the Changeset Comments Policy policy (The policy assembly 'Microsoft.TeamFoundation.PowerTools.CheckinPolicies.ChangesetComments, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered.). Installation instructions: To install this policy, follow the instructions in CheckForComments.cs.
My colleagues, of course, don't. As far as i know since VS2012 there is no need to install any version of the Power Tools anymore, so why does this happen? Additionally I also have VS2013 installed, where i do NOT get that error message, that version is working perfectly. Anyone having any idea where i need to look?
Okay, i got it. Somehow the installation messed something up. On my machine the folder
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation
was pretty empty, where my colleagues had a junction there, leading to this folder
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\XXXXXXX
where XXXXXX obviously varies from machine to machine. To find the correct one, go to the extensions folder (one up) and look for the one that contains "Microsoft.TeamFoundation.Build.Controls.dll" and some other Teamfoundation dlls, then open an elevated command prompt and create the missing junction like so:
mklink /j "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\XXXXXX"
(watch out, you need to replace the XXXXX with the folder name on your machine)
- NOTE: Please dont forget to RESTART Visual Studio after doing this change in order to start cheking in seamlessly.
The suggested answer didn't work for me on VS 2015. I already had the junction, yet I was seeing the error.
https://devblogs.microsoft.com/buckh/internal-error-loading-the-changeset-comments-checkin-policy/ pointed me to this:
Cause
With VS 2005 through 2010, to get the Changeset Comments policy,
you had to download and install the Team Foundation Power Tools.
and I had to download and install Microsoft Visual Studio Team Foundation Server 2015 Power Tools.
It's available within VS here:
Visual Studio 2015 > Tools > Extensions and Updates:
VS needs to be restarted after this.
I am trying to get the build working on the build agent in TFS. I can successfully build the solution in Visual studio 2012 RC and other developers can do the same in theirs. I created the build definition for the debug configuration and queued the build in TFS server. I get the following error logs.
Error: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1046): The command "IF EXIST ../batch (
cd ../batch
) ELSE (
cd ../../Sources/Solution_Name/Project_Name/batch
)
createDepsFile Project_Name
" exited with code 9009.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1561): Could not resolve this reference. Could not locate the assembly "System.Web.Optimization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1561): Could not resolve this reference. Could not locate the assembly "System.Web.Providers". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Error Global.asax.cs (16): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
I checked the reference added to the projects. I cannot find those assemblies. After looking all over the posts, I found good suggestions like adding those assemblies to the solution using NuGet and then check in the solution in TFS. Missing reference are only "warnings" not error.I still cannot find all the assemblies in the Nuget I am looking for. Some posts referred that the project might be referring to .Net 4.5 instead of .Net 4.0 as installed in the build machine. I do not want to change the solution until I know exactly the problem is. I am scattered on this problem.
At this point I do not think it has something to do with the Build Definition. And Code 9009 is not helping either. I may be wrong. Any suggestions guys need help on this one.
System.Web.Optimization and System.Web.Providers sounds like an ASP MVC project. Anyway please try the following:
Set for the both references the "Copy Local" Property to False.
Save the changes
Set it back to True and trigger a Build.
For me this helped.
Thanks for the response guys. I found the problem. Some of the .dll were not on the right path. I just moved the .dll to one of the place where MSbuild was looking for.
It sounds like you are missing some dependencies on the build server. I'm not sure what you had to install on your developer machine to get System.Web.Optimization and System.Web.Providers, but if it was just VS 2012, then you can try installing VS 2012 on the build agent server.
Consider a .csproj containing the following directive:
< Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
There's a standalone TFS Build service installed on a machine, with a default Controller and one Agent. The TFS components were installed; Visual Studio was not installed.
When compiling an ASP.NET MVC 2 Web Application (targeting .NET 4), the TFS Build service encounters an error:
C:\somepath\foo.csproj (219): The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
TF270015: 'MSBuild.exe' returned an unexpected exit code. Expected '0'; actual '1'.
It's true: there's no sub-directory "WebApplications" in the "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0" directory.
It seems that this subset wasn't included in the install of the TFS Build service. TFS doesn't give any options on what pieces are installed for Build service.
What's the most appropriate way to install these artifacts, and any dependencies, on this TFS Build machine? Could this have been avoided?
Have you tried creating the path C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\ manually and copying the file Microsoft.WebApplication.targets there? If Microsoft.WebApplication.targets doesn't contain references to some specific build tasks that should do the trick.
At least that worked for Visual Studio 2005.
Check for unwanted references like 'stdole.dll' in your references and remove it.
connect to tfs again (to refresh)
try to build again.
Best solution is to always install VS2010 on your build machine.