Is .NET Core RC2 applicationhost.config incompatible with ASP.NET.NET 4.6?

For a solution containing two websites:

1) ASP.NET based on .NET 4.61

2) .NET Core RC2

After running iisexpress for (2), MSVS updates applicationhost.config to contain a few extra lines that seem incompatible with (1). This is not noticed until iisexpress shuts down and then tries to start (1).

Incompatible strings:

<section name="aspNetCore" overrideModeDefault="Allow" /> <add name="AspNetCoreModule" image="C:\Program Files (x86)\Microsoft Web Tools\AspNetCoreModule\aspnetcore.dll" /> <add name="AspNetCoreModule" /> 

When starting up (1), a dialog box appears informing you that “IISExpress failed to start” and the event is recorded:

The DLL module 'C: \ Program Files (x86) \ Microsoft Web Tools \ AspNetCoreModule \ aspnetcore.dll could not be loaded due to a configuration problem. The current configuration supports loading images created for the AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to resolve this processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349 .

Possible solutions?

A) Removed additional lines before starting (1), how to achieve this automatically?

B) Use a different applicationhost.config for each website, is there an environment variable for this?

C) Directly fix the problem indicated in the event log. Somehow it works when you run the .NET Core RC2 site, so it's weird.

D) Use separate decision files that are in different directories. This is undesirable, as it is a rather complicated solution.

+6
source share
3 answers

A similar problem with this will occur if you create a solution with mixed .NET Core RC2 and ASP.NET <5 projects, and then switch to .NET Core 1.0. ASP.NET projects will no longer run.

To fix, delete .vs \ config \ applicationhost.config and unload and reload the project / solution in order to force VS to correctly restore .NET Core 1.0, then any old .NET material will be launched.

I also found out that Event Viewer logs the exact command line that IIS Express works with when you try to run it in VS, so you can grab it and paste it into the command line to get error output from IIS Express, which is especially useful if Event Viewer does not have the errors themselves.

+8
source

Here is what worked - by proposal (B):

1) To the add tag that indicated "image", add

 preCondition="bitness32" 

2) Add a location block, if it does not already exist, specify remove:

  <location path="Your_NonCore_SiteName"> <system.webServer> <modules> <remove name="AspNetCoreModule" /> </modules> </system.webServer> </location> 

Not sure why this works because bitness32 seems to me in the opposite direction (because the original error message says it is amd64).

Now both nodes can start simultaneously, and MSVS does not cancel these manual changes.

Use at your own risk! We hope for a better answer or improvement with the next version.

+2
source

This should be fixed with the latest tools (VS 2015 Update 3 and DotNetCore.1.0.0-VS2015Tools.Preview2) https://www.microsoft.com/net/core#windows

AspNetCoreModule now has the correct installer for IIS Express (part of the new snap-in).

0
source

All Articles