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

VS2019: Choose - When Condition=" '$(Configuration)'=='MyConfig' " not working anymore

$
0
0

I have a configuration named "local". This configuration compiles and links all my custom libraries with my application:

 <Choose>

   <WhenCondition="'$(Configuration)' == 'Local'">

     <ItemGroup>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\Idw.MvcLib\trunk\_apl\Idw.MvcLib.csproj">

         <Project>{751101e1-6d1d-4450-b647-8042ddd1d187}</Project>

         <Name>Idw.MvcLib</Name>

       </ProjectReference>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\LINQtoCSV\trunk\_apl\LINQtoCSV.csproj">

         <Project>{07058bf9-6f86-40ff-ae33-2a4f89b5758a}</Project>

         <Name>LINQtoCSV</Name>

       </ProjectReference>

     </ItemGroup>

   </When>

   <Otherwise>

     <ItemGroup>

     </ItemGroup>

   </Otherwise>

 </Choose>


With other configurations ("test", "production") these libraries are referenced by Nuget with the inversed condition:

   <ReferenceInclude="Idw.MvcLib, Version=2017.3.0.3, Culture=neutral, processorArchitecture=MSIL"Condition="'$(Configuration)' != 'Local'">

     <HintPath>..\packages\Idw.MvcLib.2017.3.0.3\lib\net461\Idw.MvcLib.dll</HintPath>

   </Reference>

With Visual Studio 2019 it takes always the NuGet reference instead of the project ref. I noticed it when I am trying to debug. The debugger issues a "Just My Code Warning": "You are debugging a Release buld of xxx.dll. Using Just My Code with Release builds using compiler optimizations results in a degrades debugging experience (e.g. breakpoints will not be hit)" With Visual Studio 2017 the same project works fine.


link.exe error after retargetting to Visual Studio 2019

$
0
0

I've started to retarget our projects to Visual Studio 2019. I had no issues with projects in a couple of our smaller Solutions. The current project I'm building is generating this error.

1>Generating code
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(725,5): error MSB6006: "link.exe" exited with code -1073740940.

This is with the Release configuration. Building the Debug configuration does not have this error.

I've been searching the forums but haven't found anything that has helped. Does that error code (0xC0000374) correspond to the error codes in winnt.h (STATUS_HEAP_CORRUPTION) ?

Visual Studio is up to date (16.2.0).

Can anyone suggest how I can get passed this link error ?



Visual Studio 2015 not launching. devenv.exe Suspended and terminated immediately after Launch

$
0
0
After re-installing Visual Studio 2015, the studio refuses to launch, even after trying to run as Administrator. On inspecting Task Manager, Devenv.exe starts and runs for a few sec, then is suspended and terminated almost immediately even in resource manager. Thus nothing even starts up on the screen. I have been stuck on this and it is really annoying. I have uninstalled and reinstalled, yet the issue persists. I have done devenv.exe \resetsettings \resetuserdata in comand prompt yet nothing.

Build keeps on failing with Exception Message: The file exists

$
0
0

I have a build which keeps on failing on build server with the exception message as below. Any pointers on where to look for the issue. This started happening from yesterday, previous to that build were running fine. There has been no change in build process.

 1 error(s), 0 warning(s)
$/Fred/NXT/STAGING/Services/FredNXTERXOnline.Interfaces/FredNXTServices.Interfaces.csproj - 1 error(s), 0 warning(s), View Log File
 CSC: An error occurred while writing the output file.
 $/Fred/NXT/STAGING/Services/FredNXTERXOnline.Interfaces/FredNXTServices.Interfaces.csproj compiled
$/Fred/NXT/STAGING/Services/FredNXTERXOnline.Interfaces/FredNXTServices.Interfaces.csproj - 1 error(s), 0 warning(s), View Log File
 No Test Results
 No Code Coverage Results
Other Errors and Warnings
 3 error(s), 0 warning(s)
 An error occurred while copying diagnostic activity logs to the drop location. Details: The file exists.

 Microsoft.TeamFoundation.Build.Workflow.Activities.BuildProcessTerminateException: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages.
   at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
 Exception Message: The file exists.
 (type IOException)
