#pnp/sp seems to be missing the .get() method - spfx

I am running into a strange (and hopefully very simple) issue where the .get() method does not seem to be defined in my spfx project.
This is a typescript 2.4.2 project for creating an spfx webpart for SharePoint 2016 on prem.
The project was started using yo #microsoft/sharepoint
There was a fix applied to update some typescript 2.2.2 references as per instructions here
The dependencies for PnP were loaded:
npm install #pnp/logging #pnp/common #pnp/odata #pnp/sp --save
Imports included
import { sp, Web } from '#pnp/sp';
Within a function of my render() method I am trying to make a very simple call as follows
let web = new Web(this.context.pageContext.site.absoluteUrl);
return web.lists.getByTitle(this.properties.listName).fields.filter("Title eq 'Decision Status'").get();
I am getting an error that says Property 'get' does not exist on type 'Fields'. To try and make it even simpler I tried running
let web = new Web(this.context.pageContext.site.absoluteUrl);
web.get();
And I get a similar error saying 'get' does not exist on type 'Web'. The examples they show in the documentation show very similar code, but I can't determine what about my code is incorrect here.

If this issue is still relevant,check the version of the #pnp/sp installed. The latest one as of today is 1.2.9 and should support get

I was dealing with this issue, my solution was install this others dependencies with the same version.
#pnp/common
#pnp/logging
#pnp/odata
#pnp/sp
hope that helps for anyone with this problem!

Related

Method not found: 'Void EntityFrameworkCore.Design.Internal.DbContextOperations

I am trying to scaffold and getting following error:
There was an error running the selected code generator Method not found: 'Void EntityFrameworkCore.Design.Internal.DbContextOperations
https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db?view=aspnetcore-2.0#install-entity-framework
I suspect you are missing the assemblies that are necessary for scaffolding? I also assume you are trying to reverse engineer an existing db?
example
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
if it fails like i can't find it might be a pmc issue, try closing down VS try again. After that its probably a configuration with missing assemblies.
It may be the Microsoft.EntityFrameworkCore.Design version issue. Update it to version 2.0.3. It worked for me.
I got this error too when trying to add a new controller. The day before I had upgraded both Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools Nuget Packages from version 2.0.2 to 2.1.3.
Downgrading both packages to 2.0.2 allowed me to scaffold a new controller again.
Saeef's error is from trying to create CRUD razor pages, not creating the domain classes from an existing database
I had the same problem. I had two instances of VS2017 (enterprise & developer edition) for some reason I updated only one of them. The shourtcut on my desk was the 'out of date version' so I didnt figure it out until now.
I uninstalled the older, updated the other to 15.8+ and it works fine now.

The "User7ZipPath" parameter is not supported

Recently, I have been getting this error a lot and from some research, I got to know that the cause for it is the Xamarin.Build package.
The error text is as follows:
The "User7ZipPath" parameter is not supported by the "XamarinDownloadArchives" task. Verify the parameter exists on the task, and it is a settable public instance property.
I have tried the solution here and here but nothing helped.
My configuration is as follows:
Xamarin version: 4.7.10.38
Visual Studio 2015
The Error occurs when I update the xamarin build NuGet package, If anyone has a solution to this problem please help me.
Thanks.
At last after all this time I was able to solve this problem.
The problem was with Xamarin.Build.Download package.
Now this package had a problem in version 4.7 where it is unable to find the XamarinDownloadArchives task.
I checked a lot of places and for the answer but nothing seemed to help with this issue after that I removed the bin, obj folders for all my projects.
And Updated my Xamarin.Build.Download package to version 0.4.11 and everything started working.
I hope this helps someone else, In case of any queries related to this issue feel free to comment.
Finally! I've come with a solution. The problem was in the Xamarin.Build.Download package, v0.4.0. It was a annidated dependency (in iOS) of Xamarin.Forms.GoogleMaps v2.2.1.
Updating Xamarin.Forms.GoogleMaps to v2.3.0 (the most recent version as of today) solves the issue. Make sure to clean the solution after update NuGet dependencies, though.

Xamarin Android Support V4 error

I started a new default working project in xamarin and I added the dll references for Xamarin.Android.Support.V4 and Xamarin.Android.Support.V7.AppCompat and I am getting errors.
Error: package android.support.v4.app.FragmentManager does not exist
android.support.v4.app.FragmentManager.OnBackStackChangedListener
Error: package android.support.v4.content.Loader does not exist
android.support.v4.content.Loader.OnLoadCompleteListener
...
What have I done wrong?
You needed to actually install the support library. MonoDroid has .NET bindings for it, but the underlying java can't build without it, of course. Here are instructions for getting the support library and instructions for hooking it up to a MonoDroid project.
See also http://developer.xamarin.com/Guides/Android/Platform_Features/Fragments/Part_4_-_Providing_Backwards_Compatibility_with_the_Android_Support_Package/#Adding_The_V4_Libraries_to_a_Mono_for_Android_Project
This might be related to this or this, which were solutions to common problems in the rev. 22 update.
try calling it with this:
using Android.Support.V4;
I was reading another post in the xamarin forms with the same issue and this worked for me. I spent maybe an hour trying to figure out what to do and the guy I ran into said just to:
clean the solution,
rebuild it,
then it should be fixed.
Assuming the packages are still installed

Class Library (Package) project with error when installing SpecFlow.NUnit

I have just created a Class Library (Package) project. I have never used this template before. When I install SpecFlow.NUnit, my References folder is displayed "References (Errors - see error list)". My SpecFlow.NUnit has that warning sign. Maybe I shouldn't use this type of project but I would like to understand why. Thanks.
Update: I've tried installing SpecFlow.xUnit in a second project too without success. I've installed them through Nuget.
Follow the instructions, should not be any problem. And use a Test project, that is the easiest way to get started.
Specflow documentation

MvcScaffolding doesn't work with EF4.1-Update

I recently installed the EF4.1-Update. When I made a new MVC3 Project and tried to add the MvcScaffolding using the PackageManagerConsole in VS2010 it wouldn't install it. Has anyone else
seen this? I removed the EF4.1-Update from my machine and MvcScaffolding installs correctly.
thanks,
Bill44077
You might have to clean out the packages folder in your solution and reinstall the MvcScaffolding. Once you do this everything should sync back up.
Good luck and hope this helps some.
It does work. And it works beautifully
But I had some issues getting it all setup.
What error(s) did you get exactly I had a number of issues, but solved them one by one.
Did you get this sort of thing in PMC when VS started up?
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2943) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
If so either update .net Refelector (now costs), or go Tools > Add-In Manager and disable the .NEt Reflector add in ! THEN RESTART VS
Or if you try to scaffold something, do you get e.g.
Invoke-Scaffolder : A parameter cannot be found that matches parameter name -ModelType"
?
Do you get errors when you try to add a controller to your MVC 3 project?
Are you running on Windows (pre 7) + without powershell 2.0 installed?
Basically don't worry it does work, I think the order or installations matters, just work through it bit by bit, its worth it.
Did you try reinstalling the update after the scaffolding is installed? I already had the scaffolding installed when I installed Update 1, so i did not see a problem.
I've had this problem before when the scaffolding.config file was either not present, or not filled with the Default Scaffolders -- make sure its populated with the default entries for views, controllers, etc. I think there is 9 by default in version 1.0.9.
Old post I know but this is still relevant in project templates and autogenerated projects -- the scaffolding.config needs to have its defaults.

Resources