Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apphost customization #2545

Merged
merged 28 commits into from
Oct 1, 2018
Merged

Add apphost customization #2545

merged 28 commits into from
Oct 1, 2018

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Sep 20, 2018

This adds logic to copy resources from the managed dll to the apphost.

  • _ComputeNETCoreBuildOutputFiles now runs later in the build, at a point where IntermediateAssembly is available.
  • The resource updating can only be done on windows hosts. When building for windows from a unix host, we log a warning but don't fail the build.
    • I introduced a string resource (AppHostCustomizationRequiresWindowsHostWarning) for this case, but not for errors specific to the ResourceUpdater
  • No attempt is made to update resources when targeting unix, and no warning is shown in this case. Resources will just end up in the managed dll like before.
  • I added a testcase that uses the ResourceUpdater to copy over and check a version resource.
  • I did manual testing to verify that app icons and manifests work correctly with the change (the apphost icon shows up in the file explorer, and I was able to make an apphost ask for admin privileges on launch using an embedded app manifest).
  • This also includes a method that @AaronRobinsonMSFT should be able to use for adding a manifest for COM activation (see AddResource).

Note that this feature doesn't yet work with incremental build (see the discussion here #2467).

Addresses #1899.

@nguerrera @vitek-karas @jeffschwMSFT

