I tried to download the latest version of this nuget:
JSON Web Token Handler For the Microsoft .Net Framework 4.5 3.0.1
but its not installing correctly in my project.
In my Visual Studio solution, I looked in the folder:
\packages\System.IdentityModel.Tokens.Jwt.3.0.1\
and the DLLs exist, but they are not within the lib folder. They are in the package's root.
When I try to install it in my VS project, it says its been installed, but no project references are added.
I think its broken. Can anyone confirm that a nuget must have a lib folder and the DLLs must be within the lib folder.
Yes, I duplicated the folder structure of the previous package (version 3.0.0) and got it working. I left two messages with the author a week ago.
We just pushed a new version out, 3.0.2, that fixes this issue. Please try to update the NuGet and let me know if the issue is resolved.
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 have published a package in Nuget few years ago. From time to time, I was updating it with new versions and all was ok until now.
Few days ago I've published an update to Nuget and when I've updated my package, it was installed successfully but it never added any references to my project.
I've even started from blank console applications and tried to add my package. Same problem.
You can try. This is a package
https://www.nuget.org/packages/63BITS-Libraries/
This is how I built my package
Any ideas?
If you download your nuget package, and unzip it (yep its just a zip file). You will find that your DLL is not in the lib directory.
Typically, inside a nuget package, any dlls need to be in lib/<FrameworkVersion>
For example if your DLL targeted netstandard1.6 then in the nuget package the path to your dll would be lib/netstandard1.6/SixtyThreeBits.Libraries.dll
In your package, your dll is in SixtyThreeBitsLibraries/SixtyThreeBits.Libraries.dll
On the same code branch we are successfully building on one machine, but on another we get this:
Error Multiple assemblies with equivalent identity have been imported: '...\src\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Xml.ReaderWriter.dll'. Remove one of the duplicate references.
How can we resolve?
I ultimately solved this by updating Visual Studio to the latest
Using MSBuild 15 solves the problem.
MSBuild 15 is part of the .NET Core SDK or can be downloaded using the Build Tools for Visual Studio 2017.
I suspect that you have both a directly referenced (via the GAC or file system via Browse...) dll and a Nuget package in your project.
Best to try uninstalling the Nuget package, and then check your references and uncheck any remaining references to System.Xml.ReaderWriter.dll, and then install your Nuget reference again.
UPDATE
For reference, a similar error was encountered with System.Threading when an EntityFramework package was renamed. Perhaps one of your packages has a newer version or has a renamed namespace? Or maybe you have incompatible versions of .NET Standard?
Solved the "Error Multiple assemblies" problem by uninstalling Xamarin from computer and Visual Studio 15.
Followed this instruction:
https://developer.xamarin.com/guides/cross-platform/getting_started/visual_studio_with_xamarin/troubleshooting/uninstall-xamarinvs/
My problem occured when updating asp.net nuget packages from version 1.0.0 to 1.1.0.
See https://github.com/dotnet/corefx/issues/14050
This explains that in v4.3.0 of the nuget package it requires using VS 2015 Build tools Update 3 or later.
If you can't upgrade, downgrade the package to v4.0.11.
Made the following change to .csproj, which did the trick:
<PackageReference Include="System.Reflection.Emit">
<Version>4.3.0</Version>
<ExcludeAssets>All</ExcludeAssets>
<IncludeAssets>none</IncludeAssets>
</PackageReference>
In case someone comes looking for another answer. Can happen (6/6/2018) due to a package reinstall ambiguity between matching namespaces of NetStandard and .NET Framework.
Issue took root updating a NetStandard 3rd party package and it required/installed a dependency of System.Net.NetworkInformation (v4.3.0 I believe.) Honestly worked fine before that package so I manually removed the dependency from CSPROJ and package.config that main solution added.
It's not clean but demonstrates a NuGet or MSBuild issue not recognizing they are in fact different assemblies and thus count as a duplicate reference.
Delete the dll in 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.2\Facades\System.Xml.ReaderWriter.dll'.
and build your code.
Add it back after build successfully.
I was able to resolve the issue by updating the NuGet package Microsoft.Net.Compilers to a newer version. It had been at 1.0.0, which I believe wasn't using the newer version of MSBuild (as pointed out in some of the other answers).
I am creating a NuGet package from one of my projects using -IncludeReferencedProjects.
When I check the nupkg afterwards with the NuGet Package Explorer I see all referenced libraries inside the lib folder.
After installing the package in another project one of the before mentioned projects is not referenced.
I don't get any error messages when installing or packaging. Does anyone have an idea, what might cause this or is there a way to debug it somehow?
The Nuget package is hosted in our Team Services repository.
I found the answer. The problem was that the assembly name was ending with .Resources for some reason .Net or Visual Studio or NuGet can't handle that.
I have a project that I have on TFS online. When Im trying to build the project, I get the following error:
Severity Code Description Project File Line
Error The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\Users\Bryan\Source\Workspaces\TestProject\ContosoUniversity\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'file:///C:\Users\Bryan\Source\Workspaces\TestProject\ContosoUniversity\packages\Microsoft.Net.Compilers.1.0.0\tools\Microsoft.Build.Tasks.CodeAnalysis.dll' or one of its dependencies. Could not find the file. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. ContosoUniversity
Has this something to do with that Azure don't support ASP.NET 4.6?
Here was the fix for me. Using Nuget Package Manager, remove these two packages if referenced:
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Microsoft.Net.Compilers
After that, run a rebuild. This ensured that the build was not trying to use a specific build exe. Click here for the Diff against previous revision
No, it is not related to Azure Web Apps doesn't support ASP.NET 4.6. Actually, you get this error message because NuGet packages are checked into version control.
So, you need to remove folder TestProject\ContosoUniversity\packages from TFS and build again. See: BuildTasks.Csc task could not be loaded from the assembly?
I had the same problem sometime ago, to fix it:
make sure your packages are not under source control
Force restore all package, by deleting the package folder
restart your visual studio
In my case it got resolved by updating the below two Nuget packages to the latest version:
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Microsoft.Net.Compilers
Delete the packages folder or its contents, clean, rebuild solves the problem for me.
If you take a look at the file in reference it points you to a packages location. It turns out that NuGet packages is broken
To Resolve: you simply need to delete that packages folder (usually under project name \ project name \ packages.), then on build, Nuget will restore all the required packages.
I needed to update all my Nuget packages on my development box, then check the project in to TFS again.
For added peace of mind, I deleted the packages folder in the Team City build folder.
In case someone looks at this later on.
I was getting this issue only when building in DevOps.
But after manually deleting packages in my local build I started getting the same issue locally.
After removing the apparently missing NuGets using the NuGet manager the issue resolved it's self both locally and on azure.
Not sure what caused it but might save someone a headache in the future.
I was using .net 4.7.2