Skip to content

AspNetCompiler uses the wrong target framework #87

Open
@OronDF343

Description

@OronDF343

When attempting to precompile an ASP.NET WebForms app, the wrong version of aspnet_compiler.exe is chosen, and the wrong target framework version is used.

Example pubxml:

<?xml version="1.0" encoding="utf-8"?>
<Project>
	<PropertyGroup>
		<WebPublishMethod>Package</WebPublishMethod>
		<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
		<LastUsedPlatform>Any CPU</LastUsedPlatform>
		<SiteUrlToLaunchAfterPublish />
		<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
		<ExcludeApp_Data>false</ExcludeApp_Data>
		<DesktopBuildPackageLocation>$(ProjectDir)\..\publish\package.zip</DesktopBuildPackageLocation>
		<PackageAsSingleFile>true</PackageAsSingleFile>
		<_TargetId>IISWebDeployPackage</_TargetId>
		<PrecompileBeforePublish>True</PrecompileBeforePublish>
		<EnableUpdateable>False</EnableUpdateable>
		<DebugSymbols>True</DebugSymbols>
		<WDPMergeOption>DonotMerge</WDPMergeOption>
	</PropertyGroup>
</Project>

This example results in the 32-bit version of aspnet_compiler.exe being used. Adding <Platform>x64</Platform> makes it use the 64-bit one, but it still targets an older framework version (maybe 4.0 as in #70 ?), which causes errors such as error CS0117: 'System.Net.SecurityProtocolType' does not contain a definition for 'Tls12'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions