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

msbuild command line options for release package to match Visual Studio behavior

$
0
0

We use command line (through ant) to generate the application package and install the app to do some automated testing. If we use Visual Studio to generate the package we noticed that it creates an optimized package with some dependencies: for e.g.:

[OurApp]1.0.0.0_x64_Test
  ->Add-AppDevPackage.resources
     [Resources of the app]
  ->Dependencies
      ->ARM
      ->x64
          Microsoft.NET.Native.Framework.1.2.appx
          Microsoft.NET.Native.Runtime.1.1.appx
          Microsoft.VCLibs.x64.14.00.appx
      ->x86
  [ourApp]_1.0.0.0_x64.cer
  Add-AppDevPackage.ps1
  [ourApp]_1.0.0.0_x64.appx
  [OurApp]_1.0.0.0_x64.appxsym

However the command line we used does not generate the dependencies. The command line we use is:

"msbuild.exe" [ourSolution].sln /t:Build;Publish /p:platform=x64 /p:Configuration=Release;AppxBundle=Never

The difference seems to be that visual studio seems to be kicking off csc.exe:

2>  Starting .NET Native compilation

2>  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /pdb:.. /nostdlib+ /reference:"C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\lib\Private\System.Private.CoreLib.dll" /debug:full /out:.. ./target:winexe ...\bld\x64\Release\ilc\intermediate\fake.cs

So I tried the following command line:

"msbuild.exe" [ourSolution].sln /t:Build;Publish /p:platform=x64 /p:Configuration=Release;AppxBundle=Never /p:DebugType=full /p:DebugSymbols=true /verbosity:minimal /p:Optimize=true /p:BuildProjectReferences=false /p:CscToolPath=C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe

Now some dependencies are generated but it fails on one of our project dependencies:

STRIPPRIVATESYMBOLS : error : EC_NOT_FOUND [c:\MAF\trunk\QA\Tests\SeleniumTests\jdeveloper\deploy\WINDOWS_TEST\release\MafTempl
ate\MafTemplate.jsproj]
C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.CSharp.Core.targets(67,5): error MSB6004: The specified task executable
 location "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe\csc.exe" is invalid. [c:\MAF\trunk\Container\UWP\SeleniumLib\S
eleniumLib.csproj]

The dependency generated has “Microsoft.NET.CoreRuntime.1.0.appx” vs “Microsoft.NET.Native.Framework.1.2.appx” and “Microsoft.NET.Native.Runtime.1.1.appx”

Does anyone know what are the command line options to generate a Release package exactly like what Visual Studio generates. The reason why I am asking is that the release package generated by Visual Studio has a different behavior at runtime for threading than the one generate by our command line. The one generated by Visual Studio is the correct behavior.

Any help is appreciated.




Viewing all articles
Browse latest Browse all 2763


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