Type ‘Object’ is defined in an assembly that is not referenced (NET Standard 2.0/.NET Framework 4.6.1) [duplicate]

Try to add a reference to netstandard in web.config as below: <system.web> <compilation debug=”true” targetFramework=”4.7.1″> <assemblies> <add assembly=”netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51″/> </assemblies> </compilation> </system.web>

Convert .NET Core 2.0 class libraries to .NET Standard

In the project file, you can point target compilation to netstandard with the exact version. Example of Proj.csproj: <Project Sdk=”Microsoft.NET.Sdk”> <PropertyGroup> <TargetFramework>netstandard1.6</TargetFramework> </PropertyGroup> </Project> … Microsoft provides good documentation about targeting types. Dotnet Standard is not a framework or a library, it is an abstract set of instructions: what functionality should have System.Array, String, List, … Read more

Could not load file or assembly ‘System.ComponentModel.Annotations, Version=4.1.0.0

In many cases, this can be solved by adding the following code to the csproj file of your test project: <PropertyGroup> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> </PropertyGroup> This forces the build process to create a .dll.config file in the output directory with the needed binding redirects. The reason is that “classic” csproj test projects are true “libraries” and … Read more

What are the application implications of a netstandard library depending on a metapackage?

In the past, we’ve given developers the recommendation to not reference the meta package (NETStandard.Library) from NuGet packages but instead reference individual packages, like System.Runtime and System.Collections. The rationale was that we thought of the meta package as a shorthand for a bunch of packages that were the actual atomic building blocks of the .NET … Read more

What are .NET Platform Extensions on docs.microsoft.com?

It represents APIs that are shipped as NuGet packages instead of being part of the shared framework for .NET Core. We don’t have the ability right now to identify the different packages and which target frameworks they support on learn.microsoft.com, but it’s something that is in our backlog to solve. So adding that as a … Read more

Auto Versioning in Visual Studio 2017 (.NET Core)

Add <Deterministic>False</Deterministic> inside a <PropertyGroup> section  of .csproj The workaround to make AssemblyVersion * working is described in “Confusing error message for wildcard in [AssemblyVersion] on .Net Core #22660” Wildcards are only allowed if the build is not deterministic, which is the default for .Net Core projects. Adding <Deterministic>False</Deterministic> to csproj fixes the issue. The reasons why .Net Core … Read more

Unit testing internal methods in VS2017 .NET Standard library

According to .NET docs for the InternalsVisibleToAttribute: The attribute is applied at the assembly level. This means that it can be included at the beginning of a source code file, or it can be included in the AssemblyInfo file in a Visual Studio project. In other words, you can simply place it in your own … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)