MSBuild cannot find reference when executed through TFS build service - reference

I have a solution with reference to Telerik assemblies. The referenced version has been installed on the build server. The issue is that the continuous integration build always succeeded until I upgraded the Telerik assemblies in the solution and on my build server. The build now fails giving the classical:
Could not resolve this reference.
I checked my solution and everything is set to reference the specific version. The most suprising is that if I open the solution locally on the build server, everything will build without a problem... so that means the Telerik assemblies have been published somehow, but for an unknown reason, when MSBuild is called to compile the solution throught the build service, it does not work.
Any ideas?

I had the same problem after updating to the Q3 release.
To solve this, I built the solution with Logging Verbosity set to Diagnostic, and found that MSBuild never bothered to look in the Telerik folder.
So to include that folder in the build, we simply added it by adding a MSBuild argument:
/p:ReferencePath="C:\Program Files\Telerik\RadControls for WPF Q3 2012\Binaries\WPF40"
It's perhaps not the best, and needs to be updated everytime you update RadControls, but it works.
We run the build server on a x86 installation, so Telerik is located under C:\Program Files, but if you run on a x64, it's under C:\Program Files(x86), so if you run several build servers on both x64 and x86 installations, you must specify both path.

Try to remove-then-add reference to updated dlls - you can then see in proj file if there any differences with referenced assembly.
Enable verbose\diag mode for msbuild (/v:diag command line key) and check build logs. Diag mode have very detailed output about referenced library search process.

I normally find it's better to copy the referenced assemblies into the solution and reference them from there. Then the build server and other developers don't need to worry about installing that specific version and you can support multiple projects running different versions of the component.

Related

Visual Studio builds njsproj Node.js project even though there are no changes since last build

I've added a Blank Node.js Web Application project to my solution. It is a *.njsproj the among of other C# *.csproj projects.
The project works fine. Visual Studio build runs npm run build according the package.json. There is only one thing bothering me. The *.njsproj is built everytime I build the solution.
Visual Studio can recognize when there is no change in the C# *.csproj projects and skips them saying they are up-to-date:
========== Build: 1 succeeded, 0 failed, 29 up-to-date, 0 skipped ==========
However, this does not work for the *.njsproj. The npm run build (raised from AfterCompile target in Microsoft.NodejsToolsV2.targets) is executed every single time even though there is absolutely no change in any of the solution projects or files at all.
Is Visual Studio even able to track changes of Node.js project to skip the build or there is no chance to make it work similar to the C# projects?
All the Node.js project files have Build Action set to None.
I think it is impossible. This is related to the VS IDE's internal build mechanism for Node JS projects of this type. And it is designed by that.
And I should tell you that the up-to-date check is a feature for VS IDE. You can try the VS IDE Build and MSBuild command line build msbuild xxx\xxx.csproj -t:build with the c# project, and you will find that:
IDE build will not execute any msbuild system target, and it detects that it should not build again since there is no changes to minimize the workload of MSBuild.
However, when you use msbuild command line, no matter there is no changes, it still invokes the many system default targets which will make a burden with a large solution.
So the up-to-date is a feature for VS IDE which will helps reduce the burden of msbuild.
We could only modify target one by one to skip by inputs, outputs. But this is meaningless since up-to-date is a new detection mechanism which is not dependent on MSBuild and Targets. There is no msbuild function to get the up-to-date under node js projects.
That is an internal mechanism We cannot handle that area, you need to contact the Microsoft product team by VS IDE menu-->Help-->Send Feedback-->Report a problem or that.

References and .dll missing from TFS get latest

I'm having an issue related to team foundation server with Visual Studio 2012.
I've checked in a new solution to the server, however when i get latest version for other machines, most of the references are missing and the .dll files in the bin cannot be located.
Is this because the files are not being pushed when i check in.
Any help is appreciated thanks
In Solution Explorer, right click the DLLs that aren't being included, go to Properties, and be sure that the Build Action is set to "Content".
Check whether you are using MSBuild-Integrated solutions or using Automatic Package Restore. If you use MSBuild-Integrated solutions, migrating MSBuild-Integrated solutions to use Automatic Package Restore.
If you haven't used Nuget to restore package. Check: https://docs.nuget.org/consume/package-restore
Check whether your project link to other projects. Don't reference output assemblies. Make a project reference or create a NuGet package.

How to create a x64 (instead of AnyCPU) build of .Net based Azure Cloud Service?

I'm using Azure 2.7.
I created a C# cloud service that only contains a single worker role. After it's done, the solution contains
A ccproj
A csproj
Both are using the setting of AnyCPU.
I then added the PropertyGroup "Debug|x64" and "Release|x64" into both projects. Also changed the default to x64 for both. As a result, an x64 build.
However, whenever I select "publish" on the "ccproj", I notice that it always builds AnyCPU instead of x64. I cannot find how to force it to build x64 for packaging and deployment.
I then edited both proj file again, and removed the PropertyGroup for "Debug|AnyCPU" and "Release|AnyCPU". After I did this, and when I tried to build x64 again, I got error as:
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(723,5):
error : The OutputPath property is not set for project
'AzureWorkerRoleExample.ccproj'. Please check to make sure that you
have specified a valid combination of Configuration and Platform for
this project. Configuration='Release' Platform='AnyCPU'. This error
may also appear if some other project is trying to follow a
project-to-project reference to this project, this project has been
unloaded or is not included in the solution, and the referencing
project does not build using the same or an equivalent Configuration
or Platform.
I could not figure out how to work around this error.
Any idea on how to force VS to make a x64 build of cloud service and deploy it?
One workaround I found is that: keep AnyCPU property groups, but also put
<PlatformTarget>x64</PlatformTarget>
in the group. Thus the AnyCPU assembly are actually targetting to x64. But this sounds hacky.
Any idea?
Thanks a lot!

Dlls are copied at each build

I have a c# project, that is using nuget-packages, for instance "System.Data.SQLite".
When I build my solution, the project is built each time.
Looking into details, it turns out that the DLLs that belong to packages (that are located in
$(SolutionDir)\packages\$(PackageName)\
) will be renewed before each build, although there is no new version on the server. This results into this each-time-building.
How do I avoid this?
Upgraded nuget.exe to v2.7 solved the problem

generate exe file

i have developed application in visual c++ 6.0,i have do exe of that application,i have done by using icnt.exe(install creator),but when i run my application exe file on other system which does't have the vc++ software it's showing dll files are missing,how could than i downloaded the dll files again it is asking other dll's files.i want run my application without installing vc++ software in windows,how can i solve it,plz help me i'm touble.
How to make Realease build? by default its debug build
thanks for reply.
As a wild guess, you have deployed the Debug build, which depends on DLLs that are not allowed to be shipped.
If that is the case, have VC6 create a Release build and deploy that.
You can verify which DLLs are required by your application with the depends.exe utility that came with Visual Studio.
Edit: The easiest way to get a release build when ready is to use the Batch Build command from the Build menu. It will let you pick among all of the known build types in the project, and choose to either build them clean (recommended) or to just bring them up to date.
It is also possible to switch the GUI to default to the Release build instead of Debug. That is the right thing to do if you actually need to run the debugger on the Release build. Note that both builds include debug symbols. The differences have more to do with which runtime libraries are linked, and certain optimizations such as making the assert() macro have no effect.

Resources