Closed dillibabun closed 6 years ago
Can any one look into it ?
@dillibabun can you please attach your csproj file?
Hi Mishra,
Our csproj is highly confidential so modified them with dummy data.
<?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>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{84887A73-056A-436F-9F08-86B8D8352D96}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>xxx</RootNamespace>
<AssemblyName>xxx</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\NetStandard20\</OutputPath>
<DefineConstants>TRACE;DEBUG;NetStandard14;NetStandard20;PORTABLE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\NetStandard20\</OutputPath>
<DefineConstants>TRACE;NetStandard14;NetStandard20;PORTABLE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Xml|AnyCPU'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release-Xml\NetStandard20\</OutputPath>
<DefineConstants>TRACE;PORTABLE;NetStandard14;NetStandard20;</DefineConstants>
<DocumentationFile>xxx.xml</DocumentationFile>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\Base\Test1.cs">
<Link>yyy\xxx\Test1.cs</Link>
</Compile>
<Compile Include="..\..\..\Base\Test2.cs">
<Link>yyy\xxx\Test1.cs</Link>
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Target Name="BeforeBuild">
<Copy Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' Or '$(Configuration)|$(Platform)' == 'Release|AnyCPU' Or '$(Configuration)|$(Platform)' == 'Release-Xml|AnyCPU'" SourceFiles="$(ProjectDir)project20.json" DestinationFiles="$(ProjectDir)project.json">
</Copy>
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PreBuildEvent>copy "$(ProjectDir)project20.json" "$(ProjectDir)project.json" /Y</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<NuGetTargetMoniker>.NETStandard,Version=v2.0</NuGetTargetMoniker>
</PropertyGroup>
</Project>
Regards, Dilli babu.
netstandard2.0 projects should use csproj with PackageReference.
What version of vs are you using, is there any reason you are still using project.json?
We have created a legacy project and then changed the .NETStandard version to 2.0. Can't we achieve this?
If your target framework is NETStandard2.0 then use the NETCore SDK project style. Not the legacy project style.
@dillibabun Please let us know if you are still facing this.
After reading the https://blogs.msdn.microsoft.com/dotnet/2017/11/16/announcing-the-windows-compatibility-pack-for-net-core/ blog, thought of creating a Image using .NETStandard2.0 using System.Drawing.Common where i have used System.Drawing.FontStyle,StringAlignment etc.. enums.
But facing following compilation errors Error details: 1) error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 2) error CS0012: The type 'CLSCompliantAttribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
In my Project.Json, i have referred System.Runtime Nuget in which Enum class defined.
My JSON
Anyone, please help to resolve this issue ? This is bottleneck for our application.
Thanks in advance, Dilli babu.