Block Query πŸš€

You must add a reference to assembly netstandard Version2000

February 18, 2025

You must add a reference to assembly netstandard Version2000

Troubleshooting .Nett model errors tin beryllium a existent headache, particularly once encountering messages similar “You essential adhd a mention to meeting ’netstandard, Interpretation=2.zero.zero.zero’.” This mistake sometimes arises once a task constructed connected a newer .Nett model makes an attempt to make the most of a room oregon constituent that relies upon connected netstandard2.zero. Knowing the underlying causes and options is important for immoderate developer running successful the .Nett ecosystem.

Knowing the ’netstandard’ Model

The .Nett Modular is a ceremonial specification of .Nett APIs that are supposed to beryllium disposable connected each .Nett implementations. Deliberation of it arsenic a communal crushed for antithetic .Nett flavors similar .Nett Model, .Nett Center, and Xamarin. Netstandard2.zero represents a cardinal interpretation with a importantly expanded API aboveground, enabling higher codification sharing crossed antithetic .Nett platforms. Once a task targets netstandard2.zero, it declares its dependency connected this circumstantial fit of APIs.

This mistake communication normally pops ahead once a task focusing on a greater .Nett Modular interpretation oregon a circumstantial .Nett implementation (e.g. .Nett 6) tries to usage a room constructed for netstandard2.zero with out the appropriate references. This tin stem from NuGet bundle dependencies, task references inside a resolution, oregon equal mismatched model variations inside the aforesaid task.

Ideate gathering a home (your exertion) and attempting to usage prefabricated partitions (libraries) designed for a somewhat older gathering modular. Piece any elements mightiness acceptable, others whitethorn necessitate changes oregon circumstantial adapters to guarantee compatibility.

Communal Causes of the Mistake

Respective eventualities tin pb to the “You essential adhd a mention to meeting ’netstandard, Interpretation=2.zero.zero.zero’” mistake. 1 predominant wrongdoer is lacking NuGet packages. Once a task depends connected a bundle that relies upon connected netstandard2.zero, failing to reconstruct the essential NuGet packages tin set off the mistake. Different communal origin is incorrect task references. If your resolution incorporates aggregate initiatives and 1 task depends connected different that targets netstandard2.zero, an incorrect oregon lacking task mention tin origin this content. Incompatibility betwixt .Nett Model variations inside the aforesaid task tin besides lend to this mistake.

For case, ideate utilizing a logging room (similar Serilog) that targets netstandard2.zero. With out together with the Serilog NuGet bundle and guaranteeing its appropriate set up inside your task, you’re apt to brush this mistake once attempting to make the most of its functionalities.

Moreover, inconsistencies successful your task’s configuration, specified arsenic an outdated .csproj record, tin besides pb to this content. This is peculiarly applicable once migrating older tasks to newer .Nett variations.

Options and Troubleshooting Steps

Resolving this mistake frequently entails making certain each essential NuGet packages are put in and appropriately referenced. You tin accomplish this by utilizing the NuGet Bundle Director inside Ocular Workplace oregon the .Nett CLI. Confirm that the task record (.csproj) accurately contains the required references. If task references are active, treble-cheque that they are appropriately configured and mark suitable .Nett variations.

  1. Cheque NuGet Packages: Guarantee each essential packages are put in and restored.
  2. Confirm Task References: Corroborate the accuracy and compatibility of task references.
  3. Replace .Nett Model Variations: Guarantee each initiatives and libraries mark suitable .Nett variations, oregon see upgrading to a newer, unifying model similar .Nett 6.

Generally, cleansing and rebuilding the resolution tin resoluteness lingering points associated to cached assemblies oregon outdated physique artifacts. If the job persists, cautiously analyze the mistake messages and stack traces for clues astir the circumstantial lacking references. On-line assets similar Stack Overflow and Microsoft’s documentation tin supply invaluable insights and options for circumstantial eventualities.

Champion Practices to Debar the Mistake

Adopting a fewer champion practices tin aid you debar encountering this mistake successful the archetypal spot. Conserving your NuGet packages up to date and accordant crossed your tasks is important. Recurrently reviewing and updating task references tin forestall inconsistencies. Furthermore, migrating to the newest .Nett variations, once possible, simplifies dependency direction and promotes transverse-level compatibility. Utilizing a accordant .Nett interpretation crossed your resolution reduces the hazard of compatibility points.

See utilizing a bundle director similar NuGet to streamline dependency direction. This helps guarantee that your tasks ever mention the accurate variations of required libraries.

Pursuing these practices ensures a smoother improvement education and reduces the probability of encountering irritating dependency points.

  • Support NuGet Packages Up to date.
  • Commonly Reappraisal Task References.
  • Migrate to Newest .Nett Variations.

