Quantcast
Channel: MSBuild forum
Viewing all 2763 articles
Browse latest View live

Consuming Visual studio extension SDKs in a remote build (CI).

$
0
0

Hi All,

 

I am new to .NET and developing an universal Windows application.

 

I am using Visual Studio extension for SQLite for WinRT and Windows Phone.

 

http://www.sqlite.org/2015/sqlite-wp81-winrt-3080801.vsix

http://www.sqlite.org/2015/sqlite-winrt81-3080801.vsix

 

I can perfectly install the extensions and work with locally.

 

My question is about the remotely building (continuous integration) of my application through msbuild in TFS.

Does the build machines need to have the same version of SQLite SDKs installed manually in order to resolve the dependency ?

 

There can be multiple project in my TFS collection which can refer to separate version of VSIX files . Both versions can not co exist together. What happens then ?

 

 

Can I somehow upload the vsix file to our package management software (Nexus) and refer from there.

We have been building other dependencies as Nuget packages from Nexus.

There might be number of packages required for different architecture and other component's packages.

 

Any help will be hugely appreciated.

 

 

Thanks and Best Regards,

Saurav


Publishing using MSBuild without forcing a rebuild of the project

$
0
0

I am using a multi-step build process to build out my solution including a step where I am versioning my assemblies and then building my project.

It seems that the MSBuild Publish step outlined in this article: http://sedodream.com/2013/09/21/HowToExtendTheWebPublishProcessWithoutModifyingProjectContents.aspx forces a rebuild of the project regardless of whether I need a build or not.

Is there a way to simply just Publish the contents of a project without requiring a build/rebuild of the project?

Please advise.

Thanks.

SSIS 2005 TFS 2013 msbuild questions

$
0
0

I am tasked with building packages with a certain version or label and then deploying them to our production environment.

A suggestion was made to look at an article, but I feel that until I am able to invoke msbuild with a command line, then I should not try anything else, but I am open to being corrected on that point.

 http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx

So, when I try a command line for msbuild, it complained that ssis packages are not supported.  A suggestion was made that I use a blank c# project.

So, now I have this for the project file: 

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
   <PropertyGroup>
      <OutputPath>Bin</OutputPath>
   </PropertyGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="BeforeBuild">
      <!-- Build the analysis SSIS project -->
      <Exec Command="&quot;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\devenv.exe&quot; C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\ETFG_Transfer.sln /Build Debug /project C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\ETFG_Transfer.dtproj" />
  </Target>
</Project>

Now I get an error when I issue this command line:

msbuild.exe "C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\msbuild_projectfile3.dtproj" /l:FileLogger,Microsoft.Build.Engine;logfile=C:\Temp\ETFG_Transfer_Build.log;verbosity=Diagnostic;encoding=utf-8

"C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\msbuild_projectfile3.dtproj" (def
ault target) (1) ->
(CoreCompile target) ->
  CSC : warning CS2008: No source files specified [C:\ETL\SSIS\2005\ETFG_Transf
er\ETFG_Transfer\msbuild_projectfile3.dtproj]


"C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\msbuild_projectfile3.dtproj" (def
ault target) (1) ->
(CoreCompile target) ->
  CSC : error CS5001: Program 'c:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\obj
\Debug\msbuild_projectfile3.exe' does not contain a static 'Main' method suitab
le for an entry point [C:\ETL\SSIS\2005\ETFG_Transfer\ETFG_Transfer\msbuild_pro
jectfile3.dtproj]

    1 Warning(s)
    1 Error(s)

Thanks for the help!

VC++ 2013: warning MSB8028 when server cpp files have same name in same project

$
0
0

Example folder layout:

main.cpp

Furniture/Table.cpp

Furniture/Table.h

Data/Table.cpp

Data/Table.h

This causes an issue since both Table.cpp files are built to Table.obj in the interim folder x64\Release

Ideally the temporary location could instead be x64\Release\Data\ and x64\Release\Furniture respectively.

This would suggest changing the "Object File Name" property in the project settings [Configuration Properties / C/C++ / Output Files / Object File Name]. But I can't see which Macro would refer to the source folder. Also since the compiler is more aware of the filter rather than the directory, perhaps it should be an issue of filter?

Thanks in advance

Elliot

This issue is slightly related to 

https://social.msdn.microsoft.com/Forums/en-US/2b687f47-359d-463d-996d-c134e7af9872/vs2013-warning-msb8028-when-several-vcxproj-files-reside-in-same-directory?forum=msbuild

but is distinctly different (multiple cpp files with same names in same project, not different projects sharing same folder)

Override One Property in a .targets file

$
0
0

Hello,

I have a question about MSBuild (asked on Stack Overflow) that seems to have stumped the community. I was wondering if someone here might be able to give some advice. Thank you!

