May I get help resolving Package reference for .NET 4.7.2 Project? - .net-core-2.2

2/3 of projects in a solution I have is running on .NET 4.7.2, the other project is a reactJS project running on .NET Core. The other two run well except one of the .NET 4.7.2 projects which seem to be trying to call packages that are not compatible with the project. The file it keeps hanging up on is the System.Threading.Tasks.Extension. The current version it is stuck on running is 4.5.2, of which I cannot downgrade and seems to not be compatible with .NET 4.7.2. I noticed that from the build logs. Here one line from the output file which seems to stand out to me:
Unified Dependency "System.Collections, Version=4.0.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Using this version instead of original version "4.0.0.0" in "C:\project\packages\System.Threading.Tasks.Extensions.4.0.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll" because there is a more recent version of this framework file.
Resolved file path is "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\Facades\System.Collections.dll".
(ResolveAssemblyReferences target) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "System.Threading.Tasks.Extensions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
When the browser comes up this error is shown:
Could not load file or assembly 'System.Threading.Tasks.Extensions' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have been looking around at solutions which include meddling with the .csproj, web.config or package.config and not successful.
My goal is to have the project run successfully and resolve this conflict. Any help in resolving this issue would be greatly appreciated.

This was resolved by cleaning out all the packages and readding one by one.

Related

Build failure in Qt 5.8 project in VS2015 community edition

I got this error while building a Qt 5.8 project in Visual Studio 2015 community edition, and am unable to resolve this.
1>------ Rebuild All started: Project: analogclock, Configuration: Debug Win32 ------
1> Generate moc_predefs.h
1> Reading Qt configuration (D:\Qt\Qt5.8.0\5.8\msvc2015\bin\qmake.exe)
1>C:\Users\Dan\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error : The source file for this compilation can be found at:
"C:\Users\Dan\AppData\Local\Temp\25ee8a4c-842c-4329-96bc-cd757b4f3616.txt"
1>C:\Users\Dan\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB3758:
An error has occurred during compilation. warning CS1668: Invalid search path 'Lib\um\x86'
specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
1>C:\Users\Dan\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB3758:
An error has occurred during compilation. c:\Users\Dan\AppData\Local\Temp\qmousnkh.0.cs(88,26) : error CS1061:
'System.Collections.Generic.IEnumerable<string>' does not contain a definition for 'ToHashSet'
and no extension method 'ToHashSet' accepting a first argument of type 'System.Collections.Generic.IEnumerable<string>'
could be found (are you missing a using directive or an assembly reference?)
1>C:\Users\Dan\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4036:
The "GetVarsFromMakefile" task was not found. Check the following:
1.) The name of the task in the project file is the same as the name of the task class.
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks
files located in the "C:\Program Files\MSBuild\14.0\bin" directory.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I had the same error and I hope my solution can help you (despite of that almost one year passed from time when you asked:-)) or others having it. Shortly - try to update .Net Framework at least to version 4.7.2.
After some investigation I found that QT VS Tools use pieces of C# code in custom build scripts. One of them is GetVarsFromMakefile in file qt_vars.targets. I copied this code to new C# project, added missing variables and had the same error as during compiling of QT project: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToHashSet'... The problem was that this method was added to the mentioned class only at .Net 4.7.2 (https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1?view=netframework-4.7.2) and I had .Net 4.6. Probably during install of newer versions of Visual Studio newer .Net version is installed automatically, but I have VS 2015. After updating to latest .Net version (I tool 4.8) this issue has gone.

The "TypeScript.Tasks.FindConfigFiles" task could not be loaded from the assembly

After updating the VS 2015 Community edition to Update 2 my ASP.NET Web API project fails to build under different environments with weird TypeScript error.
The project is just a plain Web API with no client scripts or whatsoever.
Error details
The "TypeScript.Tasks.FindConfigFiles" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll' or one of its dependencies. The system cannot find the file specified. 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.
I have same problem, to resolve the problem I just uninstall older version of Typescript (installed with VS2013) and re-install newer version (with VS2015).

Getting error in visual studion whenver i publish

I formatted my system recently and installed windows 7. so i installed all software again. when after i installed VS it is working fine only. but when i am build / publish it is showing an error. how to resolve this issue?
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9):
Warning MSB3245: Could not resolve this reference. Could not locate
the assembly "System.Web.WebPages, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to
make sure the assembly exists on disk. If this reference is required
by your code, you may get compilation errors.
Is i have to install something ah? please instruct me?
Check if the "System.Web.WebPages" dll is available in the solution/project references. If not add it (the required version). clean solution, build again. Publish.
Hope this helps.

Visual Studio unable to read the project file (anymore)

Ever since my latest windows update, (which system restore is failing to undo) I can't load any projects with visual studio 2010. The project are greyed out (unavailable) and when I try to reload them I get the error:
C:\Users\Benoit\Documents\Visual Studio 2010\Projects\Test123\Test123\Test123.csproj : error : Unable to read the project file 'Test123.csproj'. Could not load file or assembly 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I tried creating new projects: same error
I tried creating different type of projects (command prompt, silverlight, windows phone): same error
Deleting the .suo and .user files did not change anything
I did not move the projects
Using Visual Studio 2010 with Windows Vista
It looks like the Global Assembly Cache (GAC) is messed up, or possibly the update has done something with the Microsoft.Build assembly file itself.
Try repairing .NET 4.0, and if that does not work you can try completely uninstalling and reinstalling the framework.

How do I build IronRuby on Visual C# 2008 Express Edition?

From the docs it should be possible. I built it on VS 2008 myself - so the source (Sep 8 Master) is okay.
I'm trying to build it now with VS Express Edition on this machine. Installed 4.0 Framework Beta 1. Open the Ruby.sln file ; the IDE won't open any of the .csproj files in the solution
Unable to read project file '<something>.csproj
Path to Framework\v4.0..\Microsoft.Common.Targets(2893,9): The attribute "Keep Duplicate Outputs" in element <Target> is unrecognized.
I tried to remove the offending attribute from the above file. The csproj files then load but result in build errors of the form
Error 54 The "Microsoft.Build.Tasks.Message" task could not be loaded from the assembly Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. IronRuby.Tests
You can't build 4.0 projects with 2008
For that you need 2010 beta1 (it's a free download)
Or you need to install .NET 3.5 on your machine and try again with 2008. That does work for me but I don't have an express edition.
Also I generally tend to build using Rake (i don't have to open a visual studio session for that).
to do that (build with rake) do the following
download the ruby 1.8 installer from ruby-lang.org
install ruby 1.8
gem install pathname2
make sure you have .NET 3.5 and the windows SDK (resgen.exe and csc.exe) must both exist on your system and their paths have to be added to the %PATH% variable.
set %MERLIN_ROOT% = C:\path\to\ironruby_clone\Merlin\Main
build a debug version
rake compile
build a release version
rake compile configuration=release
to include the ironpython binaries in your release build too.
rake compile:all configuration=release

Resources