IntPtr hResource = FindResourceEx(hModule, lpType, lpName, wLang);
if (hResource == IntPtr.Zero)
{
ThrowExceptionForLastWin32Error();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is dangerous to throw exceptions out of C callback. The C callback should always catch the exceptions and return the error via lParam.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Fixed in ea4f506. I also moved away from ThrowExceptionForHR due to #2552.

src/Tasks/Microsoft.NET.Build.Tasks/ResourceUpdater.cs Outdated Show resolved Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/ResourceUpdater.cs Outdated Show resolved Hide resolved
/// in a PE image. It currently only works on Windows, because it
/// requires various kernel32 APIs.
/// </summary>
public class ResourceUpdater
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should implement IDisposable since it owns the update handle. In case of exceptions this will likely leak that handle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it IDisposable, using a new SafeUpdateHandle.

DependsOnTargets="ResolvePackageAssets"
AfterTargets="ResolveReferences"
BeforeTargets="AssignTargetPaths"
DependsOnTargets="ResolvePackageAssets;CoreCompile"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoreCompile [](start = 49, length = 11)

I'm not sure about this dependency on CoreCompile. I know we need the intermediate assembly available, but there could be scenarios where we end up triggering a re-build when we were supposed to be using what is already on disk. This has come up a few times with other targets. I have to think about the best approach here.

Copy link
Contributor

@nguerrera nguerrera Sep 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still thinking about it, but I think the best approach following the existing idioms in common targets would be to generate the apphost to intermediate directory upon/after compile and designate the intermediate item as something to copy separately.


In reply to: 219644421 [](ancestors = 219644421)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nguerrera generating the apphost into the intermediate directory would still have a dependency on CoreCompile, wouldn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

I was thinking about changing the paradigm to react to compilation instead of depending on compilation.

I am concerned that there may be places where this target is invoked without expecting compilation to happen even if the source files are out of date. Look at the long discussion on https://github.com/dotnet/cli/issues/5331 for some background on why this is worth worrying about.

What I'm wondering is: can the apphost generation happen in a separate target that is AfterTargets=CoreCompile (after we compile a managed exe to the intermediate directory, create the matching apphost next to it). And this target would just add the intermediate location to the set of files to be copied.

Adding @rainersigwald who may have other ideas here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that if the apphost creation will be invoked in a way that doesn't expect compilation to happen, it shouldn't depend on CoreCompile. But the current target logically depends on an up-to-date IntermediateAssembly, and I think "DependsOnTargets=CoreCompile" captures that.

If the scenario you're thinking about is one where we do "publish --no-build", and expect that this will create an apphost for the previously-built intermediate assembly (even if source files are out of date), then I can see your concern. To me it makes sense to implement this by expressing the dependency on the outputs of a target that logically produces IntermediateAssembly, and having that target internally respect the --no-build option by using the existing IntermediateAssembly in that case. This way the --no-build behavior is transparent to targets that depend on build outputs.

AfterTargets=CoreCompile could work, but that has other issues. Any inputs to the apphost generator that don't come from CoreCompile should trigger apphost re-generation if they change. For example, setting the target to WinExe should cause the apphost to be re-generated with the gui bit, even if we don't want to re-compile.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the scenario you're thinking about is one where we do "publish" --no-build

I'm thinking even more generally. This will cause any caller of GetCopyToOutputDirectoryItems to trigger compilation and I don't think that's OK.

Agree that AfterTargets="CoreCompile" alone doesn't solve it. I'm still thinking about what's best here.


In reply to: 220379741 [](ancestors = 220379741)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It generally makes sense for GetCopyToOutputDirectoryItems to trigger compilation, because it logically depends on the compilation output through the apphost. If we want to optimize for "publish --no-build", we need to cut out some some dependency edges from Publish -> CoreCompile in this case (or alternatively make CoreCompile do nothing).

In #2111, it looks like we already cut one edge from Publish -> CoreCompile by making Publish not depend on Build in the "--no-build" case. Maybe we want to do something similar here? We could make GetCopyToOutputDirectoryItems depend on _ComputeNETCoreBuildOutputFiles unless NoBuild is specified. If NoBuild is specified, GetCopyToOutputDirectoryItems could just try to get the last-built apphost from the intermediate directory.

Just an idea, but I'm sure there are more constraints I don't know about. I'll let you decide how you think this should be done - let me know if there's anything I can do to help!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetCopyToOutputDirectoryItems should not do actual work and should not depend on CoreCompile (and friends), because it is called on references in the /p:BuildProjectReferences=false case, which should not trigger compilation in the referenced projects. I don't think the NoBuild case applies here for that reason--you're building, but some other project.

Unfortunately, I can't think of a great way to accomplish this. Best I can think of is to move the actual work into a target (CreateAppHost?) and append ;CreateAppHost to $(CompileDependsOn), which would insert it in the normal flow shortly after CoreCompile but not require it to express the dependency. Then, do no real work in _ComputeNETCoreBuildOutputFiles and run it BeforeTargets="GetCopyToOutputDirectoryItems".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @rainersigwald. This sounds like a good approach. @sbomer, can you look at doing it that way?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rainersigwald and @nguerrera. I think the latest change does the trick - PTAL.

Instead, use the extra parameter to capture error information, and
throw the appropriate error from the caller of EnumResourceTypes.
Copy link
Contributor

@nguerrera nguerrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for the issue with the CoreCompile dependency to be resolved.

This cuts the dependency from _ComputeNETCoreBuildOutputFiles on
CoreCompile. Instead, _CreateAppHost will run after compilation via
CompileDependson.

Locating the restored apphost has been factored into another target
_GetAppHostPaths, which is a dependency of both
_ComputeNETCoreBuildOutputFiles and _CreateAppHost. The destination
apphost path is also computed here, and passed to the CreateAppHost
task as an input.

This way, during a "publish --no-build", the apphost destintation
path (of the previously-generated apphost) is computed as a dependency
of _ComputeNETCoreBuildOutputFiles, and it is copied to the publish
directory without causing CoreCompile to run.
</AssignTargetPath>
<ItemGroup>
<_NoneWithTargetPath Include="@(_AllNETCoreCopyLocalItemsWithTargetPath)" />
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the create/get split, can this go before AssignTargetPaths again so that we don't need to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, unless we change when AssignTargetPaths runs. I see this dependency chain putting AssignTargetPaths before build, which is too early for the AppHost: CoreBuild -> PrepareResources -> PrepareResourceNames -> AssignTargetPaths.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow yet. We're just computing paths here in this target now, not actually generating the apphost. Why can't that be done sooner?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think I understand now. It seems strange that we would add the apphost to None potentially before it exists. Won't that cause some item metadata to be missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there's a problem with that. @rainersigwald ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think there'd be a problem. Well-known/built-in metadata is evaluated just-in-time, so if you create an item, create the file, and then ask for %(Whatever.ModifiedTime) it should still work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok looking at this after the initial commit, btw. If this is green, we can merge as is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it as-is then. Thanks for all the help!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution of this feature!

@nguerrera
Copy link
Contributor

I will investigate the tests failing on full msbuild leg. (At the moment, the new CI system does not publish test logs nor can it re-run individual legs, but I'm told this is getting resolved next week.)

@nguerrera
Copy link
Contributor

nguerrera commented Sep 27, 2018

Test failure:

Unit.net Console Runner (64-bit .NET Core 4.6.26515.07)
  Discovering: Microsoft.NET.Pack.Tests
  Discovered:  Microsoft.NET.Pack.Tests
  Starting:    Microsoft.NET.Pack.Tests
    Microsoft.NET.Pack.Tests.GivenThatWeWantToPackANetFrameworkLibrary.ImplicitReferencesAreNotIncludedAsFrameworkReferences [FAIL]
      Expected command to pass but it did not.
      File Name: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\msbuild.exe
      Arguments: /t:Pack D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj
      Exit Code: 1
      StdOut:
      Microsoft (R) Build Engine version 15.9.14-preview+gae560092f5 for .NET Framework
      Copyright (C) Microsoft Corporation. All rights reserved.
      Build started 9/27/2018 11:50:44 AM.
      Project "D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj" on node 1 (Pack target(s)).
      _CheckForNETCoreSdkIsPreview:
      D:\Src\sdk\artifacts\Debug\bin\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(145,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      PrepareForBuild:
        Creating directory "bin\Debug\net461\".
        Creating directory "obj\Debug\net461\".
      CoreCompile:
        C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;DEBUG;NETFRAMEWORK;NET461 /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.IO.Compression.FileSystem.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Numerics.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.Linq.dll" /debug+ /debug:portable /filealign:512 /optimize- /out:obj\Debug\net461\PackImplicitReferences.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /target:library /warnaserror- /utf8output /deterministic+ PackImplicitReferences.cs "C:\Users\nicholg\AppData\Local\Temp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" obj\Debug\net461\PackImplicitReferences.AssemblyInfo.cs /warnaserror+:NU1605
        Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Roslyn
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057: The target "_AfterCompileWinFXInternal [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057:      [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057:       _CreateAppHost" does not exist in the project. [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      Done Building Project "D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj" (Pack target(s)) -- FAILED.
      Build FAILED.
      "D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj" (Pack target) (1) ->
        C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057: The target "_AfterCompileWinFXInternal [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057:      [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3261,7): error MSB4057:       _CreateAppHost" does not exist in the project. [D:\Src\sdk\artifacts\Debug\tmp\PackImplicitReferences\PackImplicitReferences\PackImplicitReferences.csproj]
          0 Warning(s)
          1 Error(s)

I think this has something to do with two-phase WPF builds. Investigating further.

@nguerrera
Copy link
Contributor

nguerrera commented Sep 27, 2018

Oh, it looks like it's just a missing semicolon here:

    <CompileDependsOn>
-      $(CompileDependsOn)
+      $(CompileDependsOn);
      _CreateAppHost;
    </CompileDependsOn>

@nguerrera
Copy link
Contributor

After fixing that, there's another failure on my box. Investigating

      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error APPX0002: Task 'ValidateConfiguration' failed. Value cannot be null. [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error APPX0002: Parameter name: input [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error APPX0002:  [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018: The "ValidateConfiguration" task failed unexpectedly. [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018: System.ArgumentNullException: Value cannot be null. [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018: Parameter name: input [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at System.Version.Parse(String input) [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.AppxPackage.ValidateConfiguration.ExecuteImplementation() [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute(String file) [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018: --- End of stack trace from previous location where exception was thrown --- [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute(String file) [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.AppxPackage.ValidateConfiguration.Execute() [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]
      C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(6068,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:\Src\sdk\artifacts\Debug\tmp\PCL_Project_r---890FB1DF\Dependency\Dependency.csproj]

@nguerrera
Copy link
Contributor

That second failure is internal bug 686365, which is fixed but my dogfood build hasn't updated. I believe the CI machine would not have a build of VS with that bug so this should be green once the semicolon is fixed.

The apphost is (optionally) customized by copying resources from the
managed dll, and setting the GUI bit based on the Target
property (which also modifies the managed dll). Therefore, we use the
managed dll as an input for incremental build (the apphost needs to be
updated iff the managed dll was updated). This fixes
dotnet#2554.

This also removes the unnecessary overwriteExisting flag from
AppHost.Create, fixing dotnet#2473.
Copy link
Member Author

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nguerrera thank you for investigating the CI failures!

</AssignTargetPath>
<ItemGroup>
<_NoneWithTargetPath Include="@(_AllNETCoreCopyLocalItemsWithTargetPath)" />
</ItemGroup>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, unless we change when AssignTargetPaths runs. I see this dependency chain putting AssignTargetPaths before build, which is too early for the AppHost: CoreBuild -> PrepareResources -> PrepareResourceNames -> AssignTargetPaths.

@peterhuene
Copy link
Contributor

It looks like some of the tests didn't get updated with the removal of overwriteExisting.

@sbomer
Copy link
Member Author

sbomer commented Oct 1, 2018

Oops, left those changes out of my commit for some reason. Thanks.

@livarcocc livarcocc merged commit c202205 into dotnet:master Oct 1, 2018
@nguerrera
Copy link
Contributor

👏 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants