Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

NetCoreApp2.0 Web App with win7-x86 RuntimeIdentifier fails on publish #151

Closed
bzhu94 opened this issue Jun 20, 2017 · 1 comment
Closed

Comments

@bzhu94
Copy link

bzhu94 commented Jun 20, 2017

When I publish a NetCoreApp2.0 Web App (with Individual Authentication) with a win7-x64 RuntimeIdentifier, publish succeeds. However, when I change the RuntimeIdentifier to win7-x86, publish fails and gives the following error during precompilation of the Razor views:

Failed to load the dll from [???], HRESULT: 0x800700C1

An error occurred while loading required library hostpolicy.dll from [C:\Users\brzh\source\repos\Core2.0WebApp\Core2.0WebApp\bin\Release\netcoreapp2.0\win7-x86\]

This happens even when the x86 CLI is installed. This is due to the fact that the _RunForCore target in Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets hardcodes "dotnet exec", so the dotnet.exe used will be first one found when iterating through the probing paths defined by the %path% variable. It happens that C:\Program Files\dotnet\ comes before C:\Program Files (x86)\dotnet in the default value of %path%, so the x64 bits are always used.

As a workaround, if we swapped the order of the two probing paths in %path%, publish would work fine with the x86 RuntimeIdentifier.

@pranavkm
Copy link
Contributor

This is a variant of the issue described in #102.

Publishing for a rid other than the one in the current dotnet is currently broken. Here's a potential workaround for the issue: #102 (comment).

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

No branches or pull requests

2 participants