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

Where is 'ToolPath'?

$
0
0

While attempting to transition from TFS 2010 to TFS 2013 a build agent that formerly worked flawlessly is now failing with

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (2318): Task failed because "resgen.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "resgen.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx35Tools-x86. You may be able to solve the problem by doing one of the following:  1) Install the Microsoft Windows SDK.  2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task.

In this case the correct SDK is installed, VS 2010 is installed, the registry key is correct which only leaves 'pass the correct location to toolpath.

How does one 'pass the correct location into the "ToolPath"'? Where does this particular property exist and how does one set it?


Richard Lewis Haggard


com not registering out of Visual Studio

$
0
0

I have a com object/.net dll that registers fine when building it inside Visual Studio 2013, but when I try to install it on another box or even on the Dev box I can't seem to get to register.

I tried these commands to register it:

SET "REGASM=C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe"


%REGASM% lhcccomcomponent.dll /tlb

and

%REGASM% lhcccomcomponent.dll

But when I call it from a htm file it does not load.

When I build it insde VS 2013 I can call it from the htm file.

How to disable trimming spaces in ReadLinesFromFile

$
0
0

Hello,

The action 'ReadLinesFromFile' trims heading spaces from my SQL file which result in unreadable script being deployed into DB.

According to this open source implementation of the action, the trimming is unconditional. Is there any workaround?


Regards, Leo

MSBuild: parallel builds and .Net projects

$
0
0

I've written a MSBuild project files which try to build in parallel all the configs of my VS2010 solution:

Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"><ItemGroup><BuildFile Include="$(SourceRoot)MyProject.sln" /><Config Include="Debug"><Configuration>Debug</Configuration></Config><Config Include="Release"><Configuration>Release</Configuration></Config></ItemGroup><Target Name="BuildAll" Outputs="%(Config.Configuration)"><Message Text="Start building for configuration: %(Config.Configuration)" /><MSBuild Projects="@(BuildFile)"
             Properties="Configuration=%(Config.Configuration)"
             Targets="Build" /></Target></Project>
And I launch msbuild with:
msbuild /m /p:BuildInParallel=true /t:BuildAll buildall.proj
The problem is that my solution have many .Net projects which all have the same output folder. These projects use also the same external assemblies.

So very often, two output executables are generated at the same time and their dependencies copied at the same time. This leads to errors like:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3001,9):
error MSB3021:
Unable to copy file "xxx\NLog.dll" to "D:\src\Blackbird\shared\bin\debug\NLog.xml". The process
cannot access the file 'xxx\NLog.dll because it is being used by another process.
which I think means: "2 different projects use NLog and try to copy its assembly in the output folder at the same time"...
Is there a way to get around that? I really would like to avoid to modify all the projects in the solution.

Looking at the task source code "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3001,9)", I've seen that it is possible to make msbuild retry the copy:

<Copy
    SourceFiles="@(ReferenceCopyLocalPaths)"
    DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
    SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
    OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
    Retries="$(CopyRetryCount)"
    RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
    UseHardlinksIfPossible="$(CreateHardLinksForCopyLocalIfPossible)"
    Condition="'$(UseCommonOutputDirectory)' != 'true'">
I've try to set the variables CopyRetryCount, CopyRetryDelayMilliseconds, ... I was hoping that if the copy fails, another copy done a few milliseconds later would succeed. But I've been unable to set these parameters. How can I change them?

Is there another solution?



How to build a typescript project into release directory in visual studio 2013

$
0
0

Here is the tools details.

"

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0444002-02633
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0444002-02633
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0444002-02633
Microsoft Visual Basic 2013

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio
ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure
Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools
Node.js Tools   1.0.30324.01
Adds support for developing and debugging Node.js apps in Visual Studio
Node.js Tools - Profiling   1.0.30324.01
Profiling support for Node.js projects.
NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

"

Building the typescript project in visual studio, builds the js files into the same directory as the source directory.

Is there a way to build the project into the release (say obj\Release) directory ?

Rabindra

COM assemblies are failing upon RegisterAssembly target. "XXXX.dll is not a valid assembly"

$
0
0

I'm using Windows Server 2012 R2. I have .NET 2.0, .NET 3.5, .NET 4.0 installed. There is a target where we register our COM assemblies and it calls this msbuild target and fails. I'm unable to debug what's going on. I tried doing this step manually (i.e. regasm from both the x64 and x86 versions of .NET 4.0 and it works). It does fail if I try to use the .NET 2.0 version. I'm assuming this step is trying to use .NET 2.0 and is failing? How do I force it to use .NET 4.0? 

The assembly does not have interop on, and is built with AnyCPU against the 4.0 framework.

Best,

Miguel

How to always fail to build for certain platform

$
0
0

I'd like to add something to my .vcxproj to make it cause an error if you build it for the x64 platform.  (The motivation is that some developers keep trying to add it and there's no safety mechanism in place to prevent it from happening again.)  So that has lead me to this MSBuild puzzle.

I tried adding an extra target to DefaultTargets named Check that has anError task:

<Project DefaultTargets="Build;Check" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><Target Condition="'$(Platform)'=='x64'" Name="Check"><Error Text="This project should not be built in x64 mode."/></Target>

And it works, in that it causes the desired error, but it only happens when you do a "rebuild all".  If you build a second time, it says that the project is up to date and doesn't continue to report the error.

Why doesn't the Error task continue to cause an error in subsequent builds?  What can I do so that it always reports this error, even on subsequent builds?  What did I do wrong?  Can something like this be done?

Error to open VS 2010 C++ project file

$
0
0

After convert the project file from VS 2003 to VS 2010 C++, I cannot open the project file. Here is the error message:

The "HasTrailingSlash" function only accepts a scalar value, but it's argument "$(OutDir) evaluates to "c:\NTL; C"\UTL\" which is not a scalar value. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets

I don't know what this means. All my co-worker have the same setting can open the same project files. I'm the only one cannot open.

Please help!

Thanks!

Donna


DevEnv.com does nothing

$
0
0

Hi,

We have an SSIS project in our solution and to automate the build using MSBuild, we are using a project task which invokes devenv.com to compile the solution and copy ".ispac" file to a folder.

Below is the script mentioned in .proj file which is compiled by MSBuild

<Target Name="SSISBuild"><PropertyGroup><DEVENV>C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com</DEVENV><SSISProjPath>../ProjectFolder/MySolution.sln</SSISProjPath></PropertyGroup><Exec Command="&quot;$(DEVENV)&quot; &quot;$(SSISProjPath)&quot; /build Release /Project ProjectName"/></Target>

It is working fine most of the time, but sometimes our build stops at this step, which invokes devenv.com and does not exit. I even tried to append the output of devenv command using:

/out c:\temp\SSISProj.log

But all it does is start the process and logs:

------ Build started: Project: ProjectName, Configuration: Release------

Please help me to resolve this, I see the process has started but it is not performing any operation.

Visual Studio Publish Manifest file error

$
0
0

Using clickonce, my VB.Net 2013 app fails to run with a missing manifest file error:

PLATFORM VERSION INFO
 Windows    : 6.2.9200.0 (Win32NT)
 Common Language Runtime  : 4.0.30319.34014
 System.Deployment.dll   : 4.0.30319.34243 built by: FX452RTMGDR
 clr.dll    : 4.0.30319.34014 built by: FX45W81RTMGDR
 dfdll.dll    : 4.0.30319.34243 built by: FX452RTMGDR
 dfshim.dll    : 6.3.9600.16384 (winblue_rtm.130821-1623)

SOURCES
 Deployment url   : withheld

IDENTITIES
 Deployment Identity  : TeeShirt.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0d23f3063317ed13, processorArchitecture=msil

APPLICATION SUMMARY
 * Installable application.

ERROR SUMMARY
 Below is a summary of the errors, details of these errors are listed later in the log.
 * Activation of F:\TeeShirt.application resulted in exception. Following failure messages were detected:
  + Downloading   teeshirt.exe.manifest did not succeed.
  + Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.
  + Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.
  + Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
 No transaction error was detected.