Exception Stack Trace:    at Microsoft.TeamFoundation.Framework.Common.AsyncOperation.EndT
   at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
   at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

VS2019 C++ post build event command failing

$
0
0

Hi

Migrated an old working C++ solution from VS2013 to VS2019, the post build event commands that (still) work in VS2013 are failing in VS2019 with exit code 1. They simply copy some dlls to the target directory.

post build Event command line: copy /Y “$(SolutionDir)External\aLibrary\*.dll” “$(OutDir)”

Any ideas on what is going wrong?

 

Did MSBuild make $(TargetName_OutDir) property?

$
0
0

Hi all, 

I'm a new developer on Windows 10 with visual studio 2019 community. I have developed for my self a program run with my own libraries, all outputs will be put in the same directory. Few days ago, I went around GitHub open source projects try to have a look to build the way, and I saw the CPython project, the developers used $(py_OutDir) property in apython.props file to set the final outputs of the CPython project.

And I asked that Did MSBuild make $(TargetName_OutDir) property? If the answer is Yes, can someone tell me where I will get more information in thedocs.microsoft.com/en-us/visualstudio/msbuild. As I had tried to get more information on the page, but I only got about the OutDir property.

How do I set up the MFC SDI Tab view?

$
0
0
It succeeded in creating MFC application projects with SDI (CFormVirew -- Basic Class) and creating multi-view windows such as MDI.

But what I want to do is not the format in which a new window is created, but the way it opens in tab format. Is there no way?

I must do so.

Ho to pass additional conditional compilation symbols on msbuild commandline

$
0
0
Hi,
 
I want to add some conditional compilation symbols when invoking msbuild to a solution file.
I tried to use msbuild /p:DefineConstants:MY_DEFINE file.sln, but the problem is that instead of adding MY_DEFINE to the existing list, it replaces it, so if a specific project in the solution has a conditional compilation symbol set, it stops being defined.

When invoking csc directly I can do this easily by passing /D. Isn't there any way to do this in msbuild (whithout requiring to change the individual .csproj's)?

Best Regards,
Gustavo Guerra

How can I debug MSBuild 16.2

$
0
0

For the old MSBuild I could activate debuging for MSBuild in the Registry.

I have a projekt with the new project template "<Project Sdk="Microsoft.NET.Sdk">", so I can't debug msbuild with the old tool.

Old tool: msbuild -h ->

