Background: We have old-style ASP.NET WSP - web site project. This is the one that does not produces single DLL and uses dll.refresh
files for reference mappings.
Problem: Using VS2017, we're able to work with it with no issues but only as long as DLLs we reference are not x64. See pictures below
As result, in code files we get suggestions to "add reference". This type of "project" is regulated in large by web.config
. But I couldn't find any switch that would help. I also turned on "Use 64-bit IIS" in tools but no help.
What do we know
Aspnet_compiler
against this WSP with x64 dependencies, it compiles fineashx
handlers and it doesn't pull dependencies - we have to know which DLLs to supply and then it will compile.It seem to me that somehow I need to tell Visual Studio to use 64-bit tools, but I don't know how. For projects with project files there is <AspNetToolPath>
tag. But how to replicate this here? When I build with MSBUILD it gives me ASPNETCOMPILER : error ASPCONFIG: Could not load file or assembly... incorrect format
. So, there is something with wrong toolset and in VS background compilation is not working. And same with MSBuild - it picks wrong toolset, or, it picks whatever toolset is should but I need to give command which to use.
This is official answer I've got from Microsoft
...unfortunately Visual Studio does not have good support for 64 bit assemblies for website projects. In general, this is because Visual Studio and an external process used for Asp.Net intellisense are 32bit applications and thus cannot load these assemblies. However, since this is a website the build will happen on the server when the page is requested. Because of this, and in general to improve the F5 inner-loop, you can turn off the build in VS - it is only used for validation purposes anyway. To do this:
right-click on Project node and choose Property Pages
On the Build tab change the Before running startup page option to "No build", and uncheck the Build web site as part of solution
Doing this means you will not see build errors in the IDE, instead they will appear in the browser when you browse to the affected page. And intellisense will not be accurate since types from the 64 bit assemblies will not be recognized.