Xamrain Forms Maps not working as expected - xamarin.forms

I am trying to use the Xamrin forms map inteface to add custom pins acording to the doumenation here on microsoft but I am having an error it said that it should add the google play services automatically but it does not so I am trying to use the nuget.
Microsoft documentaiton
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/map
Nuget for google play sevices
https://www.nuget.org/packages/Xamarin.GooglePlayServices.Maps/
But I also get the following error.
GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Xamarin.GooglePlayServices.Maps'&semVerLevel=2.0.0
Install-Package : Failed to retrieve information about 'Xamarin.GooglePlayServices.Maps' from remote source
'https://nuget.telerik.com/nuget/FindPackagesById()?id='Xamarin.GooglePlayServices.Maps'&semVerLevel=2.0.0'.
An error occurred while sending the request.
Unable to connect to the remote server
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
At line:1 char:1
+ Install-Package Xamarin.GooglePlayServices.Maps -Version 71.1610.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Strange thing is this i have it set to nuget.org

Related

EF exception after upgrade to Visual Studio 2017

I have this asp.net core project (targeting standard framework) which I used to work on with VS 2015. I'd recently migrated the project to VS2017 and everything was going just fine until I needed a change in the db and as I ran the add-migration command I got this exception:
Exception calling "SetData" with "2" argument(s):
+ $domain.SetData('project', $project)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SerializationException
I've seen people making all sort of suggestions here on SO like running VS as admin or upgrading EF libraries. those solutions did not work for me.
Also there's only one project in the solution so the default project in package manager console can't be wrong.

Error while installing Microsoft.AspNet.WebApi.OwinSelfHost from NuGet

I'm trying to get this: http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api running.
Therefore I need to put this into NuGet package manager console
Install-Package Microsoft.AspNet.WebApi.OwinSelfHost
I got the following Error
Install-Package : Das angegebene Argument liegt außerhalb des gültigen Wertebereichs. (in english: The given argument is out of the valid value range.)
parametername: supportedFrameworks
at line:1 position:16
+ Install-Package <<<< Microsoft.AspNet.WebApi.OwinSelfHost
+ CategoryInfo : NotSpecified: (:) [Install-Package], ArgumentOutOfRangeException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
You can find this package's dependencies on https://www.nuget.org/packages/Microsoft.AspNet.WebApi.OwinSelfHost/5.2.3 .
I continued to locate where the error comes from and found that the Newtonsoft Json package could be the problem. But since there are no dependencies or subpackages given, I cannot go any further which let me post my question here:
What to do, to solve this problem?
My project's target framework is .NET 4.5.1 and I use VS2013 with recent update and NuGet manager V2.8 (also the recent version for VS2013, I think).
Edit1: I found that e.g. my Microsoft.CSharp reference is to Microsoft.CSharp V4.0.0.0 ... for recent Json versions Microsoft.CSharp V4.0.1 or higher is needed. How do I update this? And why do I have to do this?

ASP.NET MVC Nuget Enabling-Migrations

I am learning about ASP.NET MVC5 with Entity Framework. For my learning I'm using Lynda Video tutorials and I am stuck at the Nuget Console where I have to run the following code:
Enable-Migrations -ContextType ApplicationDbContext
After i run it I got the folowin error:
Enable-Migrations -ContextType ApplicationDbContext Exception calling
"LoadFrom" with "1" argument(s): "Could not load file or assembly
'file:///C:...\Projects\Lynda MVC - Exercise Files\Ch3 -
continue\Start\packages\EntityFramework.6.1.1\tools\EntityFramework.PowerShell.Utility.dll'
or one of its dependencies. Operation is not supported. (Exception
from HRESULT: 0x80131515)" At C:...\Projects\Lynda MVC - Exercise Files\Ch3 -
continue\Start\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:780
char:5
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException You cannot call a method on a null-valued expression. At
C:...\Projects\Lynda
MVC - Exercise Files\Ch3 -
continue\Start\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:781
char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or
assembly 'file:///C:...\Projects\Lynda MVC - Exercise Files\Ch3
- continue\Start\packages\EntityFramework.6.1.1\tools\EntityFramework.PowerShell.dll'
or one of its dependencies. Operation is not supported. (Exception
from HRESULT: 0x80131515)" At C:...\Projects\Lynda MVC - Exercise Files\Ch3 -
continue\Start\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1:809
char:5
+ $domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException
If you can help me with any solution it will be a big help.
Use '-ContextTypeNameswitch instead, and specify yourDBContext` class. i.e,
Enable-Migrations -ContextTypeName Someproject.DepartmentDb
For more useful switches, refer THIS
I had the same problem. My project was stored in a network drive. There are many security policies applied to my PC. I moved my project to the local hard drive, and the problem was solved.
It seems like "EntityFramework.Powershell.utility.dll" is tring to use some powershell functionality, and the system is preventing to execute such calls, maybe because the dll that is calling powershell is not a local file.
In your case, make sure that you do not have any security policy or system configuration that would prevent your system to call to the problematical extension (EntityFramework.Powershell.utility.dll).

Enabling Code First Entity Framework VS Web Express 2012