The question is as follows:

Background: I have several solutions with roughly 300 C++ projects across them, most of them shared across solutions. We are using Visual Studio 2013 and have a build script that compiles all of the projects in the correct order, ensuring dependencies are resolved ahead of time. Our development/engineering team builds all of the code through the build script and then attempts to test/debug using Visual Studio 2013.

Issue: The "build then debug" process results in Visual Studio telling us that the Projects are out of date. This stems from the ProjectEvaluationFingerprint property (in Line 39 Microsoft.CppBuild.targets) including a $(SolutionDir) in the output file. The recommended fix from Microsoft suggests removing the $(SolutionDir) from the file. As our developers tends to transition back and forth between projects, I do not want to manually change this .targets file on every developer's machine (and remember to change it back when they leave the project). I would like to override the property in the .vcxproj by using a .targets file explicitly for this.

The property in Microsoft.CppBuild.targets looks like:

<!-- Global up-to-date check support --><PropertyGroup><ProjectEvaluationFingerprint>$(Configuration)|$(Platform)|$(SolutionDir)|$(ProjectEvaluationFingerprint)</ProjectEvaluationFingerprint></PropertyGroup>
Generally, I have been following Microsoft's How to: Use the Same Target in Multiple Project Files. I have created a .targets file (test.targets) that contains the following code (note the TEST text was to test evaluation of the property in both the build script and building the project in Visual Studio):

<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><ProjectEvaluationFingerprint>$(Configuration)|$(Platform)|TEST|$(ProjectEvaluationFingerprint)</ProjectEvaluationFingerprint></PropertyGroup></Project>

I then import it using the following line in the .vcxproj

<Import Project="..\..\Config\VSPropertySheets\test.targets" />

The project.lastbuildstate file now reads:

#TargetFrameworkVersion=v4.0:PlatformToolSet=v120_xp:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit

Debug|Win32|D:\views\devbranch\Products\SLN\|Debug|Win32|TEST|

