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

devenv build from VS 2015 command prompt crashes without any messages in logs

$
0
0
I have a Solution with about 90 projects which we had so far been building with Visual Studio 2012. I am trying to migrate it to Visual Studio 2015. But I have run into some strange build issues, looking for some help on that.

From Visual Studio 2015 client, the projects get compiled successfully. But when I try "devenv" build from command prompt, the build exits after some time. The build seems to be crashing. It does not show any error, nor does it report the count of passed or failed builds. I also tried this from "devenv command prompt" under Visual Studio 2015 installation, there also I got the same problem.

Secondly from the command prompt, "Debug" devenv build passes but "Release" build fails. However both /Debug and /Release configuration builds pass from Solution Explorer.

Can someone please help me identify what could be causing this, or how to debug further. Also please help me understand why a build fired from command prompt is behaving differently from the build in Solution Explorer.

Microsoft.Common.CurrentVersion.targets(1657,5): error MSB4036: The "GetReferenceNearestTargetFrameworkTask" task was not found.

$
0
0

I am receiving this error on Teamcity when I am building a .csproject.

However, I am not receiving this error locally on my Visual studio 2017. 

The teamcity build server does not have any internet connection and I am unable to download anything on the server.

I researched many blogs but could not resolve the issue. Could you please help me in this regard.

Thanks

Vijaya

C:\Program Files (x86)\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): error MSB4036: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\15.0\Bin" directory. 

MSbuild project build verbosity

$
0
0

Hi,

I'm doing some team settings file (.vssettings) and I was looking into logger. 

the "MSBuildOutputVerbosity" is located inside the file, no problem here. But I cannot find the MSBuild Log File Verbosity option in the said file. I can change it in Options -> Projects and Solutions -> Build and Run and it does something and propagate on all my vs instances. But I'm not able to find the option in the file, is it the wrong one

Thanks for the time!

"because it is being used by another process" error has me dead in the water.

$
0
0

I've been dealing with this error using VS 2017 for a year now. I compile my solution which contains about 100 projects and some of the projects fail for this reason. I simply build again and the projects that failed will build though other projects might fail further down the line. Ultimately, as I keep building (making no changes in between), they will all pass. Since it only happened on my laptop and desktop and not on the build server I just always did multiple builds and tolerated it.

However, now it has hit the build server and I can no longer get a build completed, so I had to take the precious time to investigate it more. I tried VS2019 to see it if would change anything - nope. Then I started keeping track of which of the approx. 100 projects it would fail on. That led me to notice that when it failed, it was always where a second compilation pass was occurring. Searching the build log for "MarkupCompilePass2:" revealed that all the projects that failed were undergoing a second compile before the failure. Here is a sample of lines (empty lines added for clarity) from the build log where one of the failure occurs (note my bolding):

PrepareForBuild:

Creating directory "obj\x86\Release_Signed\".

Project "C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\VS5.Comms.SignalStrength.vbproj" (65:2) is building "C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\VS5.Comms.SignalStrength_pecgedwc_wpftmp.vbproj" (75) on node 1 (_CompileTemporaryAssembly target(s)).

CoreCompile:

  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\vbc.exe /noconfig /imports: ... blah, blah, blah ...

  Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn

Done Building Project "C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\VS5.Comms.SignalStrength_pecgedwc_wpftmp.vbproj" (_CompileTemporaryAssembly target(s)).

MarkupCompilePass2:

  MarkupCompilePass2 successfully generated BAML or source code files.

CleanupTemporaryTargetAssembly:

  Deleting file "obj\x86\Release_Signed\VS5.Comms.SignalStrength.dll".

##[error]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(480,10):Error MSB3061: Unable to delete file "obj\x86\Release_Signed\VS5.Comms.SignalStrength.dll". The process cannot access the file 'C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\obj\x86\Release_Signed\VS5.Comms.SignalStrength.dll' because it is being used by another process.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(480,10): error MSB3061: Unable to delete file "obj\x86\Release_Signed\VS5.Comms.SignalStrength.dll". The process cannot access the file 'C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\obj\x86\Release_Signed\VS5.Comms.SignalStrength.dll' because it is being used by another process. [C:\agent\_work\1\s\VS5\VS5.Comms.SignalStrength\VS5.Comms.SignalStrength.vbproj]