WARNINGS
 There were no warnings during this operation.

OPERATION PROGRESS STATUS
 * [4/17/2015 5:01:20 AM] : Activation of F:\TeeShirt.application has started.
 * [4/17/2015 5:01:26 AM] : Processing of deployment manifest has successfully completed.
 * [4/17/2015 5:01:26 AM] : Installation of the application has started.

ERROR DETAILS
 Following errors were detected during this operation.
 * [4/17/2015 5:01:26 AM] System_Deployment.Application.DeploymentDownloadException (Unknown subtype)
  - Downloading file: Files/TeeShirt_1_0_0_0/TeeShirt.exe.manifest did not succeed.
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
   at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
   at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
   at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
   at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
   at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)
   at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
   at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
   at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
   at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
  --- Inner Exception ---
  System.Net.WebException
  - Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.
  - Source: System
  - Stack trace:
   at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.FileWebRequest.GetResponse()
   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
  --- Inner Exception ---
  System.Net.WebException
  - Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.
  - Source: System
  - Stack trace:
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
   at System.Net.FileWebRequest.GetResponseCallback(Object state)
  --- Inner Exception ---
  System.IO.DirectoryNotFoundException
  - Could not find a part of the path 'F:\Application Files\TeeShirt_1_0_0_0\TeeShirt.exe.manifest'.
  - Source: mscorlib
  - Stack trace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
   at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
 No transaction information is available.

Issue with building solution file using devenv.exe

$
0
0

Hi,

I am facing an issue while building my solution file (developed in Visual Studio 2010) using devenv.exe from command line. The error is as below.

C:\Code\trunnk\common\Controller\Controller.vcxproj : error  : The expression "[System.IO.Path]::Combine(C:\Code\trunk\common\Controller\, "C:\Code\trunk\out/Release/x64"\Controller.exe)" cannot be evaluated. Illegal characters in path.  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets

Could you please help me in understanding the above error and fixing it.

old MSBuild3.5 and BuildProjectReferences with vcproj

$
0
0

I have old project which still building with msbuild3.5(vs2008). when i set BuildProjectReferences=false - msbuild project still continues to search dependency projects. How can switch off searching dependencies for msbuild3.5?

msbuild /t:GuardedGUI:ReBuild /p:Configuration="Release" /p:Platform="Win32" /p:BuildProjectReferences=false /v:d "d:/Modules/BuildAllModules/BuildAllModules.sln"

MsBuild for web site

$
0
0

Hello

i have a web site which is plain js and HTML5. I have publish.xml and publishproj using which i use  the below command.

msbuild.exe website.publishproj /p:DeployOnBuild=true   /p:PublishProfile=WebPub.pubxml /p:VisualStudioVersion=11.0

It is working fine and creating the zip but it is creating under users\Appdata\Local\... 

Can i Specify output path something like "D:\Project\A" ?

 

How to Clear the Enable the Visual Studio hosting process check box.

$
0
0

I am using Visual Studio 2013 and my project is in C++. When I start Debugging my code then it says that 'The process can not access the file because it is being used by another process.' To resolve this, I found this documentation: https://msdn.microsoft.com/en-us/library/ms185330.aspx 

As explained in step 4 of this documentation: Clear the Enable the Visual Studio hosting process check box..

When I open theProperties on the Project menu, then I did not find any 'Debug' tab so that by clicking on it, I can clear the Enable the Visual Studio hosting process check box. How can i do it ? Is there any similar video for explaining it little bit more ?

Thanks.

TFS integration - "Build solution" after Get Latest did not build

$
0
0

I'm more than a little surprised that this happened. Using VS 2013, I checked in some changes that involved moving some code to a new file; the changed files were the original file, the new file, and the project file for the project. (The project was the main project for the solution, but that seems unimportant.)

On another machine that has VS 2012, I used "Get Latest Version" at the root of the project in Source Control Explorer; it said "Getting path\newfile.cs", "Replacing path\oldfile.cs", and "Replacing path\project.csproj". I then did "Build Solution" -- and it did nothing --

