I am trying to use Jint in my C# WinForms Application but NuGet is refusing to install the package. I can install other packages perfectly fine including this one called JavaScriptEngineSwitcher.Jint. I googled around and couldn't find anyone else with the same problem. The error says it has a problem with the .NET Framework version but it is my understanding that 4.0 should be just fine (even so, I played around with it but nothing worked).
https://www.nuget.org/packages/Jint/2.1.0
The package does work fine in .NET 4.0 packages. Make sure you have the latest update of the Package Manager console. If it is updated or udpating doesn't work, try restarting Visual Studio and try again.
Related
I recently reinstalled my Windows 10 OS, and now Nuget packages are "not compatible". After an explanation, I will be asking, how do I resolve this problem.
Lead up
Due to an unrelated problem, I had to reinstall my operating system. In the course of that, I reinstalled Visual Studio 2019. I cloned my repository (https://github.com/PaulSchrum/CogoDN), then opened it locally with VS.
Now when I build, I get several Nuget errors and warnings. These Nuget dependencies have been present in my code since December 2019, and never caused me a problem until this month (July 2020) associated with the reinstallation of VS.
Question: How do I resolve this problem?
Other Details
I am targeting .Net Core 3.1, but it happens no matter which version of .Net Core I target.
The main error seems to be of the pattern:
NU1202 Package System.Drawing.Common 4.5.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1).
This is happening for System.Drawing.Common, netDxf.netstandard, and packages necessary for Microsoft Tests. Specifically, it can't recognize using Microsoft.VisualStudio.TestTools.UnitTesting; (namespace 'VisualStudio' does not exist), and every attribute ([TestClass], [TestMethod]) now is a syntax error.
What have I already tried
Various combinations of reestablishing the Nuget packages. This includes at least twice clearing the Nuget cache and installing the dependencies again. I also followed the advice here: https://stackoverflow.com/a/63108317/1339950 (Item 3) Close VS, Delete global NuGet.config, start VS and let it rebuild Nuget.config.
None of these work.
One last note: I have tried so many things and got into various different states of not working that my description may have inadvertently conflated a few details.
Visual Studio can't resolve Nuget dependencies after reinstalling
operating system
It is quite strange and in my side, I can also build the project without any errors.(I download the project from your github link and then open it with VS0219----build well).
So I think your Net Core SDK or VS IDE have broken.
1), please try to install the latest Net Core 3.1 Developer SDK.
Or you could open Programs and Features from Control Panel, then right-click on every net core sdk-->Change-->Repair
2) run sfc /scannow to scan your os and you can refer to this link for more steps.
3), try to do a repair in VS Installer. Or if your VS2019 is not the latest, please update it to the latest version.
4) try to create a new net core project and then install these nuget packages to check if the issue still persists.
I wrote a project, I ran cmd, to connect my codes to SQLserver. when I typed dotnet ef migrations add...; It said : that it can't find this 3.1.1 version folder despite the fact that when I asked the version, it would say it is 3.1.1 version.
So i downloaded the 3.1.1 sdk from Microsoft website, I installed it and nothing changed, the 3.1.1 folder wasn't added. I tried to find the folder but I could not.
Suddenly out of nowhere, I decided to download the framework instead. I opened it and it didn't need installation. I just copied this framework and replaced it with the whole dotnet folder which I had problems with😓. The problem started there, again I executed cmd and wrote dotnet ef... It said there is no ef. I again replaced the framework with another one, it said wrong machine, one another time and it said the dotnet image doesn't fit my pc or sth like this. I uninstalled the dotnet and installed it again, it now says an attempt was made to load a program with an incorrect format. I searched this error, they said I should change the 64bit iis to 32bit. I tried but I can't. Iis manager doesn't have the enable 32 bit option for me! And in the other ways folders are missing.
What should I do?
I solved it by first deleting the dotnet folder, then reinstalling visual studio.
Then I downloaded the dotnet sdk for runtime which is suitable for my computer
I'm trying to add MVVM Light to an existing project through NuGet but I get this error message:
Attempting to resolve dependency 'MvvmLightLibs (≥ 4.2.30.0)'.
Attempting to resolve dependency 'CommonServiceLocator (≥ 1.2)'.
Successfully installed 'CommonServiceLocator 1.2'.
Successfully installed 'MvvmLightLibs 4.3.31.1'.
Successfully installed 'MvvmLight 4.2.30.0'.
Successfully uninstalled 'CommonServiceLocator 1.2'.
Install failed. Rolling back...
Could not install package 'CommonServiceLocator 1.2'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v4.0,Profile=Client', but the package
does not contain any assembly references that are compatible
with that framework. For more information, contact the package
author.
I've tried retargeting my project to .NET framework 4.0, 4.0 client profile, and 4.5. Any ideas? I wasn't having this issue as recently as two weeks ago.
Had the same Problem today. Try to install the newest Version of Nuget in your Visual Studio Addins first !
I am able to install while targeting 4.5 and using Nuget for "MVVM Light Libraries only"
Does installing https://www.nuget.org/packages/CommonServiceLocator/1.2.0 first avoid the issue for you?
I had the same issue. Updated Visual Studio 2012 to Update 4, tried again and it worked perfectly. Good luck!
It sounds like your project is targeting .NET 4.0 while you are installing library witch are not compatible to the targeted version.
Please find appropriate version of library and install them
I have a bunch of unit tests written in C# that use moles for mocking a serial port class. I'm using Visual Studio 2008. This has all worked fine until today when I went to re-run the tests... and as soon as it tries to create an MSerialPort object, the warning box pops up with the message "Microsoft.Moles.VsHost has stopped working". I've tried re installing moles, etc but not sure what else to try or where to find more information on this. None of the tests themselves have changed so it's got to be something with the .net runtime or the like. I'm using .net 3.5. Anyone else run into something like this?
Found the problem... something about security update KB2742599 (security update to .NET 3.5) broke moles. I uninstalled this update, restarted the PC, and everything works fine again. I'm using windows 7 SP1, x86.
I'm trying to get up and running with nUnit, which has been pretty painful so far. I have successfully installed and added a reference to the nUnit framework, and I've successfully created a simple test--but get this error when I try to use the nUnit GUI:
C# .NET 4.0 Testing Framework?
On the advice of that post, I'm now trying to run nUnit from inside VS2010 with testdriven.net. I successfully installed testdriven.net, but when I re-start visual studio, I simply don't see the context menus described in the testdriven.net quickstart. How do I know if testdriven.net even installed correctly? What can I do to get up set up with testdriven.net or nUnit?
If you wanna check if it's installed, go to: Tools->Add in Manager, you should see it listed there.
If it's not there, then it is not installed, try the following:
try uninstalling from control panel 'TestDriven.Net 3.0 Personal', restart, then install again while visual studio is closed
make sure you download the RTM not the beta version, right click and unblock the zip file, install as admin.