Done Building Project "C:\agent\_work\1\s\VS5\VS5.Comms.Signal

-------------------------------------

Is there a way around this?

Net-SNMP : Unable to build in VC 2017 Version 15

$
0
0

I have recently download Net-SNMP code from their website and trying to build in VC 2017 - and it fails.

The extracted folder has win32.dsp and win32dll.dsp - when I try to open in VC IDE I get error like -

Message

 snmptrapd\snmptrapd.dsp:Unable to convert project.Please make sure this is a valid Visual C++6.0 project.
 snmptrapd\snmptrapd.dsp:Project upgrade failed.

 snmptrapd\snmptrapd.dsp:Converting project file 'C:\tools\netsnmp\net-snmp-5.8\win32\snmptrapd\snmptrapd.dsp'.Hide1 additional messages  

Almost for all projects - the build via command line 'nmake' utility also fails with below error -

    cd libagent
    nmake /nologo all
    cl.exe /I../I..\..\include /I..\..\agent\mibgroup /D WIN32 /D _BIND_TO_CURRENT_VCLIBS_VERSION /D _CONSOLE /D _CRT_NONSTDC_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _MBCS /D _WINSOCK_DEPRECATED_NO_WARNINGS /EHsc/FD /FR.\release\ /Fd.\release\libagent.pdb /Fo.\release\ /I C:\OpenSSL-Win32\include /c /W3 /Zi/nologo /wd4244 /wd4267 /MD  /D NDEBUG /O2 ..\..\agent\agent_handler.c ..\..\agent\agent_index.c ..\..\agent\agent_read_config.c ..\..\agent\agent_registry.c ..\..\agent\agent_sysORTable.c ..\..\agent\agent_trap.c ..\..\agent\snmp_agent.c ..\..\agent\snmp_vars.c 
agent_handler.c..\..\agent\agent_handler.c(19): fatal error C1083:Cannot open include file:'sys/types.h':No such file or directory
agent_index.c..\..\agent\agent_index.c(12): fatal error C1083:Cannot open include file:'signal.h':No such file or directory
agent_read_config.c..\..\agent\agent_read_config.c(16): fatal error C1083:Cannot open include file:'sys/types.h':No such file or directory
agent_registry.c..\..\agent\agent_registry.c(32): fatal error C1083:Cannot open include file:'signal.h':No such file or directory
agent_sysORTable.c..\..\agent\agent_sysORTable.c(3): fatal error C1083:Cannot open include file:'stdlib.h':No such file or directory
agent_trap.c..\..\agent\agent_trap.c(35): fatal error C1083:Cannot open include file:'stdlib.h':No such file or directory
snmp_agent.c..\..\agent\snmp_agent.c(50): fatal error C1083:Cannot open include file:'sys/types.h':No such file or directory
snmp_vars.c..\..\agent\snmp_vars.c(68): fatal error C1083:Cannot open include file:'string.h':No such file or directoryGeneratingCode...
NMAKE : fatal error U1077:'"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe"':return code '0x2'Stop.
NMAKE : fatal error U1077:'"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\nmake.EXE"':return code '0x2'Stop.

How can we resolve the issue?

Will It Require Visual Studio License For Build Tool on Team Foundation Server?

$
0
0

Hi All,

We have upgraded our application to Roslyn Compiler from CSC Compiler.  Currently, we are facing issue in Build project on TFS build server.

We are using Visual Studio 2017 Professional Edition and Team Foundation Server 2017.

We want to know that if we install Visual Studio 2017 With Build Tool on Team Foundation Server, will it require Visual Studio license ?

Check certain files are EmbeddedResource

$
0
0

Hello

I need to have a Pre-Build event that checks if all .sql files in a .csproj are included withBuildAction type of 'EmbeddedResource'. If any .sql file is not set as 'EmbeddedResource' a Buid error should be shown in output.