========== Build: 0 succeeded, 0 failed, 19 up-to-date, 0 skipped ==========

I don't understand how VS 2012 didn't seem to know that changes had been made and that a build would be necessary. Of course it was easy to force a build, but this surprised me a lot.

Is there an explanation?


9009 error

$
0
0

I am doing a nopcommerce site and keep getting the following build error, any ways to fix this are much appreciated:

Error 12 The command "if not exist "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86" md "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86"
xcopy /s /y "C:\Users\Public\Documents\VWD_Webs_09\nop\packages\SqlServerCompact.4.0.8482.1\NativeBinaries\x86\*.*" "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86"
if not exist "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64" md "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64"
xcopy /s /y "C:\Users\Public\Documents\VWD_Webs_09\nop\packages\SqlServerCompact.4.0.8482.1\NativeBinaries\amd64\*.*" "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64"
    if not exist "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86" md "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86"
    xcopy /s /y "C:\Users\Public\Documents\VWD_Webs_09\nop\packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\x86\*.*" "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\x86"
    if not exist "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64" md "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64"
    xcopy /s /y "C:\Users\Public\Documents\VWD_Webs_09\nop\packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "C:\Users\Public\Documents\VWD_Webs_09\nop\Tests\Nop.Data.Tests\bin\Debug\amd64"" exited with code 9009. Nop.Data.Tests


MC2

CopyProtection

$
0
0

Hello,

I've built a msi(setup proj. ) using VS2010 and I want to restrict it for a single windows m/c  i'e user can't copy and run on another windows m/c . precisely i want copy-protection for this msi.. Can anybody please help me the way to do it.

Is orca helpful in this context !! Any tutorial/links regarding this will be helpful.

Thanks in advance

Abhishek

Install MSBuild 14.0 on a build server

$
0
0

I have a solution for Visual Studio 2015 CTP 6 and .NET 4.6 and I'm using a build script that finds a current version of MSBuild on the computer and uses it to build the solution. This works fine with VS 2010 and .NET 4.0 but I'm having trouble with the newer versions.

From installing VS 2015 I know that there's a directory C:\Program Files (x86)\MSBuild\14.0 where the current version of MSBuild is installed. The build script first tries to find this version, falls back to 12.0, and eventually takes the one from C:\Windows\Microsoft.NET\Framework\v4.0.30319.

After installing .NET 4.6 Preview on the build server machine however, no such directory exists in Program Files. Of course the build script then picks the 4.0 msbuild.exe and runs it to build the code. It does work but it also generates lots of warnings about newer-than-expected tools versions (warning MSB3644).

So what do I really need to install on the build server to let it build my .NET 4.6 solution? Is it really the full Visual Studio IDE, with its 12 GB disk usage and whatever licence costs when it's released? Are there any offers from Microsoft for automated build environments that are separated from the developers' machines? (I'm not talking about TFS, that's not what I'm intending to use. We have a GitLab server and just need something to do the CI builds. Currently it's a Jenkins CI server.)

Update:

I found the "Build Tools 2015 Preview" install package and installed it on an otherwise clean machine (that has .NET Framework 4.6 Preview). It does create the MSBuild\14.0 directory and all that, but the build still "cannot resolve" the .NET Framework 4.6 reference and also produces other errors about unknown assemblies like System.Linq. So that's not all, there must still be something missing. I don't know what exactly MSBuild does with a solution file or what those targets stuff is, but it seems to be missing from that Build Tools package. Where can I get it? Can I find it from an installed VS 2015 environment?

SGEN: error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

$
0
0

Hi,

I appollogize if this post is off topic. I have problem wiht publish WebApp MVC.

I have website (MVC) with one Web reference. Build and run in VS working. But when I tried to publish to disk I get error:

SGEN: error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

I have VS2013 Profesional with all updates and Windows 8.1.

If I remove web reference then publishing working. Where can be a problem? Thanks.

How to build a sln file containing c# application and c++ dll's using command line

$
0
0
How can i compile an sln file contating both c# and c++ projects using command line tools?
Viewing all 2763 articles
Browse latest View live


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