Unable to do Web Deploy for Visual Studio 2019 .NET Core 3.1 project from Mac M1 - macos

I have Visual Studio 2019 .Net Core 3.1 Project which can be deployed to my server fine using Web Deploy on my Windows 10 Machine.
But I cannot do Web Deploy on Mac M1 for the same project.. is Web Deploy only available on Windows OS ?
Error I get when trying to Publish using same Web Deploy profile on Mac M1:
Build started 3/26/2021 11:00:26 PM.
__________________________________________________
Project "/Users/user/Desktop/project1/project1.csproj" (Build target(s)):
Target PrepareForBuild:
Creating directory "bin/Staging/netcoreapp3.1/win-x64/".
Creating directory "obj/Staging/netcoreapp3.1/win-x64/".
Target ResolvePackageAssets:
/usr/local/share/dotnet/sdk/5.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file '/Users/user/Desktop/project1/obj/project.assets.json' doesn't have a target for 'netcoreapp3.1/win-x64'. Ensure that restore has run and that you have included 'netcoreapp3.1' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers.
Done building target "ResolvePackageAssets" in project "project1.csproj" -- FAILED.
Done building project "project1.csproj" -- FAILED.
Build FAILED.
/usr/local/share/dotnet/sdk/5.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file '/Users/user/Desktop/project1/obj/project.assets.json' doesn't have a target for 'netcoreapp3.1/win-x64'. Ensure that restore has run and that you have included 'netcoreapp3.1' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.99

Related

Publish a Windows Application Package Project via command line

How can I publish the UWP package via command line?
I have a WPF application that is packaged with a Windows Application Package Project that ends up being published to the Microsoft Store.
In order to be accepted in the Store, the WPF project needs to be compiled with a preprocessor directive (that I named as "UWP"), deactivating stuff that are not allowed for Store apps.
I'm in the process of migrating the WPF app from .NET Framework 4.8 to .NET 5 and along with that I'm trying to streamline my publishing process via command line.
Is there any way to configure or update the package to support ARM64?
The app will be published outside the Store as x86, x64 and ARM64 and I intend to do the same for the Store version.
When checking the WAPP, I noticed that ARM64 is not available on the list. As you can see in the screenshot, I was able to create a ARM64 build profile, but the architecture is not available on the table.
What have I tried? (Command line issue)
I tried running this command:
MSBuild.exe C:\Project-UWP\Project.UWP\Project.UWP.wapproj /p:DefineConstants=UWP /p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM64" /p:OutDir="..\Publish\UWP"
But got these errors:
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 29/09/2021 22:09:19.
Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
_ResolveVCLibDependencies:
Searching for SDKs targeting "UAP, 10.0.20348.0".
Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (1) is building "C:\Project\Project.csproj" (2:9) on node 1 (publish target(s)).
C:\Program Files\dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file 'C:\Project\Project\obj\project.assets.json' doesn't have a target for 'net5.0-windows/win-x86'. Ensure that restore has run and that you have included 'net5.0-windows' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers. [C:\Project\Project.csproj]
Done Building Project "C:\Project\Project.csproj" (publish target(s)) -- FAILED.
Done Building Project "C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default targets) -- FAILED.
Build FAILED.
"C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default target) (1) ->
(_GetProjectReferenceTargetFrameworkProperties target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1718,5): warning NU1702: ProjectReference 'C:\Project\Project.csproj' was resolved using '.NETCoreApp,Version=v6.0' instead of the project target framework '.NETFramework,Version=v4.5.1'. This project may not be fully compatible with your project. [C:\Project-UWP\Project.UWP\Project.UWP.wapproj]
"C:\Project-UWP\Project.UWP\Project.UWP.wapproj" (default target) (1) ->
"C:\Project\Project.csproj" (publish target) (2:9) ->
(ResolvePackageAssets target) ->
C:\Program Files\dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file 'C:\Project\obj\project.assets.json' doesn't have a target for 'net5.0-windows/win-x86'. Ensure that restore has run and that you have included 'net5.0-windows' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers. [C:\Project\Project.csproj]
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.31
Notice that there are warnings related to framework references:
ProjectReference C:\Project\Project.csproj was resolved using .NETCoreApp,Version=v6.0 instead of the project target framework .NETFramework,Version=v4.5.1.
This project may not be fully compatible with your project. Microsoft.Common.CurrentVersion.targets 1719
The WPF project was set to use .NET 5, so I don't see why there's any reference to .NETCoreApp 6 or .NET Framework 4.5.1.
What have I tried? (Missing ARM64 issue)
I created a WAPP from scratch and saw that the option for ARM64 appeared in the architecture table.
But when publishing manually via the context menu, I'll get this error:
The specified RuntimeIdentifier 'win-ARM64' is not recognized.

Error occurs when deploying the UWP application (installedLocation != null)

Introduction
The project was newly created and there was no change in the project.
The build of the application when running the application in JetBrains Rider IDE was executed.
Successful Build
The build completed successfully
0>------- Finished building project: TEST. Succeeded: True. Errors: 0. Warnings: 0
Build completed in 00:00:34.171
Build succeeded at 04:11:43
Failed Deployment
The deployment was not completed successfully.
Deploying file MainPage.xbf...
Deploying file WinMetadata\Windows.winmd...
Deploying file resources.pri...
Deploying file TEST.exe...
installedLocation != null
I was facing the same issue when I changed IDE from VS to Rider. The problem was that I had a project with the same name in VS and it had been previously built, but I could not have found the deployed application. So I looked up for this VS project, built it, and then I deleted the application with the VS solution together. After this, I could run my Rider project with the same name without any errors.