Microsoft (R)-Buildmodul, Version 4.7.3190.0
[Microsoft .NET Framework, Version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
... 

  /debug
                     Sorgt dafür, dass ein Debugger umgehend angezeigt wird, damit
                     Visual Studio angefügt werden kann, um die
                     MSBuild-XML und alle dafür verwendeten Aufgaben und Protokollierungen zu debuggen.

There is no such option for:

Microsoft (R)-Build-Engine, Version 16.2.37902+b5aaefc9f für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

And I can't debug it with the old msbuild either.



Lot of Unnecessary Visual Studio Rebuilds - Tracking Log problem?

$
0
0

Hi - I'm getting an awful lot of unnecessary Visual Studio (2017) rebuilds.  Mine is a big Visual C++ project and all these builds are hitting my productivity badly so all help much appreciated.

I can't detect a pattern to the problem.  My perception is that sometimes it rebuilds practically every file when I've just changed one .cpp file.  Sometimes after a full build, if I hit build again, it will rebuild loads more files.  But sometimes it doesn't rebuild anything because it recognises that everything is up-to-date.

When this happened yet again just now (loads of files being rebuilt for no reason that I could see), I stopped the build and clicked on Tools -> Options. I chose Projects and Solutions -> Build and Run and selected Diagnostic in “MSbuild project build log file verbosity”.  I then restarted the build, waited a while, and checked the log file.  It had more than 10 pages filled with lines like this:

                     <source file>.cpp will be compiled because it was not found in the tracking log. (TaskId:28)


Anyone got any suggestions what the problem could be?


Simon

How to Build Open Source Library .Dll Generation

$
0
0
I am using development environment of windows 8.1 64Bit + Visual Studio 2013 + Qt Creator 5.4.2.

Qt Creator wants to run a project developed as CMakeList.txt. When I run CMakeList, I get an error that the required libraries in that project do not exist.

The libraries are open source libraries, so you can download them from the official website.

FreeType Library (FreeType 2.9.1) &
libpng Library (libpng 1.6.35) &
zlb Library (zlib 1.2.11) &
little cms Library (LCMS 2.9)

I want to use the libraries listed above.

After unpacking the libraries, there is a Project folder inside the folder and Visual Studio.Sln (solution) exists so that you can run Visual Studio Project. I want to build a DLL and register it in the system and let CMakeList run normally.

Release 64 Build in Visual Studio doesn't build due to errors like "~ .h" file not found.

How can I make a DLL file of an open source library?

Thank you

System.ArgumentException Upon Configuring a Service Reference

$
0
0

       So I've been having some trouble with re-coding some of my works Service Processors in order to point from WCF to a Dell Boomi Endpoint for a recent website migration we are under-going, and the service references (which should have all of the classes in it already) are unable to be configured as I just get a System.ArgumentException when I change the address for the endpoint. There is minimal description in the output that helps and I was wondering if anyone has any insight on this, whether something in general settings is wrong or I am going about it wrong.

       I am a little new to Visual Studio as I normally code in Java but I have had to re-adjust for this project for now, so hopefully I am just missing something simple. Let me know if you can help, thanks!

System.ArgumentException Upon Configuring a Service Reference in VS?

$
0
0

       So I've been having some trouble with re-coding some of my works Service Processors in order to point from WCF to a Dell Boomi Endpoint for a recent website migration we are under-going, and the service references (which should have all of the classes in it already) are unable to be configured as I just get a System.ArgumentException when I change the address for the endpoint. There is minimal description in the output that helps and I was wondering if anyone has any insight on this, whether something in general settings is wrong or I am going about it wrong.

       I am a little new to Visual Studio as I normally code in Java but I have had to re-adjust for this project for now, so hopefully I am just missing something simple. Let me know if you can help, thanks!


Build automation for Xbox

$
0
0
Hey guys, How do we create an appxbundle and an appxupload file from a Visual Studio solution (.sln file) by using CLI.? I am trying to automate the process using gulp/shell commands. 

String substitution in the expanded value of %(RecursiveDir) metadata.

$
0
0

Let me preface this by saying that I have almost no experience in hacking on MsBuild. Usually Visual Studio just does what I need. So, it is entirely possible that I am barking up the wrong tree and there is a much simpler way to get to where I want to go.

I am working on getting a Linux with VC++ project up and running. It uses some third party libraries, which we have under source control. These libraries are pre-built and are not part of the VS solution/project files, but are staged via our SCM tool and referenced using "additional include directories" and "additional library directories" settings.

Rather than install the SCM client on the Linux build machine and invoke a sync command as part of the build using the "Remote Pre-Build Event", I was hoping to simply copy the required headers and libraries from the Windows machine to the Linux build target using the "Additional Sources To Copy" setting.

Towards this end, I added an ItemGroup to my vcxproj file and set the "Additional Sources To Copy" setting as follows:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">  <AdditionalSourcesToCopyMapping>
    @(ExtraIncludes -> '%(FullPath) := $(RemoteProjectDir)/%(RecursiveDir)/%(Filename)%(Extension)')</AdditionalSourcesToCopyMapping></PropertyGroup><ItemGroup><ExtraIncludes Include="$(SolutionDir)..\..\deps\libraryXYZ\include\**" /></ItemGroup>

This works fine as long as %(RecursiveDir) is only a single directory level deep. But when there is more than one level, %(RecursiveDir) contains an embedded '\' that needs to change to '/' to work as desired on the Linux machine.

I am aware that I can invoke a function on an item list like @(ExtraIncludes -> Replace('\','/')). This is sort of what I want to do, but I need to perform this on metadata rather than an item list.

So, is there a good way to achieve what I want here, or do I need to stop digging this hole and pursue a different path?

Many Thanks,

Derek Shinaberry


Error creating assembly manifest: access is denied

$
0
0

Hello,

I'm having problems running a Team Build when I give my assemblies a strong name.  The team build works great unless I sign my assemblies.  When I do that I get a "vbc : error BC30140: Error creating assembly manifest: Access is denied."

Here is the error text from the build log:

Target Common:
__________________________________________________
Project "D:\Build\Flin Flon\Release\Sources\FlinFlon.sln" is building "D:\Build\Flin Flon\Release\Sources\Common\Common.vbproj" (default targets):

Target PrepareForBuild:
Creating directory "D:\Build\Flin Flon\Release\Binaries\Release\".
Creating directory "obj\Release\".
Target CoreResGen:
Processing resource file "My Project\Resources.resx" into "obj\Release\IRC.FlinFlon.Common.Resources.resources".
Target CoreCompile:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,
System.Data,System.Diagnostics /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
/rootnamespace:IRC.FlinFlon.Common /doc:obj\Release\Common.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\""
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug:pdbonly /keyfile:FlinFlonCommon.snk /optimize+ /out:obj\Release\Common.dll
/resource:obj\Release\IRC.FlinFlon.Common.Resources.resources /target:library Common.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb"
"My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"

vbc : error BC30140: Error creating assembly manifest: Access is denied.

Done building target "CoreCompile" in project "Common.vbproj" -- FAILED.

Done building project "Common.vbproj" -- FAILED.

 

Any help would be greatly appreciated,

Joel

Make Boolean true available to whole application

$
0
0

My form application open to one of two forms, depending on a Boolean value queried from Program.cs  I have 

public static Boolean object;
in multiple forms.

If true, I assign in Program.cs

object= Convert.ToBoolean(Reader["object"])
In any other form object is false.  How can I get all forms to see true?

MSBuild task: 'ItemGroup' has invalid child element 'SolutionFiles'

$
0
0

Hi,

In a .proj file I have specified a "SolutionFiles" element to the "ItemGroup" element. I got the info fromhere. And it works - but VS2010 complains that the element isn't in the definition. I get this warning:

Warning 1 The element 'ItemGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'SolutionFiles' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'.

I would very much like to get rid of that. Is it a problem with the xmlns url or is it really not a supported element? What I'm doing is to include a file in the build output like this:

<?xmlversion="1.0"encoding="utf-8"?><Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup><SolutionFilesInclude="Repository.cmd"/><DocumentationFilesInclude="..\Documentation\*.*"/><LibFilesInclude="..\Lib\*.*;"/><ToolsFilesInclude="..\Tools\*.*;"/></ItemGroup><TargetName="CopyFiles"><CopySourceFiles="@(SolutionFiles)"DestinationFolder="$(OutDir)"/><CopySourceFiles="@(DocumentationFiles)"DestinationFolder="$(OutDir)\Deploy\Documentation"/><CopySourceFiles="@(LibFiles)"DestinationFolder="$(OutDir)\Deploy\Lib"/><CopySourceFiles="@(ToolsFiles)"DestinationFolder="$(OutDir)\Deploy\Tools"/></Target></Project>

Why does VS complain about that element? Any other options?

--
Werner

 

 

 


VS 2019 build error: Cannot find wrapper assembly for type library MSHTML.

$
0
0
I am trying to build a VB.NET project in the Visual Studio 2019, which has a reference to the Microsoft HTML Object Library. The referenced file is located in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.mshtml.dll".

While trying to build the project I am getting an error: "Cannot find wrapper assembly for type library "MSHTML". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit."

I am using Windows 7 (x64), the project is targeted for "Any CPU". I tried to run the "regasm Microsoft.mshtml.dll" command from the Developer Command Prompt, the command completed successfully, but it did not help.

How can I fix this?

Strong Name Signing Keyset does not exist

$
0
0

Something broke on my development machine as I can not longer create Strong Name Key files and use them in my projects, existing projects that are signed still build fine.

If I create a new console project then in the properties of my project create a new strong name key file and try to build my project I get an error

Error	BC36981	Error extracting public key from container 'VS_KEY_478FB9A0AC084AA5': Keyset does not exist (Exception from HRESULT: 0x80090016)	ConsoleApp3	

I have tried this in VS 2015, 2017 and 2019 all with the same result. I have even gone to the developer console removed it and added it again using sn -d and -i

I feel I have tried every article I could find on this subject all with the same result.

Viewing all 2763 articles
Browse latest View live


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