I am trying to enable Code First in my Visual Studio Web Express 2012. From what I have read so far I have to use the Package Manager Console and the command Enable-Migrations. When I do this I get the following error.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///E:\Working\wingtoysdl\C#\packages\EntityFramework.5
.0.0\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At E:\Working\wingtoysdl\C#\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:398 char:62
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $toolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression.
At E:\Working\wingtoysdl\C#\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:399 char:50
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///E:\Working\wingtoysdl\C#\packages\EntityF
ramework.5.0.0\tools\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515
)"
At E:\Working\wingtoysdl\C#\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:431 char:31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
As you can see it is a very large error making it very hard to google and troubleshoot. Does anyone have any ideas on how I can fix this?
I've run into this issue twice now. Both times I've had to uninstall entity framework then re-install it for each project in the solution. One thing that took me a while to figure out the second time I did this is that I had to re-start Visual Studio (2012) after re-installing Entity Framework (or I continued to get the "Could not load file or assembly '[path]\packages\EntityFramework.5
.0.0\tools\EntityFramework.PowerShell.Utility.dll'" error).
To get to the Package Manager Console go to: Tools -> Library Package Manager -> Package Manager Console
In the Package Manager uninstall Entity Framework for each project (I selected each project from the Default Project dropdown at the top of the Package Manager Console):
Uninstall-Package EntityFramework -Force
Then install it for each project:
Install-Package EntityFramework
At this point attempting to run the Enable-Migrations command gave the error still, until I closed and restarted Visual Studio. Then it was successful, as was the Update-Database command (after setting AutomaticMigrationsEnabled to true in the Migrations.Configuration file).
Had the same issue on two different machines while using projects on a network drive. This answer fixed it for me.
This may be a late answer but this seems like it could be a permissions/access problem.
Make sure that your project is not being opened from a mapped drive or similar.
If you are on a corporate network and logged into a domain, it is very likely that your user profile does not actually sit on your local computer but rather on the server. This will cause the same problem.
Try copy the project to your local c: and try again.
My problem was caused by some projects in my solution not being updated to the same version as other projects. When I ensured all were on the same EF version, it began working.
So I had the same problem for a while, I was unpacking a working project and got the error as I tried to enable migrations. It was simply fixed by using 7-Zip instead of the default unzipper from windows 10
I was also encounter the same problem so I started to check the possible things could go wrong and I found 2 different versions of entity framework is get installed somehow.
To confirm I goto Tools> NuGet package manager solution > Manage NuGet packages > Consolidate.
Have a look below images.
In this picture you may clearly see the different version is installed
in this picture I am agree to update the Entity Framework from 6.2.0 to 6.4.4
I had the same issue and in my case it was network drive problem. When I copied my project in local drive it worked fine.

NuGet execution policy errors when installing MvcScaffolding package

I'm using Visual Web Developer Express 2010, Windows XP, and using ASP.NET MVC4 RC in a project. I have NuGet v2.0.30619.9119 installed.
I'm now trying to install the MvcScaffolding package via NuGet Package Manager Console. I get the following errors:
PM> Install-Package MvcScaffolding
Attempting to resolve dependency 'T4Scaffolding'.
Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 4.1.10715.0'.
Successfully installed 'T4Scaffolding 1.0.6'.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps
1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\T4Scaffolding.1.0.6\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Successfully installed 'MvcScaffolding 1.0.7'.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.
ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\MvcScaffolding.1.0.7\tools\init.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Successfully added 'EntityFramework 4.1.10715.0' to MyProject.Web.
Successfully added 'T4Scaffolding 1.0.6' to MyProject.Web.
File Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\T4Scaffolding.1.0.6\tools\inst
all.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\T4Scaffolding.1.0.6\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
'InstallationDummyFile.txt' already exists. Skipping...
Successfully added 'MvcScaffolding 1.0.7' to MyProject.Web.
File Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1 cannot be loaded. The file Y:\asp\packages\MvcScaffolding.1.0.7\tools\in
stall.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..
At line:1 char:2
+ & <<<< 'Y:\asp\packages\MvcScaffolding.1.0.7\tools\install.ps1' $__rootPath $__toolsPath $__package $__project
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Because the init scripts aren't being executed after the install, the MvcScaffolding package is not installed correctly and the scaffold command is not recognised.
I don't know what to do about these code signing issues. Here are the current security settings:
PM> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process RemoteSigned
CurrentUser Undefined
LocalMachine Unrestricted
Can I change the Process scope to be Unrestricted? If so, how? Running Set-ExecutionPolicy in the NuGet console does not work:
PM> Set-ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):Y
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will
retain its current effective execution policy of "RemoteSigned". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPol
icy."
At line:1 char:20
+ Set-ExecutionPolicy <<<< Unrestricted
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
+ FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
I've also tried doing all of this as an Administrator and that didn't help either.
Any advice or ideas would be much appreciated.
UPDATE
I can set the process execution policy in NuGet like this:
Set-ExecutionPolicy Unrestricted -Scope Process
But when I restart Visual Web Developer, the setting is forgotten and I still get an error as it keeps trying to execute the init.psl files
How can I change the execution policy permanently?
OK, I have MvcScaffolding installed correctly now.
I had to first bypass all security in NuGet:
Set-ExecutionPolicy Bypass -Scope Process
But when I restart Visual Web Developer I still get those same PowerShell errors todo with the NuGet running init.pls on startup.
I've worked out that it's because I was storing my project on a network drive. Apparently PowerShell won't execute scripts from the network drive by default.
I tried using CasPol to change the security settings, but couldn't get it to work. I gave up when I saw other people couldn't get VS to work with mapped drives as well:
CAS not working for VS2010 mapped drive
Anyway, I just have my project local now, and MvcScaffolding is installed and working.
You can set the policy for user scope and using a more secure policy like this:
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser
Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
Prompts you before running scripts from publishers that you have not yet classified as trusted or untrusted.
For exemple, installing a EntityFramework ask permission to run the script:
Executing script file 'c:\users\user\documents\visual studio 2015\Projects\zzz\packages\EntityFramework.6.1.3\tools\install.ps1'
Do you want to run software from this untrusted publisher?
File C:\users\user\documents\visual studio 2015\Projects\zzz\packages\EntityFramework.6.1.3\tools\install.ps1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):R

Resources