Is there any command for this? Should I implement a custom command line tool to call before build?


Jalalx


Why do not the statements work? ERRO

$
0
0

Does anyone know why this is happening, one remark I installed Visual Studio 2012 recently. But I know how to program this language. I just do not understand why this is happening. In Form1, ProgressBar1, WebBrowser1, TextBox1, Label1 are already inserted.

Thank you waiting for a reply.


Problem with /bigobj when compiled by other software

$
0
0

I am building a User Defined Function in ANSYS Fluent which calls my installation of MSVS 2017 to compile the code. The problem is I get the error:

fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj

I cannot tell Fluent how to compile the code. The only argument it takes is where the source code is.  How can I tell Visual Studio 2017 to ALWAYS use bigobj when it compiles code?

Unable to create snmpdemo.exe

$
0
0

I have just downloaded Net-SNMP and compiled using VC 2017. Now I am trying to write my own C Application as provided here.

I am a Unix guy and have created a .c file named snmpdemo.c - now I need compile and link to create a snmpdemo.exe in Windows. I am using Visual Studio for same.

I crated the following makefile.txt - out by looking into existing makefiles:

PROGNAME=snmpdemo
LINKTYPE=static
Output_Directory=.\release
CFLAGS=/D WIN32 /D _BIND_TO_CURRENT_VCLIBS_VERSION /D _CONSOLE /D _CRT_NONSTDC_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _MBCS /D _WINSOCK_DEPRECATED_NO_WARNINGS /EHsc /FD /FRC:\tools\netsnmp\net-snmp-5.8\c_api\$(Output_Directory)\ /FdC:\tools\netsnmp\net-snmp-5.8\c_api\$(Output_Directory)\$(PROGNAME).pdb /FoC:\tools\netsnmp\net-snmp-5.8\c_api\$(Output_Directory)\ /I C:\tools\netsnmp\net-snmp-5.8\include /I C:\OpenSSL-Win64\include /c /W3 /Zi /nologo /wd4244 /wd4267 /MD  /D NDEBUG /O2 
LDFLAGS=/libpath:C:\OpenSSL-Win64\lib\VC /FS

# Set to 1 to allow the building using the DLL version of SNMPLIB.
ALLOW_DLL=1

CPP=cl.exe
CPP_PROJ=/I.. /I..\..\include $(CFLAGS)
snmpdemo.obj::
   $(CPP) $(CPP_PROJ) $(PROGNAME).c

RSC=rc.exe
LINK32=link.exe
LINK32_FLAGS=netsnmp.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /pdb:"C:\tools\netsnmp\net-snmp-5.8\c_api\$(PROGNAME).pdb" /out:"C:\tools\netsnmp\net-snmp-5.8\c_api\$(PROGNAME).exe" /libpath:"../lib/$(INTDIR)" $(LDFLAGS)
LINK32_OBJS= "$(PROGNAME).obj"

But when I try to compile the code I get below issue:

MINGW64 /c/tools/netsnmp/net-snmp-5.8/c_api
$ "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.8.7
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

MINGW64 /c/tools/netsnmp/net-snmp-5.8/c_api
$ nmake -f makefile.txt

Microsoft (R) Program Maintenance Utility Version 14.15.26730.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl.exe /I.. /I..\..\include /D WIN32 /D _BIND_TO_CURRENT_VCLIBS_VERSION /D _CONSOLE /D _CRT_NONSTDC_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _MBCS /D _WINSOCK_DEPRECATED_NO_WARNINGS /EHsc /FD /FRC:\tools\netsnmp\net-snmp-5.8\c_api\.\release\ /FdC:\tools\netsnmp\net-snmp-5.8\c_api\.\release\snmpdemo.pdb /FoC:\tools\netsnmp\net-snmp-5.8\c_api\.\release\ /I C:\tools\netsnmp\net-snmp-5.8\include /I C:\OpenSSL-Win64\include /c /W3 /Zi /nologo /wd4244 /wd4267 /MD  /D NDEBUG /O2 snmpdemo.c
snmpdemo.c
C:\tools\netsnmp\net-snmp-5.8\include\net-snmp/net-snmp-includes.h(14): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe"' : return code '0x2'
Stop.

