How to update .NETStandard in VS 2017? - visual-studio-2017

When installing TweetSharp I get this error message:
Install-Package : Package TweetSharp 2.3.1 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package TweetSharp 2.3.1 supports:
- net20 (.NETFramework,Version=v2.0)
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
- sl4 (Silverlight,Version=v4.0)
- sl4-wp (Silverlight,Version=v4.0,Profile=WindowsPhone)
- sl4-wp71 (Silverlight,Version=v4.0,Profile=WindowsPhone71)
I have tried updating .NETStandard to the most recent release being 2.0 but that doesn't work.
I have also tried using the command 'nuget.exe locals -clear all' that also doesn't work.
How can I update netstandard1.4 to one supported by TweetSharp?
Thank you.

Related

Cake Addins install fail error during build

I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies compatible with .NETFramework,Version=v4.6.1.
Error: Failed to install addin 'Cake.Npm'.
When I use cake.npm version as 0.17.0 for cake 0.38.2, it generates two folders - cake.npm and cake.npm0.17.0. Only cake npm0.17.0 is required, because it has netstandard2.0 which can make build successful. But the other folder makes it fail
As discussed in https://github.com/cake-contrib/Cake.Npm/issues/140 Cake.Npm is not the culprit, here.
There is an additional (#load) reference in the project to Cake.Sitecore in version 1.0.3 which in contents/scripts/tasks.restore.cake contains the line
#addin "Cake.Npm"
This - without an explicit version being set - will always default to the newest version (currently 2.0.0, which is incompatible with Cake 0.38.2).
The current version of Cake.Sitecore (1.0.27) has that problem fixed.

Point Cloud Library - Cannot find pcl_visualizer in Windows 10

I installed PCL 1.11.1 (head) on Windows 10 using vcpkg, but it seems it doesn't include the visualizer, even when I install PCL with VTK and OpenGL support.
I get this error:
fatal error C1083: Cannot open include file: 'pcl/visualization/pcl_visualizer.h': No such file or directory
And there are no file named pcl_visualizer.h in my disk.
Any ideas how to solve the problem without installing PCL from source?
Here is the list of libraries installed by vcpkg:
boost 1.74.0
boost-vcpkg-helpers:x86-windows 7#2
brotli:x86-windows 1.0.9
bzip2:x86-windows 1.0.8#1
curl:x86-windows 7.73.0#4
curl[non-http]:x86-windows
curl[schannel]:x86-windows
curl[ssl]:x86-windows
curl[sspi]:x86-windows
curl[winssl]:x86-windows
double-conversion:x86-windows 3.1.5
egl-registry:x86-windows 2020-02-20
eigen3:x86-windows 3.3.7#8
expat:x86-windows 2020-08-18
flann:x86-windows 2019-04-07-1
freeglut:x86-windows 3.2.1-4
freetype:x86-windows 2.10.2#5
freetype[bzip2]:x86-windows
freetype[png]:x86-windows
glew:x86-windows 2.1.0#9
harfbuzz:x86-windows 2.7.2#1
hdf5:x86-windows 1.12.0
hdf5[szip]:x86-windows
hdf5[zlib]:x86-windows
icu:x86-windows 67.1#6
jsoncpp:x86-windows 1.9.4
libharu:x86-windows 2017-08-15-9
libharu[notiffsymbols]:x86-windows
libiconv:x86-windows 1.16#6
libjpeg-turbo:x86-windows 2.0.5#1
liblzma:x86-windows 5.2.5#2
libogg:x86-windows 1.3.4#3
libpng:x86-windows 1.6.37#13
libtheora:x86-windows 1.2.0alpha1-2
libxml2:x86-windows 2.9.10#2
lz4:x86-windows 1.9.2-2
netcdf-c:x86-windows 4.7.4#1
opengl:x86-windows 0.0#8
openssl:x86-windows 1.1.1h#3
pcl:x86-windows 1.11.1#1
pcl[opengl]:x86-windows
pcl[vtk]:x86-windows
pegtl-2:x86-windows 2.8.3
proj4:x86-windows 7.2.0
proj4[database]:x86-windows
proj4[tiff]:x86-windows
pugixml:x86-windows 1.11.1
qhull:x86-windows 8.0.2
ragel:x86-windows 6.10-3
sqlite3:x86-windows 3.33.0
sqlite3[tool]:x86-windows
szip:x86-windows 2.1.1-6
tiff:x86-windows 4.1.0
utfcpp:x86-windows 3.1.2#1
vtk:x86-windows 9.0.1#2
xxhash:x86-windows 0.8.0#1
zlib:x86-windows 1.2.11#9
zstd:x86-windows 1.4.5#1
PCL Visualization does not currently support VTK 9.0
see discussions in https://github.com/microsoft/vcpkg/issues/11462 https://github.com/microsoft/vcpkg/issues/11601 https://github.com/microsoft/vcpkg/issues/15130

Yesod Quick Start Fails at Stack Build

I attempted to do the yesod quick start guide last night and on step 4 running stack build yields the errror
Error parsing targets: The specified targets matched no packages.
Perhaps you need to run 'stack init'?
running stack init yields a big large error as well
Is there any resolution for this?
Edit: Adding error from the stack init command
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- ./
Selecting the best among 15 snapshots...
* Partially matches lts-13.21
aeson version 1.4.2.0 found
- edb-yesod requires >=0.6 && <1.4
classy-prelude version 1.5.0 found
- edb-yesod requires ==1.4.*
classy-prelude-conduit version 1.5.0 found
- edb-yesod requires ==1.4.*
classy-prelude-yesod version 1.5.0 found
- edb-yesod requires ==1.4.*
persistent version 2.9.2 found
- edb-yesod requires ==2.8.*
persistent-sqlite version 2.9.3 found
- edb-yesod requires ==2.8.*
yaml version 0.11.0.0 found
- edb-yesod requires ==0.8.*
Using package flags:
- edb-yesod: dev = False, library-only = False
Downloaded nightly-2019-05-18 build plan.
Unable to load cabal files for snapshot
----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----
Unable to parse cabal file for co-log-0.3.0.0#sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508
- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.
Edit 2
Adding output from stack new yesod-sqlite template
ยป stack new my-project-du yesod-sqlite
Downloading template "yesod-sqlite" to create project "my-project-du" in my-project-du/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- my-project-du/
Selecting the best among 15 snapshots...
* Partially matches lts-13.21
aeson version 1.4.2.0 found
- my-project-du requires >=0.6 && <1.4
classy-prelude version 1.5.0 found
- my-project-du requires ==1.4.*
classy-prelude-conduit version 1.5.0 found
- my-project-du requires ==1.4.*
classy-prelude-yesod version 1.5.0 found
- my-project-du requires ==1.4.*
persistent version 2.9.2 found
- my-project-du requires ==2.8.*
persistent-sqlite version 2.9.3 found
- my-project-du requires ==2.8.*
yaml version 0.11.0.0 found
- my-project-du requires ==0.8.*
Using package flags:
- my-project-du: dev = False, library-only = False
Unable to load cabal files for snapshot
----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----
Unable to parse cabal file for co-log-0.3.0.0#sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508
- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.
Looks like something similar to the stack init command. For details on my system I'm running ubuntu mate 18.04 64-bit.

Team Build Nuget restore failure with .NET Core 2.0 + .Net Standard 2.0

I have a VS2017 solution that contains a .NET Core 2.0 console project that references a .NET Standard 2.0 class library, as well as a number of other NuGet packages. The solution builds fine on my development machine.
When I try to run NuGet restore on the TFS build server with NuGet 4.0.0 or 4.1.0, I get the following error:
Package (mypackagename) 1.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package (mypackagename) 1.0.0 supports:
- net35 (.NETFramework,Version=v3.5)
- netstandard2.0 (.NETStandard,Version=v2.0)
This error message is similar to that described in Nuget restore fails for ASP.NET Core 2.0 project on build server so I tried the solution suggested there, which is to use NuGet 4.3.0 or later. I've tried all released versions from 4.3.0 to 4.6.2, and this time I get the following error from NuGet restore:
2018-04-17T15:45:15.2611952Z Value cannot be null.
2018-04-17T15:45:15.2611952Z Parameter name: key
2018-04-17T15:45:15.2611952Z System.ArgumentNullException: Value cannot be null.
2018-04-17T15:45:15.2611952Z Parameter name: key
2018-04-17T15:45:15.2611952Z at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2018-04-17T15:45:15.2611952Z at NuGet.Commands.RestoreCommandProvidersCache.GetOrCreate(String globalPackagesPath, IReadOnlyList`1 fallbackPackagesPaths, IReadOnlyList`1 sources, SourceCacheContext cacheContext, ILogger log)
2018-04-17T15:45:15.2611952Z at NuGet.Commands.DependencyGraphSpecRequestProvider.Create(String projectNameToRestore, ExternalProjectReference project, HashSet`1 projectReferenceClosure, RestoreArgs restoreArgs, DependencyGraphSpec projectDgSpec)
2018-04-17T15:45:15.2611952Z at NuGet.Commands.DependencyGraphSpecRequestProvider.GetRequestsFromItems(RestoreArgs restoreContext, DependencyGraphSpec dgFile)
2018-04-17T15:45:15.2611952Z at NuGet.Commands.DependencyGraphSpecRequestProvider.CreateRequests(RestoreArgs restoreContext)
2018-04-17T15:45:15.2611952Z at NuGet.Commands.RestoreRunner.<CreatePreLoadedRequests>d__11.MoveNext()
2018-04-17T15:45:15.2611952Z --- End of stack trace from previous location where exception was thrown ---
Any suggestions as to how I can get this working?
I fixed this by setting "Clean = True" in the "Get Sources" task of my Team Build.
After doing this, I could use a recent version of NuGet (4.6.2), which no longer throws the ArgumentNullException above.
I suspect a bug in NuGet, where it gets confused by files left around from a previous build.

Could not load file or assembly System.Reflection.TypeExtensions

I got below exception while running xunit test projects which works under VS 2017 15.3
[2017/12/4 23:08:40 Error] [xUnit.net 00:00:00.0033291] xxx.Test: Catastrophic failure: System.TypeInitializationException: The type initializer for 'Xunit.DiaSession' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Xunit.DiaSession..cctor()
--- End of inner exception stack trace ---
at Xunit.DiaSession..ctor(String assemblyFileName)
at Xunit.DiaSessionWrapper..ctor(String assemblyFilename)
at Xunit.XunitFrontController..ctor(AppDomainSupport appDomainSupport, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink)
at Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo)
My current VS 2017 version is 15.4.5.
I have tried the work around which has been provided previously, but none did not work. And I have try to downgrade my VS 2016 to 15.3, but I could not find the 15.3 package to install. I have tried to install xunit to latest version.
Any help would be appreciated.
Update:
Project Type:xUnit Test Project(.NET Core)
Target: net 461
It seems VS 2017 fail to load specific "xunit.runner.visualstudio", after checking VS2017 15.4.2 - Unable to run tests for projects targeting .NET Framework 4.6.x #1542 again, I deleted the "%TEMP%\VisualStudioTestExplorerExtensions", create a new Xunit project, change the nonworked.csproj xunit.runner.visualstudio from 2.2.0 to 2.3.1, it works now. Not sure why it did not work when I try it previous.
Hope it will help others.
You need to install System.Reflection.TypeExtensions using VS Package Manager using the following command:
Install-Package System.Reflection.TypeExtensions -Version 4.5.1
for more information please review the following link
System.Reflection.TypeExtensions