I have Installed Newtonsoft.Json from manage Nuget packages in Visual studio yet I get The type or namespace name 'Newtonsoft' could not be found - json.net

I have downloaded a tutorial file in which the tutor is explaing how to use Moralis to connect a wallet to a Unity game. However in many of the scripts it needs to use Newtonesoft.Json which apparently it can't.
I have already installed Newtonsoft.Json using NuGet package manager in Visual studio both in version 2022 and 2019. But yet I get this error.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) Assembly-CSharp D:\work\UNITY\Moralis test2\Moralis test2\Assets\MoralisWeb3ApiSdk\Moralis\Moralis.Web3Api.Core\Models\NftTransfer.cs 6 Active
enter image description here

Related

Blazor error Type or namespace name 'App' could not be found

I have migrate project from .NET 6 to .NET 7 preview 2, and now I have this output:
error CS0246: The type or namespace name 'App' could not be found
I am using Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.2.0 Preview 2.1.
Go to your Program.cs and check if this line displays an error.
builder.RootComponents.Add<App>("#app");
If you're using Visual Studio, go to that line and hit Alt + Enter to show the code suggestions. Check if it asks you to import the root namespace of your project. Example: if your project is named MyProject you might need to add using Myproject at the import section of the Program.cs file.
Double check all installed nuget packages are also updated to the appropriate preview version that is compatible with .NET 7

.net core 2.1 can't reference automapper in startup.cs

In my nugent panel, I installed
AutoMapper v7.0.1
AutoMapper.extensions.microsoft.dependencyinjection v5.0.1
In my Startup.cs,
I added
Services.AddAutoMapper();
but the compiler gives
Severity Code Description Project File Line Suppression State
Error CS1061 'IServiceCollection' does not contain a definition for 'AddAutoMapper' and no accessible extension method 'AddAutoMapper' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) OPEApiService J:\Projects\OPEApiService\OPEApiService\Startup.cs 58 Active
I tried clean, rebuild, close and reopen VS.
Any help is appreciated.
Thanks
This could be a compatibility issue between the two packages.
If you have both the AutoMapper and AutoMapper.extensions.microsoft.dependencyinjection packages installed, remove them and add only the AutoMapper.extensions.microsoft.dependencyinjection. It has a dependency on the AutoMapper package.
I had this same issue and was able to resolve it.
You missed the restore step. From the root directory where the solution file exists, run following command:
dotnet clean
dotnet restore
dotnet build
Build error I received after including the services.AddAutoMapper();
Then after executing the series of command, got it running.
You need to add a reference to :
$ AutoMapper.Extensions.Microsoft.DependencyInjection
Search it using NuGet Packages Manager and install it.

VSTS Build fails with: The type or namespace name 'Practices' does not exist in the namespace 'Microsoft'

I have a web api project that is working fine in my local machine. After I pushed it to GIT on Visual Studio Team Services, created a build definition (with Restore NuGet packages enabled) and queued a build, i get the below error:
The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (Are you missing assembly reference?)
I have tried building with "Keep Local" property both true and false & "Specific version" property both true and false for the CommonLibrary references. Any combination for these two properties is resulting in the same.
I had a similar problem with VSO build and Azure packages:
The problem was solved by reinstalling the packages for the projects.
In the Package Manager Console:
Update-Package -Reinstall
This is how i resolved it. I made sure that the same libraries referred in packages.config file in all five projects of the solution have same version number. (In most cases, i re-installed from NuGet manager). In the Git branch, i deleted the packages folder so that the libraries are restored afresh. That did the trick. The build passed the next time.
I had exactly the same symptoms, but in my case it turns out that although I could see the package listed under 'References' for my .Web project and all ran OK locally it wasn't actually installed.
Installing the package via the NuGet UI worked for me.

SplendidCRM project couldn't be run from visual studio

I have installed SplendidCRM Community edition , and when i have opened the solution in visual studio to run the code i faced the following error
Error 240 The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\inetpub\wwwroot\SplendidCRMWeb Site\Calendar\DayGrid.ascx.cs 25 18 SplendidTest
How can I solve this error ? Please help me since i am new in SplendidCRM ..
thanks
We provide CSPROJ files with the application. You must open the appropriate project file for your version of Visual Studio. SplendidCRM7_VS2010 for Visual Studio 2010, for example. If you have a newer version of Visual Studio, just open the newest project file and Visual Studio will convert appropriately.

from 4.5 to 4.0 :The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft'

I was working on .Net 4.5 used SignalR 1.1.2 and everything works fine.
Then we want to lower the version of netframework to 4.0 cos of production server, everything stopped and this error appeared. Please tell me what to do?
The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Solved problem by removing reference from project then build. After failed Build Add reference. Working perfectly in .net 4.0.
We can also Uninstall then install nuGet Packages.
Solved by deleting the contents of bin and obj folder on my project folder, then open the project and rebuild.

Resources