How can I build the executable?


problem in visual studio 2017 c++

$
0
0

hi there, excuse me please help me when i do run in visual studio 2017, show me ( the cod execution proceed because MSVCP100D.dll was not found. reinstalling the program may fix this problem.  

and i download this file and put it in  "C:\Windows\sysWOW64"  still same problem

build throws an error "Object reference not set to an instance of an object"

$
0
0

I'm developing an UWP app. Suddenly VS2017, at build or rebuild, throws an error with no specific line of code, at no specific file

"Error Object reference not set to an instance of an object."

Every time I hit build this error is thrown, and unables me to make the build, and run a debug instance.

Also there is another symptom: all .xaml files, with their associated .cs files. at the .cs file, there is the constructor that calls InitializeComponent() method, all .cs files throws the error that can't find the InitializeComponent() method, (or any property/visual control declared in the xaml file)
for example for app.xaml. build throws the error : "Error CS1061 'App' does not contain a definition for 'InitializeComponent' and no accessible extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?) "

but these error of missing InitializeComponent() method, ONLY appears when a class is shown in documents tabs in the IDE. as soon I close the document, error go away. still the first error descripted above "Object reference not set to an instance of an object" still is there, and disallows me to build my project.

I already tried:

1) rebuild solution
2) clean solution
3) rebuild project
4) clean project
5) revert to a previous commit (known to be working)
6) close and reopen VS
7) reboot the machine
8) update VS2017 to a newer version
9) repair VS2017 with the installer
10) try on another computer
11) target project to a different version of win10. (now targeting 1809)
12) Update VS2017 to VS2019

13) delete completely the project source files, and clone again from gitlab

none of those did work.

what can I do?

I don't know what else I could try, only thing I think, is to rebuild the project from the ground up, with all classes.

Memory issues while compiling the C++ project on 2019 compiler

$
0
0

Hi,

We have moved our VC++ projects to VS2019 and when tried to build the project we got the following errors after compiling some files...

3>c1xx: error C3859: Failed to create virtual memory for PCH
3>c1xx: note: PCH: Unable to get the requested block of memory

I have gone through the forums as mentioned  by the ciompiler but still getting the same error

3>c1xx: note: please visit https://aka.ms/pch-help for more details

Can you please help in resolving these issues?

Thanks,

Mohan



VS2017 Build Error The process cannot access the file

$
0
0

Hello,

I am running VS2017 version 15.3.3.  I just updated it yesterday in an attempt to resolve this issue.  When I attempt to build a C# WPF project for a second time, I get a build error telling me the .EXE file is in use by another process.  Closing the solution and reopening allows me to build the project.  This is very annoying and unproductive.  

This only occurs after I edit and save the MainWindow.xaml file.  I have also tried closing the xaml file before attempting the second build without any success.  

TFS 2017 on-site Labeling question - am I understanding the process correctly?

$
0
0

I've been using TFS for quite a few years now so I'm pretty certain that I know what's going on, but we had an issue lately that has me wondering if I perhaps I didn't understand one part.

We work on our code-base continually checking in new changes that will go into the next release. We don't branch because of the nature/structure of our codebase. (It's a mess that was set up long before I got here. We have about 25 "projects" off of the root level and about 10 products that all use parts of each project, so creating a branch would mean creating a branch off of each project at exactly the same time. I know - it's nuts)!

So instead of branching when we have an official release I just look at the build date/time of that release and retroactively create a label using Date to create the pointer. So theoretically I could kick off a build at any point in the future that would build the exact code that went into that build at some prior date.

The problem is that that just didn't work. I kicked off a build using a prior label (I specified "LSome Prior Build's Label" in the Source Version box) and some code checked in after that label seemed to be included in the build. How can that be? Do I not understand the way that retroactive labels work? When you create a label using date/time it should point to the code at that precise date/time - correct?


An error occurred when merging assemblies,VS 2017 web deploy

$
0
0

Hello

I am using visual studio 2017 to build and publish my website.