TeamCity Professional 10.0.3 (build 42434) Visual studio 2013 solution error :Unmet requirements: MSBuildTools12.0_x86_Path exists

I am new to TeamCity and difficulties building Visual studio 2013 soln testing on win 7 .My Plan is to make TeamCity automate build & deployment on committing to svn server with 2 builds. 1-Build -> Build xyz.sln file with 2 web application projects -> proj1 & proj2 . 2-Publish -> If 1-Build is Successful then publish proj2 web application project to test & prod server (2 servers). I did the setup of svn trunk on TeamCity which has xyz.soln file and connection tested successfully. When I tried to build the configuration with my xyz.soln
Build Step :
When I tried to run the build it was giving: Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements.
Followed this -> http://www.danmusk.com/how-to-build-asp-net-applications-in-teamcity-with-msbuild-tools-2013-and-net-framework-4-5-sdk/
Installed MSBuild separately and confirmed
MSBuild Tools 2013 -> C:\Program Files (x86)\MSBuild\12.0\Bin
also .Net framework ->
windows SDK ->
https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206843275-Unmet-requirements-MSBuildTools12-0-x86-Path-exists
Any help would be great? Need to fix this Issue badly .
If you installed the appropriate MSBuild Tools, you likely just need to restart the build agent so it can re-register with the current set of capabilities.
To illustrate how this works, you can first look at the Build Configuration's Agent Requirements:
In this example, you can see the build needs MSBuildTools12.0_x86_Path defined (as well as some .NET framework stuff).
Over on the Agent's parameters, under Agents->[Agent1]->Agent Parameters->Configuration Parameters, you can see a list like this:
In my case, the value is present so it's considered a 'compatible agent'.
How do these settings get on the agent? Well, when the agent starts up it checks all these things to see what it's capable of and includes them in this big list of Configuration Parameters.
Therefore, if you install something like MSBuild Tools, you'll need to restart the agent... it runs as a service, so just go to the services panel on the agent box and restart it.

MSBuild 2015 fails packaging web app from VS2010

I have a build server that until recently had up to .Net 4.5.1 and VS2010/VS2012 installed. I ran MSBuild to build and package web apps as follows:
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" Hartford.Pace.sln /nologo /v:n /p:Configuration=Release /p:DeployOnBuild=True /p:CreatePackageOnPublish=True /p:AutoParameterizationWebConfigConnectionStrings=False /p:EnableNuGetPackageRestore=True
I recently updated the build server to include Frameworks through 4.6.1 and VS2013/VS2015. Everything was installed in sequence. I updated the build command to:
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" Hartford.Pace.sln /nologo /v:n /p:Configuration=Release /p:DeployOnBuild=True /p:CreatePackageOnPublish=True /p:AutoParameterizationWebConfigConnectionStrings=False /p:EnableNuGetPackageRestore=True /p:VisualStudioVersion=10.0
And now I'm getting the following error only for VS2010 web apps:
"d:\a5\bi_hartsource_pace\Microsoft_Build_Web_App\trunk\Hartford.Pace.sln" (default target) (1) ->
"d:\a5\bi_hartsource_pace\Microsoft_Build_Web_App\trunk\Hartford.Pace.Services\Hartford.Pace.Services.csproj" (default target) (2) ->
(PackageUsingManifest target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009,5): error : Web deployment task failed. (Unknown ProviderOption:DefiningProjectFullPath. Known ProviderOptions are:.) [d:\a5\bi_hartsource_pace\Microsoft_Build_Web_App\trunk\Hartford.Pace.Services\Hartford.Pace.Services.csproj]
Which points to a problem with the packaging target files. I checked them and none of them were changed by the update.
Does anyone know of side-by-side issues with VS2010 and VS2015? I'd like to upgrade the VS2010 Solutions but it's not my code and I need to build existing apps without modification.
Is this the best method for packaging an app without having the developers create publishing profiles or running anything at their end? This is supposed to be a fully automated build and deploy process. It has been working for three years with no issues but I'm open to suggestions that I can implement entirely on my build server without involving changing files in the source code (including csproj or other controlling files).
Add /p:VisualStudioVersion=10.0

Migrating Cordova Multi-Device Hybrid App to Visual Studio 2015

Have been following the instructions to migrate VS2013 proejct to VS2015 as outlined in the page:
http://mariusbancila.ro/blog/2015/07/31/migrating-a-cordova-project-from-visual-studio-2013-to-visual-studio-2015/
and
https://github.com/Microsoft/cordova-docs/blob/master/known-issues/known-issues-vs2015.md
Getting some build Errors:
Done executing task "MdaVsCli" -- FAILED. (TaskId:11)
1>Done building target "BuildMDA" in project "LabbookMobile.jsproj" -- FAILED.: (TargetId:11)
Full Output: http://pastebin.com/uh6eMQu1
Dose anyone anyone know how I can fix this?
Turned out I had some of the files in the wrong location in the newly created www directory. The xxxx.jsproj, taco.json and config.xml should be in the directory above the www folder.

Resources