Azure Cloud Service Classic with standard .NET platform installed

Is there a way to launch an Azure Cloud Service Classic project with an artist role that targets .netstandard2.0?

I have such a project, but at any time when I try to build it, I get this error:

Severity Code Description Project file line suppression status Project error 'C: \ path \ to \ Project \ Src \ Frontend \ Frontend.csproj' of target ".NETStandard, Version = v2.0". It cannot be referenced by a project whose purpose is ".NETFramework, Version = v4.0. UserDiscoveryService C: \ Program Files \ dotnet \ sdk \ 2.0.2 \ Sdks \ Microsoft.NET.Sdk \ build \ Microsoft.NET.Sdk.Common .targets 87

I tried to set the target structure inside ccproj, but that didn't help me.

+4
source share
2 answers

Just in case, when someone encounters this, I missed this error by adding this line to the Project / PropertyGroup section of the cloud services.ccproj file: <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>

eg

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>2.9</ProductVersion>
    <ProjectGuid>8c99xxxx-xxxx-xxxx-xxxx-xxxxxxxx273e</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MyCloudService</RootNamespace>
    <AssemblyName>MyCloudService</AssemblyName>
    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <!-- Added -->
    <StartDevelopmentStorage>True</StartDevelopmentStorage>
    <Name>CloudSheetCloudService</Name>
    etc...

By default, the cloud services project does not define the structure (it does not need it), but something in MSBuild seems to be performing a version check between the cloud service and the web / worker roles, and then the build fails.

Changing the version of the tools did not help.

As a background - I have an old cloud service that references project 4.6.2, which uses the new csproj style as follows:

<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>net462</TargetFramework>
   </PropertyGroup>
</Project>

NTN. Mark.

Change: The file to be edited is a .ccproj, not a .cproj file, as previously indicated.

+3
source

" " "C:\path\to\project\src\Frontend\Frontend.csproj" ".NETStandard, Version = v2.0". , ".NETFramework, Version = v4.0".

, Frontend.csproj .NETStandard 2.0, .NETStandard 2.0 .NETFramework V4.0. .NET Standard, .NETFramework V4.6.1 .NETStandard 2.0 . .NET Standard, . NET.

0

Source: https://habr.com/ru/post/1688889/


All Articles