I'm new to NUnit and am trying to start using it under Visual Studio Community 2017; I'm having a very difficult time getting up and running.
The actual install of NUnit went well. I followed the procedure (option 1) at the Installation page on the NUnit wiki to add NUnit and NUnit.console, and now have those (and NUnit.ConsoleRunner and a handful of NUnit.Extension.* extensions) in the solution.
The NUnit wiki's .NET Core and .NET Standard page says that next is to install the NUnit template, and here's where I get stuck. It says "Run dotnet new -i NUnit3.DotNetNew.Template to install the NUnit templates." I don't seem to have a dotnet.exe anywhere on my system. Looking at Where is the dotnet command executable located on Windows? it looks like the way to get that is to install Microsoft.EntityFrameworkCore.Tools, which led me to https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools/ . Based on that I tried Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.0.1 from the Package Manager Console; but that gives me the errors:
PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.0.1
Install-Package : Could not install package
'Microsoft.EntityFrameworkCore.Tools 2.0.1'. You are trying to install this
package into a project that targets '.NETFramework,Version=v4.5', but the
package does not contain any assembly references or content files that are
compatible with that framework. For more information, contact the package
author.
So I'm really going down a rabbit-hole here, from NUnit3.DotNetNew.Template to to dotnet.exe to Microsoft.EntityFrameworkCore.Tools 2.0.1. Any ideas what to try next?
You were looking in the wrong place.
To get the dotnet.exe (which is not installed by VS2017 out of the box) you need to donwload and install the .NET Core SDK from https://www.microsoft.com/net/download/windows
You need to select the option: .NET Core SDK
.NET Core SDK
Cross-platform .NET implementation. The smallest download to build .NET apps, using command line tools and any editor.
In case this may be of any help to someone: in Visual Studio Community 2017, you can install "NUnit VS Template" from the main menu as follows:
Go to: Tools > Extensions and Updates > Online
Searh for 'nunit'
Click the nunit package you need, and then 'install' on the lateral panel.
You may need to close and reopen VS 2017
Hope it helps
Related
I'm trying to install emgu.CV.runtime.windows from within Visual Studio 2017, and installing by the recommeded method of right-clicking references and installing via NuGet.
However I am getting the error below.
Could not install package 'Emgu.runtime.windows.msvc.rt.x64 19.28.29336'. You are trying to install this package into a project that targets .NETFramework,Version=v4.7.2, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
According to the package information, its dependencies are
enter code here.NetStandardVersion=2.0
enter code here.Engu.CV (> 4.5.1 && < 4.5.2)
enter code here.Engu.runtime.windows.msvc.rt.x86 (= 19.28.29336)
enter code here.Engu.runtime.windows.msvc.rt.x64 (= 19.28.29336)
I checked and c:\windows\Microsoft.NET\Framework contains a folder for v2.0.50727, so it seem .net 2.0 is installed (as is v3.0, v3.5, v4.0.30319)
I have emgu.CV 4.5.1.4349 installed.
I need this library so that I can have the enter code herebitmap.ToImage<Bgr, byte>(); function.
Why am I getting this error?
Any help would be greatly appreciated.
The solution is migrating from package.config to package references for every project you have. Simply right click on package.config and click "migrate package.config to PackageReference".
Then, install the runtime package again and it will work.
For the new Emgu Nuget package you do need to use PackageReference instead of the traditional package.config.
What worked for me on Visual Studio 2017:
Uninstall all NuGet Packages [This removes the package.config file]
Go to Tools --> Options --> NuGet Package Manager --> General
Change the default package management format to "PackageReference"
Check "allow format selection on first package install"
Click OK
Install Emgu.CV, Emgu.CV.Bitmap, Emgu.CV.UI and Emgu.CV.runtime.windows
These Emgu packages should now appear under your references and you should not see a package.config file.
Nuget Options Image
I encountered the same error. I don't know why we're getting it, but I was able to find a workaround.
Visit the nuget page for the package.
Click "Download Package" to download the nuget package directly.
Open the downloaded file using your archive utility of choice and navigate to the "\runtimes\win-x64\native" folder.
Copy both dll files into the output directory of your project.
After doing this, my code executed without error. Make sure to install emgu.CV.Bitmap as well.
I changed my projects Target Framework to ".NET Framework 4.6" and then went to "Manage NuGet Packages", selected "Browse", typed in "emgu.cv.runtime" then installed version 4.5.1.4349 and it worked.
Here is how I solved it,
1- downgrade .Net framework to 4.6 from project properties
2- Uninstall Emgu.CV and related ones (you will see which ones needed to be uninstalled in Errors List)
3- Install Emgu.CV.runtime.windows from Solution Nuget Manager ( it should install fine now)
3- upgrade .Net framework to 4.8
4- install Emgu.CV 4.5.1 (latest)
5- install Emgu.CV.UI 4.5.1 (Emgu.CV.Bitmwp was installed automatically for me)
and that's it, now you can use bitmap.ToImage<Bgr,Byte>(), note that the Image<Bgr,byte>(bitmap) doesn't work anymore.
I am trying to install System.Runtime.Handles so I can use SafeAccessTokenHandle and RunImpersonated, however when I try to install the package I get the error :
Could not install package 'System.Runtime.Handles 4.3.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I have done some research and I do not believe there is a .NETFramework, Version=v4.3.0. Does anybody have an idea on how to install this package?
I have done some research and I do not believe there is a .NETFramework, Version=v4.3.0. Does anybody have an idea on how to install this package?
First, you have to make sure the version of NuGet Package Manager for Visual Studio 2013 is the latest version 2.12.0.817, not the default version 2.8. You can check it from Tools->Extensions and Updates->Installed.
That because this nuget package require the NuGet 2.12 or higher.
Second, you should make sure you have installed the .net 4.6 and above. You should not change the framework version by unloading the project, opening the project file, changing the target framework, and then reloading the file. In this way, Visual Studio can not help to check if you have install that target framework. You should change it by right on the project select Properties->Application->Target framework:
If you do not have target framework .net 46, you can click the Install other frameworks to install it. For this question, you can just change your target framework to 4.7.1 directly.
Hope this helps.
I have an ASP NET MVC 4 project that "works on my machine(old)". When I load a project in a fresh installation of VS 2015(on a new laptop) - a lot of assemblies are missing and when I try to build the project it complains that classes like ActionResult, Controller are missing.
I checked that on the old laptop the missing dependencies are coming from C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies. On the new laptop I have only the xml descriptors of the packages but not the dlls.
What I have to install to use MVC 4 in Visual Studio 2015?
Edit: missing dependencies are:
System.Web.Helpers
System.Web.Mvc
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
I Recommend getting them again from Nuget for your ActionResult Issue its Microsoft.AspNet.Mvc which is making issue.
Open Package Manager Console and insert the command below:
Install-Package Microsoft.AspNet.Mvc
Nuget has this feature that allows you to restore all the missing Assemblies which exists in nuget. you can try that out as well.
Anyway for the rest of them install these packages below as well:
Install-Package Microsoft.AspNet.WebHelpers
Install-Package Microsoft.AspNet.WebPages
Install-Package Microsoft.AspNet.Razor
Check if you have install update 3 for VS2015
also check if Microsoft web developer tools are installed correctly
I have had the same issues when using source control or moving projects from one PC to another.
There is a work around that I use quite often and it works.
Go to YourProjectFolder -> packages.
Remove all the folders except for the xml, repositories.xml, file which is the xml config file for packages downloaded from Nuget.
On your solution in Visual Studio Right click and select Enable Nuget Packages Restore.
Then build the application it will re-download all the required packages.
Hope this helps
For Me what solved the issue is to install ASP.NET MVC 4 for Visual Studio 2010 from Microsoft Web Page
I am writing xamarin app which will work on windows and OS X (using profile 7)
I am trying to add the nuget system.xml.xpath
However, it gives me the below error-
Adding System.Xml.XPath...
The 'System.Xml.XPath 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.7.0'.
I have two question-
1.
how soon will xamarin start supporting nugget client 3.0 or above?
2.
how can i resolve my specific problem?
On OS-X you can:
sudo nuget update -self
Note: sudo is required as this will update the nuget.exe within the Mono Framework
>nuget
NuGet Version: 3.4.4.1321
There is a nuget3 branch of Xamarin Studio 6.1 but I have not seen when that will go into an public alpha release...
You do not say what development environment you are using. The error message suggest you are using Xamarin Studio, since Visual Studio already supports NuGet 3.
There is a preview branch of Xamarin Studio 6.1 which does support NuGet 3, this is currently available on the alpha channel in Xamarin Studio.
However whilst using Xamarin Studio 6.1 will allow you to do is add the System.Xml.XPath NuGet package to your project you will still not be able to use anything from that NuGet package currently since there are no assemblies in it for the Xamarin frameworks and currently the Xamarin build tools will not add the correct assembly references for you at compile time.
I have reinstalled my windows and I had an old project in Visual Studio MVC 5.
Now when I try to open it I get the following error:
enter image description here
You are missing a .NET project package which's name is CodeAnalysis.Csharp.
Try to install it through NuGet console package manager. Write the following command:
Install-Package Microsoft.CodeAnalysis.CSharp
If you already have that package, but older one, you might wanna do this:
Update-Package Microsoft.CodeAnalysis.CSharp
How to arrive to the console package manager?
On visual studio click:
Tools>NuGet Package Manager>Package Manager Console.
Hope it helps.