Infographic Placeholder: Ocular cooperation of .Nett Modular compatibility and dependency direction.

Leveraging a accordant .Nett interpretation crossed your tasks, on with diligently managing dependencies, establishes a strong instauration for gathering and deploying .Nett functions, minimizing compatibility hurdles and maximizing codification reusability.

Larn much astir .Nett improvement champion practices. Research assets connected Microsoft’s authoritative documentation and delve deeper into dependency direction inside .Nett. By proactively addressing possible compatibility points and adhering to champion practices, you tin streamline your improvement workflow and physique sturdy, transverse-level functions. FAQ: What if I’m inactive encountering the mistake last attempting these options? If the mistake persists last implementing the beneficial steps, cautiously analyse the elaborate mistake messages and seek the advice of on-line sources oregon assemblage boards for aid tailor-made to your circumstantial script. Offering elaborate accusation astir your task configuration and dependencies volition aid others diagnose the content much efficaciously.

Outer sources:

Question & Answer :
The task is an ASP.Nett MVC Net App concentrating on the .Nett Model four.6.1.

Each of a abrupt (any NuGet packages have been upgraded) I began to acquire the pursuing mistake throughout runtime:

CS0012: The kind ‘Scheme.Entity’ is outlined successful an meeting that is not referenced. You essential adhd a mention to meeting ’netstandard, Interpretation=2.zero.zero.zero, Civilization=impartial, PublicKeyToken=cc7b13ffcd2ddd51’.

Successful my chief position Scale.cshtml, successful a formation wherever I brand usage of @Html.ActionLink

I bash person .Nett Center SDK 2.zero and .Nett Model four.7.1 put in successful my device however I don’t privation to see a mention to it. This is a .Nett Model net app lone, it’s hosted connected Home windows IIS wherever the put in model is four.6.1, location’s nary Nett Center put in successful the server.

Truthful wherefore is it asking to adhd a mention to netstandard? However tin I hole it with out referencing netstandard however the afloat Home windows .Nett Model four.6.1?

I’ve checked retired a former perpetrate which labored good and I’m inactive getting this mistake. Truthful it’s not associated to NuGet packages being upgraded. Appears to beryllium thing connected my section dev device.

If a print the app to a listing and tally it with IIS it plant.

Nexus to .csproj gist

packages.config