It is appending the new ProjectEvaluationFingerprint to the existing one, so it is notoverriding (I can understand this to a degree, but I'm no MSBuild expert).

Question: How can I override this one property using a .targets file? Do I need to use a replaceregexp task or do I have an easier option?

Multiple warnings about targeting frameworks when building in VS 2012

$
0
0

I have a solution where I just updated all the projects to target the .NET Framework 4.5.1 (previous framework where 4.0)

When doing builds/rebuilds in visual studio 2012 I get a bunch of warnings similar to this one:

The primary reference "XXX.Frontend.CustomControlLibrary.dll" could not be resolved because it has an indirect dependency on the assembly "XXX.Entity, Version=2.5.0.0, Culture=neutral, PublicKeyToken=5d0dd45c83e6c225" which was built against the ".NETFramework,Version=v4.5.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5".C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

I've checked all my projects and the targeting framework is set to 4.5.1. 

In the Error list window all warnings have the architecture project in the project column and the file column says Microsoft.Common.targets.

In Visual Studio 2013 I don't get these warning. 

On the build server the warnings return. 

Can anyone help?

How does msbuild identifies an installed SDK

$
0
0

Hi,

I want to have a better understanding about how msbuild searches for installed SDKs.

I got detailed msbuild logs (used the option /v:diag) while building a windows store app solution using VS2015 CTP. From the logs I could infer the following:

The MSbuild task "GetInstalledSDKLocations" searches the installed SDKs using macro "SDKRegistryRoot". In my case these have following value:

SDKRegistryRoot="Software\Microsoft\Microsoft SDKs"

The logs also displays : SDK "Microsoft.VCLibs, Version=12.0" is installed at "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\"

But if I see the registry "Software\Microsoft\Microsoft SDKs" for list of SDKs, the key "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1\Installation Folder" has value "C:\Program Files (x86)\Windows Kits\8.1\".

Now I am confused as to where the SDK is actually installed? Is it installed at "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\" or at "C:\Program Files (x86)\Windows Kits\8.1\" ?

Thanks,

Kunal

Build Problem with C# and COM+ Interop - error MSB3395: Cannot unregister assembly

$
0
0

Hi,

We are in the process of automating our build process and are having one recurring build error.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(845,9): error MSB3395: Cannot unregister assembly "D:\Projets\bin\SvcA.dll". Could not load file or assembly 'Interop.OTHERCOMLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=674c15da12d77f4e' or one of its dependencies. The system cannot find the file specified.
SvcA.dll is the C# DLL we are trying to build.
OTHERCOM is a COM+ Dll that SvcA nees to access. Therefore, the Interop Interop.OTHERCOMLib is automaticall built.
The COM+ DLL and the interop are sitting in the same directory as SvcA (D:\Projets\bin\).
This happenned only one time through VisualStudio 2005, but is there quite often (if not every build of that module) on our automated builds. We have 2 versions, one with NAnt and the other through a batch file. Both use MSBuild in the background to build this. Both method give us this error.
We have tried many options to see what can be preventing the unregister, or the "cannot find file" to the best of our knowledge, but are still not finding the cause.
Any help to find the root cause would be appreciated.
Regards,
nick

TFS Build Error

$
0
0

Hello All,

I am using VS 2013 community and TFS 2013

I have created build definition using default build template 11.1.

I have modified the default template for building my setup using devenv command and used copy command to copy the msi file to the drop location.

Below is the code :

<Target Name="AfterCompile">
    <Message Text="Building"  />
   <Exec Command="&quot;$(Program Files (x86))\Microsoft Visual Studio 9.0\Common7\IDE\devenv&quot; &quot;$(SolutionRoot)\Solution.sln&quot; /Build &quot;Release|X86&quot; /Project &quot;Setup1&quot;" />

    <Message Text="Drop" />
    <Copy SourceFiles="$(SolutionRoot)\SetupFolder\Release\*.msi" DestinationFolder="$(DropLocation)\Release"/>

</Target> 

But this is not working, even the messages are not written to log file.What could be wrong ?

Also , I have tried using Upgraded Template but i am getting following error for checkout command

MSB3073: The command ""C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\tf.exe" checkout AssemblyInfo.cs /recursive" exited with code 100. 

When ran this command on command line i received error "could not load file or assembly 'microsoft.teamfoundation.versioncontrol.controls"

I am stuck with this issues.

Please provide help asap.

Build for x86 not working

$
0
0

Hi

My development machine is Win 7 x64. I need to deploy to x86 Win XPs.

I am running the following batch file to build project as x86 and copy compiled assemblies to a c:\Events 2014 Deployment folder;

echo 1. Building project, please wait..."C:\Program Files (x86)\MSBuild\12.0\bin\msbuild" "c:\Events 2014 Temp\Events 2014.sln" /verbosity:m /property:Configuration=Debug;Platform=x86

md "c:\Events 2014 Deployment"

echo 2. Copying files, please wait...
xcopy "c:\Events 2014 Temp\Events.Win\bin\x86\Debug\*.*"             "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.Module.Win\bin\x86\Debug\*.*"      "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.Module\bin\x86\Debug\*.*"          "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.Common.Win\bin\Debug\*.*"          "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.Common\bin\x86\Debug\*.*"          "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.BusinessObjects\bin\x86\Debug\*.*" "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y
xcopy "c:\Events 2014 Temp\Events.BusinessObjects\bin\x86\Debug\*.*" "c:\Events 2014 Deployment\*.*"     /E /V /H /R /D /Y

del "c:\Events 2014 Temp\*.*" < y

However when I run the executable from c:\Events 2014 Deployment folder I get 'its not a valid Win32 application'. 

What am I missing?

Regards





How can one see the substituted comands in a build event.

$
0
0
I am trying to debug a command in a post-build build event and would like to see the command after substitutions are done.  The command that I have put tin the build event is to run a .exe file and I am getting the .exe to run, but I am not correctly passing command line arguments to the .exe and it is tough to debug what one cannot see.

Clayton

TFS & VS 2012: Passing a TFS Build variable in as a custom property to MS Build

$
0
0

 I think this is a simple question but I can't find the answer.  TFS Build server is 2012, using VS 2012.  I would like to pass the value of TF_BUILD_BUILDDIRECTORY  to MSBuild as a build argument.  I assume this is a 2012 tf variable and not 2013.  In a custom TF build template I am using the variable BinariesDirectory to copy all project output into their own directories. I am attempting to do this by setting the MSBuild Arguments setting of the Build definition to /p:tfs_Binaries_Directory="$(TF_Build_BinariesDirectory)".  I assume that this is the correct variable name for it in 2012.  Am I missing something?

I want to use this variable in a Post Build event of the solution being built to copy out some additional data that needs to be deployed as part of the build.

Thanks,

John Sheppard

how to resolve warning LNK4229: invalid directive '/comment:'

$
0
0

I am using intel compiler 11.1 to compiler my code and use VS2008 to link the objs. here are the setup details:

OS: Windows server 2008 R2

Compiler: Intel c++ compiler 11.1 (64bit)

Linker: Microsoft linker provided by VS2008

SDK: v7.0A

Following is the warning i get while trying to link the dll.

<Source File>.OBJ : warning LNK4229: invalid directive '/comment:Intel(R) C++ Compiler for applications running on Intel(R) 64, Version 11.1    Build 20100806 

can you help me identify whats i am missing here which is causing this warning.

Calling MSBuild from powershell scipt

$
0
0

Hi,

I am trying to call below line of code from powershell script. But it is giving an error..Installer.target file exists in the same location (C:\Projects\Main\src>). What is the wrong with below code? Could you please advise.

PS C:\Projects\Main\src> "C:\Program Files (x86)\MSB

uild\12.0\Bin\MSBuild.exe" installer.targets /target:Installer /p:Version=1.0.8.
0"
Unexpected token 'installer.targets' in expression or statement.
At line:1 char:72
+ "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" installer.targets <<<<
 /target:Installer /p:Version=1.0.8.0"
    + CategoryInfo          : ParserError: (installer.targets:String) [], Pare
   ntContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

error MSB3323: Unable to find manifest signing certificate in the certificate store.

$
0
0
Problems began when I received the MSDN Final VS 2005 v8.0.50727.42 and uninstalled the RC build which I had worked with without issue and replaced it with the previously mentioned.

After four or so installs/uninstalls I got past the Invalid license data. Reinstall is required. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=162712&SiteID=1

I have tested C++ project builds for managed and unmanaged code and both work without a problem. My C# projects however fail to build, the error I get is:

------ Rebuild All started: Project: D And P, Configuration: Release Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB3323: Unable to find manifest signing certificate in the certificate store.
Done building project "D And P.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

If anyone has any idea of what a next step is please let me know.


install asp .net mvc 5 on server

$
0
0
I am trying to install asp .net mvc 5 in windows ms build server and it seems to be looking for Visual Studio 2012?
Does that mean, we will have to install complete visual studio 2012 in our ms build servers?  we don't want to do that. Is there any work around available?
We are also planning to install light switch to support .net application builds. How do we proceed for the same ?

How to Transform Web.config without compiling the entire projects with command line?

$
0
0

I have 8 transformations, like the following command to produce each configuration, it compiles 8 times to complete the transformation.

Really need to transform web.config only that take < 1 second

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe A.csproj /t:TransformWebConfig /p:Configuration=Debug-Production;OutputPath=obj/Debug-Production

Thanks

Darren

How should .proj files work in c#?

$
0
0

I've been studying over the last couple days the articles on MSDN regarding configuration of MSBuild.  Suffice it to say I'm probably knowledgeable enough now to be dangerous as I've learned a lot but am still learning how to apply it.  This may sound like a dumb question (and for that I apologize) but some of the examples were *.proj files.  I know that I can create .target files and Import into the .csproj files of individual projects.  My question though is with regards to the *.proj files.  

  • How are these used?  
  • Do they have to be manually ran through the command prompt?  
  • Also, one article mentioned organizing your configurations based on the layers of the application beginning with a dirs.proj file.  How does this work?  Do you incorporate this into the solution somehow?  Does it have to be manually ran through the command prompt?  

Most of my work has been smaller applications.  I am now working on a much larger one with several assemblies stored associated to a baseline framework and several more associated to integration of a product line domain.  I need to coordinate the builds with a modified configuration, but to say that I need to run it through the command prompt does not seem feasible either as it's not that large to worry with.  

  • How do you use these files (or other better format if I'm not seeing something else) in a way that I can still use F6 to build in Visual Studio?

Jason

error MSB4057: The target "PlatformPrepareForBuild" does not exist in the project._

$
0
0

Hi to all,

I tried to compile my .sln with VS2010 but I had this error.

error MSB4057: The target "PlatformPrepareForBuild" does not exist in the project.

It occurs only compiling with win32 configuration but not with x64 one.

Ideas?

Thank you in advanced

Help a newby with BeforePublish Target

$
0
0

There are a number of tasks I would like to accomplish as part of the publishing routine without having to run scripts independently of VS(2013). So I am trying to learn how to use MSBuild by adjusting files. Here's what I've failed at so far.

- Objective (1, for now) is to backup the existing application folder at the source

- I've added a property,<publishBackup>, to the publish.xml file, specifying where to backup

- Then added this to the .csproj file

  <Target Name="BeforePublish">
    <Message Text="Before Publish START" />
    <Copy Condition="'$(Configuration)|$(Platform)' == 'LSATest|AnyCPU'" 
SourceFiles="'$(publishUrl)'\**\*.*" 
DestinationFolder="'$(publishBackup)'" 
SkipUnchangedFiles="true">
<Output TaskParameter="CopiedFiles" ItemName="SuccessfullyCopiedFiles"/>
    </Copy>
    <Message Text="Before Publish END" />
  </Target>

- I would have expected to get a message at least. The publish succeeds, but the copy doesn't happen. Am I totally out-to-lunch, is adding tasks like this a fool's errand, or is there a simple solution to this? Thanks all.

Viewing all 2763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>