I bought a new laptop and moved my website code to it and installed visual studio.On the new laptop when i publish using web deploy and merge output into one assembly I am getting this error on preview

An error occurred when merging assemblies: Object reference not set to an instance of an object.

Nothing have changed in my code.It publishes successfully on old laptop using same visual studio.

I tried to create a new website and tried to do the publish I noticed that I get the error once i add .vb class or .aspx.vb file to the website.Build is successful

These are the solution i found online and i tried but with no luck:

- disabled antivirus,McAfee firewall,windows defender firewall.

- removed dlls under Bin folder

- running visual studio as administrator

- uninstalled  and reinstalled visual studio again



How should I right publish my SQL-Database project (VS 2017 Community) on live system?

$
0
0

Hello,

actually I publish my SQL-Database project (VS 2017 Community) as follow:

1. I set all "create stored procedures" sql-scripts properties "Build" on "none"

2. I Set all "create tables" sql-scripts properties "Build" on "none"

3. Then I make a changes in one stored procedure, which I will change on live system

4. Then I set a Property "Build" of  this procedure at "Build"

5. finally I start my live-publish.xml and click auf "publish.

So I achieve a goal, that my live database will not complete rewrited, but only one script, that I wish.

Question:

Is it possible to make the same simply? (in one or two steps?)

Thanks.

P.S.

in VS 2010 I should make only right click on procedure, and then publish it on live- or test-system.


An error occurred when merging assemblies,VS 2017 web deploy

$
0
0

Hello

I am using visual studio 2017 to build and publish my website.

I bought a new laptop and moved my website code to it and installed visual studio.On the new laptop when i publish using web deploy and merge output into one assembly I am getting this error on preview

An error occurred when merging assemblies: Object reference not set to an instance of an object.

Nothing have changed in my code.It publishes successfully on old laptop using same visual studio.

I tried to create a new website and tried to do the publish I noticed that I get the error once i add .vb class or .aspx.vb file to the website.Build is successful

These are the solution i found online and i tried but with no luck:

- disabled antivirus,McAfee firewall,windows defender firewall.

- removed dlls under Bin folder

- running visual studio as administrator

- uninstalled  and reinstalled visual studio again



Error - TF400409: You do not have licensing rights to access this feature: Code

$
0
0

Hello,

I am starting this discussion because I am getting this error for Team Foundation Server whenever I try to access the website code for the company I work for. My project leader has already assigned me the same permissions as those who are currently on website development but I continue to be restricted. I can try and access the Source Control Explorer through Visual Studio but it just shows up empty (when it shouldn't). I tried reinstalling Visual Studio multiple times and tried installing the license key via the storePID executable through an admin cmd prompt in an attempt to update my access to the website code on tfs. 

Any help is appreciated,

Thanks!


Not receiving any artifacts to my PublishProfile destination.

$
0
0

Hi All,

I am trying to publish my project using MSBuild tool, I dont wanted to do it with VS. I have surfed internet and written the build script.xml file with the below values. When I build the project in command line, its showing build succeeded. And I am getting bin directory created inside my project and having the some files. But I have configured other location in my publishprofile.pubxml. Nothing copied in that folder after building the project.

My script:

MSBuild "D:\Project\clientservice\clientservice.sln"
   /p:VisualStudioVersion=12.0
   /property:Configuration=Debug
   /p:OutputPath="D:\Project\clientservice\clientservice\bin"
   /t:Clean,Build,Publish
   /p:DeployOnBuild=true
   /p:PublishProfile="D:\Project\clientservice\PubProfile.pubxml

--------------------------------------------------------------

And my PubProfile.pubxml script:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>D:\WebApplication\Publish</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
</Project>

I need some clarification here.

After executing the msbuild cmd in cmdprompt, What will be the content in these destinations "/p:OutputPath="D:\Project\clientservice\clientservice\bin"" and "<publishUrl>D:\WebApplication\Publish</publishUrl>".

Kindly someone help me here to understand. I am new to this Dotnet environment.

Thanks in advance.

Dhamodharan.

Viewing all 2763 articles
Browse latest View live


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