MSBuild missing target WebPublish - asp.net

I am trying to publish a website at our CI server.
For some reason target WebPublish works when building with MSBuild 12.0 but not with MSBuild 14.0.
I can test it with following command: msbuild My.Web.csproj /t:WebPublish
It works with 12.0. MSBuild 14.0 gives error:
Build FAILED.
R:\My.Web\My.Web.csproj" (WebPublish target) (1) ->
R:\My.Web\My.Web.csproj : error MSB4057: The target "WebPublish" does not exist in the project.
0 Warning(s)
1 Error(s)
I have Visual Studio 2012 and 2015 installed. Is there something else I have to install in the CI server?

For anyone running into this problem currently, there are some alternative solutions posted on the following stack overflow question
The thing that fixed it for me was the "Web" and "Web Applications" folders found in the MSBuild directory for the version of visual studio that matched what I built my project in. In my case this was
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0

You have to install "Web Developer Tools". You can do it from "Programs and Features" and repairing Visual Studio 2015.

Related

Building net5.0 solution on TeamCity agent results in "reference assemblies not found" error

I have recently upgraded our .Net Core 2.2 application to .Net 5.0. I'm now trying to upgrade our TeamCity build agent, so it can build this solution.
Installed the .Net 5.0 SDK on the build agent, and restarted the machine.
Installed the latest Community edition of Visual Studio on the build agent as well.
When I try to run a build on the agent using "dotnet msbuild", it shows this error message:
[Building CodeEngineQueryBuilder4] C:\Program Files\dotnet\sdk\5.0.202\Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.
More info:
RDPed onto the build agent and run "dotnet --info" on the command line, which gave me ".Net SDK Version 5.0.203"
I did find directory "C:\Program Files\dotnet\sdk\5.0.203" on the build agent, so it seems .Net 5.0 is installed.
The build agent runs Windows 8.1.
The TeamCity installation is on the latest version.
What am I missing here?
In the end, I found that I had to change the system environment variable MSBuildSdksPath
to make it point at the new .net5 Sdk directory.
In my case, I repointed it at:
C:\Program Files\dotnet\sdk\5.0.203\Sdks

Visual studio 2017 installation issue on windows 8/8.1

We are not getting core 2.0 template after installation Vs2017 community edition.
Under the Environment Variable the Path was setup wrong.
'C:\Program Files (x86)\dotnet' removed
'C:\Program Files\dotnet' set

Any luck with building ASP.NET 5 beta 7 application on VSO?

I'm trying to build ASP.NET 5 beta 7 application on VSO. And I getting following error:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DNX.PackageManager'
I know about this issue:
https://github.com/aspnet/Announcements/issues/51
So I tried to install latest WebTools using PowerShell script but "access denied".
Any ideas how to build beta7 app in VSO? Or just wait unit VSO build server will be updated with latest tools?
In order to build ASP.NET 5 beta 7 project successfully, the Microsoft ASP.NET and Web Tools 2015 (Beta7) – Visual Studio 2015 needs to be installed.
However, this web tool is not available on hosted build server, that is the reason why you get the "FileNotFoundException" error message (please check this link for the details what are installed on hosted build server: http://listofsoftwareontfshostedbuildserver.azurewebsites.net/). Additionally, you're not allowed to install any software to hosted build server, so, you get the "access denied" error message.
So, in order to build ASP.NET 5 beta 7 project successfully, instead of using hosted build server, you need to set up to use your own on-premise build controller. Check this link for the details: https://msdn.microsoft.com/library/ee330987
This is a result of the tooling changes for Visual Studio 2015 and VSO not having the latest tools installed in its hosted build controller (specifically, Microsoft.Dnx.PackageManager doesn't exist and should actually be Microsoft.Dnx.Tooling). To get around this, besides hosting your own build controller, you can fall back to the command line tools dnu build and dnu publish:
dnu build "src\{YOUR.PROJECT.FOLDER}" --configuration "release"
dnu publish "src\{YOUR.PROJECT.FOLDER}" --configuration "release" --out "your\output\directory\to\publish\to" --runtime "dnx-clr-win-x86.1.0.0-beta7"
I have this mostly detailed on my blog here: Deploying ASP.NET 5 Beta 7 Through Visual Studio Online
This should only be a temporary issue, as one can only assume Microsoft will be updating their tooling. When that's complete, you should be able to go back to the normal Visual Studio build step.
Seems that you've renamed PackageManager incorreclty. Just find where you have reference to 'Microsoft.DNX.PackageManager' and change it to 'Microsoft.DNX.Tooling'

QT Creator Build Error: failure during conversion to COFF

error: LNK1123: failure during conversion to COFF: file invalid or corrupt
I'am getting this error every time I try to build any project on my Qt Creator.
I have VS2010 installed and the compiler version set to MSVC C++ compiler 10.0(x86).
I have Qt 5.2.1 MSVC2010 32bit OpenGL.
This error appears because you have installed VS 2012 after you have actually installed VS 2010 in your system.
It can be solved if you install SP1 for VS2010.
An other solution is to go to
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
and check the version of cvtres.exe. If the date is 03/18/2010 go to
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and copy cvtres.exe then replace it On
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
This error may occur when.Net Framework updated to 4.5.x. To resolve this error
You can change project properties as "Enable Incremental Linking -> "No (/INCREMENTAL:NO)".
Or, uninstall the .Net Framework 4.5.x and install .NET Framework 4.

Using Visual Studio 2008 Web Deployment projects - getting an error finding aspnet_merge.exe

I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building:
The specified task executable location "bin\aspnet_merge.exe" is invalid.
Here is the source of the error (from the web deployment targets file):
<Target Name="AspNetMerge" Condition="'$(UseMerge)' == 'true'" DependsOnTargets="$(MergeDependsOn)">
<AspNetMerge
ExePath="$(FrameworkSDKDir)bin"
ApplicationPath="$(TempBuildDir)"
KeyFile="$(_FullKeyFile)"
DelaySign="$(DelaySign)"
Prefix="$(AssemblyPrefixName)"
SingleAssemblyName="$(SingleAssemblyName)"
Debug="$(DebugSymbols)"
Nologo="$(NoLogo)"
ContentAssemblyName="$(ContentAssemblyName)"
ErrorStack="$(ErrorStack)"
RemoveCompiledFiles="$(DeleteAppCodeCompiledFiles)"
CopyAttributes="$(CopyAssemblyAttributes)"
AssemblyInfo="$(AssemblyInfoDll)"
MergeXmlDocs="$(MergeXmlDocs)"
ErrorLogFile="$(MergeErrorLogFile)"
/>
What is the solution to this problem?
Note - I also created a web deployment project from scratch in VS2008 and got the same error.
Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation.
The place to get this is an installation of the Windows 2008 SDK (latest download).
Windows 7/Windows 2008 R2 SDK: here
The solution is to install the Windows SDK and make sure you set FrameworkSDKDir as an environment variable before starting the IDE. Batch command to set this variable:
SET FrameworkSDKDir="C:\Program Files\Microsoft SDKs\Windows\v6.1"
NOTE: You will need to modify to point to where you installed the SDK if not in the default location.
Now VS2008 will know where to find aspnet_merge.exe.
I just ran into this same problem trying to use MSBuild to build my web application on a server. I downloaded the "web" version of the SDK because the setup is only 500KB and it prompts you for which components to install and only downloads and installs the ones you choose. I unchecked everything except for ".NET Development Tools". It then downloaded and installed about 250MB worth of stuff, including aspnet_merge.exe and sgen.exe
You can download the winsdk_web.exe setup for Win 7 and .NET 3.5 SP1 here.

Resources