<?xml interpretation="1.zero" encoding="utf-eight"?> <packages> <bundle id="Antlr" interpretation="three.5.zero.2" targetFramework="net46" /> <bundle id="BundleTransformer.Center" interpretation="1.9.sixty nine" targetFramework="net46" /> <bundle id="BundleTransformer.Handlebars" interpretation="1.9.seventy three" targetFramework="net46" /> <bundle id="BundleTransformer.Little" interpretation="1.9.sixty nine" targetFramework="net46" /> <bundle id="BundleTransformer.Yui" interpretation="1.9.fifty two" targetFramework="net46" /> <bundle id="Dapper" interpretation="1.forty two" targetFramework="net46" /> <bundle id="EcmaScript.Nett" interpretation="1.zero.1.zero" targetFramework="net46" /> <bundle id="EntityFramework" interpretation="6.zero.zero" targetFramework="net46" /> <bundle id="Glimpse" interpretation="1.eight.6" targetFramework="net46" /> <bundle id="Glimpse.AspNet" interpretation="1.9.2" targetFramework="net46" /> <bundle id="Glimpse.Mvc5" interpretation="1.5.three" targetFramework="net46" /> <bundle id="JavaScriptEngineSwitcher.Center" interpretation="1.2.four" targetFramework="net46" /> <bundle id="JavaScriptEngineSwitcher.V8" interpretation="1.three.zero" targetFramework="net46" /> <bundle id="jQuery" interpretation="2.1.three" targetFramework="net46" /> <bundle id="jQuery.Validation" interpretation="1.thirteen.1" targetFramework="net46" /> <bundle id="LowercaseDashedRoute" interpretation="1.zero.14" targetFramework="net46" /> <bundle id="Microsoft.AspNet.Mvc" interpretation="5.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.Razor" interpretation="three.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.Net.Optimization" interpretation="1.1.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.WebApi" interpretation="5.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.WebApi.Case" interpretation="5.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.WebApi.Center" interpretation="5.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.WebApi.WebHost" interpretation="5.2.three" targetFramework="net46" /> <bundle id="Microsoft.AspNet.WebPages" interpretation="three.2.three" targetFramework="net46" /> <bundle id="Microsoft.jQuery.Unobtrusive.Validation" interpretation="three.2.three" targetFramework="net46" /> <bundle id="Microsoft.Owin" interpretation="three.zero.1" targetFramework="net46" /> <bundle id="Microsoft.Owin.Adult.SystemWeb" interpretation="three.zero.1" targetFramework="net46" /> <bundle id="Microsoft.SqlServer.Compact" interpretation="four.zero.8876.1" targetFramework="net46" /> <bundle id="Microsoft.Net.Infrastructure" interpretation="1.zero.zero.zero" targetFramework="net46" /> <bundle id="Minute.js" interpretation="2.10.2" targetFramework="net46" /> <bundle id="Newtonsoft.Json" interpretation="10.zero.three" targetFramework="net46" /> <bundle id="NWebsec" interpretation="5.1.1" targetFramework="net46" /> <bundle id="NWebsec.Center" interpretation="2.1.zero" targetFramework="net46" /> <bundle id="NWebsec.Mvc" interpretation="5.1.1" targetFramework="net46" /> <bundle id="Owin" interpretation="1.zero" targetFramework="net46" /> <bundle id="React" interpretation="1.four.2" targetFramework="net46" /> <bundle id="Sendgrid" interpretation="6.three.zero" targetFramework="net46" /> <bundle id="SendGrid.SmtpApi" interpretation="1.three.1" targetFramework="net46" /> <bundle id="Serilog" interpretation="2.6.zero" targetFramework="net46" /> <bundle id="Serilog.Enrichers.Situation" interpretation="2.1.2" targetFramework="net46" /> <bundle id="Serilog.Sinks.Record" interpretation="three.2.zero" targetFramework="net46" /> <bundle id="Serilog.Sinks.RollingFile" interpretation="three.three.zero" targetFramework="net46" /> <bundle id="Serilog.Sinks.Sentry" interpretation="2.1.four" targetFramework="net46" /> <bundle id="SerilogWeb.Classical" interpretation="2.1.17" targetFramework="net46" /> <bundle id="SharpRaven" interpretation="2.2.zero" targetFramework="net46" /> <bundle id="Scheme.Information.SQLite" interpretation="1.zero.108.zero" targetFramework="net46" /> <bundle id="Scheme.Information.SQLite.Center" interpretation="1.zero.108.zero" targetFramework="net46" /> <bundle id="Scheme.Information.SQLite.EF6" interpretation="1.zero.108.zero" targetFramework="net46" /> <bundle id="Scheme.Information.SQLite.Linq" interpretation="1.zero.108.zero" targetFramework="net46" /> <bundle id="Twitter.Bootstrap.Little" interpretation="three.three.four" targetFramework="net46" /> <bundle id="WebActivatorEx" interpretation="2.zero.6" targetFramework="net46" /> <bundle id="WebGrease" interpretation="1.6.zero" targetFramework="net46" /> <bundle id="YUICompressor.Nett" interpretation="2.7.zero.zero" targetFramework="net46" /> </packages> 

Once publishing the app utilizing VS2017 to the record scheme I acquire the pursuing informing successful the output:

The pursuing meeting has dependencies connected a interpretation of the .Nett Model that is greater than the mark and mightiness not burden accurately throughout runtime inflicting a nonaccomplishment: netstandard, Interpretation=2.zero.zero.zero, Civilization=impartial, PublicKeyToken=cc7b13ffcd2ddd51. The dependencies are: Scheme.Transactions, Interpretation=four.zero.zero.zero, Civilization=impartial, PublicKeyToken=b77a5c561934e089. You ought to both guarantee that the babelike meeting is accurate for the mark model, oregon guarantee that the mark model you are addressing is that of the babelike meeting.

However I tin’t discovery thing connected Scheme.Transactions. However tin I hunt what’s referencing it?

I deliberation the resolution mightiness beryllium this content connected GitHub:

Attempt adhd netstandard mention successful net.config similar this:"

<scheme.internet> <compilation debug="actual" targetFramework="four.7.1" > <assemblies> <adhd meeting="netstandard, Interpretation=2.zero.zero.zero, Civilization=impartial, PublicKeyToken=cc7b13ffcd2ddd51"/> </assemblies> </compilation> <httpRuntime targetFramework="four.7.1" /> 

I realise you’re utilizing four.6.1 however the prime of .Nett four.7.1 is important arsenic older Model variations are not full suitable with .Nett Modular 2.zero.

I cognize this from achy education, once I launched .Nett Modular libraries I had a batch of points with NUGET packages and references breaking. The another alteration you demand to see is upgrading to PackageReferences alternatively of bundle.config records-data.

Seat this usher and you mightiness besides privation a implement to aid the improve. It does necessitate a advanced VS 15.7 interpretation although.