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
Related
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.
I have a VS2010 TFS Build server configured with a build definition set for continuous configuration.
For my BizTalk 2010 solution I have 200+ tests. These tests all run ok on my dev box but on the build server, for the tests dealing with flat-files, I get the error "Unable to find Microsoft.BizTalk.Tom.resources". My guess is that this is a resource file contained within the assembly Microsoft.BizTalk.TOM.dll Although I've used reflector and can't see the resources.
It turns out Microsoft.BizTalk.TOM.dll is a .Net 2 dll that is installed with BizTalk into the following folder:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies
I've checked the build server and confirmed that this assembly is present, in the above folder.
I have tried the following, based on 3 different blog postings around the same issue:
Included a reference to dll and set copylocal to true
Added the assembly to the .Net 2 GAC
Added the assembly to the "Additional files to deploy" list from the Test Settings dialog / Deployment tab
Added the assembly to the "Folders to use when tests are run" list from the Test Settings dialog / Unit Test tab
After the tests fail I check the \TestResults\Out folder. I can see that the Microsoft.BizTalk.TOM.dll has been copied here.
When I check the equivalent folder on the dev server I don't see any files that aren't present on the build server.
Any ideas what I can try next please?
I found a copy of the Microsoft.BizTalk.Tom.dll in the folder: C:\Users\tfs_service\AppData\Local\assembly\dl3\randomname\
After researching, it turns out this is where "Shadow Copies"of assemblies are stored: what is cache AppData\Local\assembly\dl3?
I would like it know why shadow copies are being made and how I can prevent it, I guess in my case the app domain is MsTest?
I deleted the shadow copies and uninstalled from the GAC, so that I was left with copies in only the following folders:
C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies
C:\Program Files (x86)\Common Files\Microsoft BizTalk
After deleting the shadow copies and and restarting the server, the tests now run successfully.
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.
I am really new to TFS 2010 automated builds.
I am trying to setup an automated build for a project I am working on. Locally if I build the project it compiles as I expect it to without any errors.
If I trigger my build definition the build fails telling me that one of my .cs files is missing a namespace for a referenced project.
I have checked the reference and it's set to copy local, is there another reason why my build server doesn't think that the .dll is there?
Any pointers would be great!
My guess is that you are referencing a DLL that you have on your local machine, but that doesn't exist on the build server. My suggestion is looking at the build server build log and looking for any build warnings about unable to find references.
Chances are you need to add the DLL's to TFS and update the project references to reference the relative path in the source tree.
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.