EF Core add-migration error - entity-framework

I am doing code-first migration. My command is
Add-migration -Name AddMyVariables
There are some error messages displayed as follows.
To undo this action, use Remove-Migration.
Add-migration : Exception calling "AddFromFile" with "1" argument(s): "User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))"
At line:1 char:1
+ Add-migration -Name AddMyVariables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Add-Migration], MethodInvocationException
FullyQualifiedErrorId : COMException,Add-Migration
What does the message mean?

The problem was found. The project file, *.csproj, was not checked out from code repository and non-writable. Once the file was checked out, the error message was gone.

Related

Powershell version 2 Configuration System Failed to Initialize

I am creating a script using PowerShell to make a http request to an endpoint. I know starting from PowerShell version 3, I can use Invoke-RestMethod or Invoke-WebRequest, but the script is required to be compatible with PowerShell version 2.
As I have googled and read many forums, the most common solution is to use the .Net class System.Net.WebRequest. I am executing the below lines:
$Uri = "https://url"
$Web = [System.Net.WebRequest]::Create($Uri)
And I am facing below error:
Create : Exception calling "Create" with "1" argument(s): "Configuration system failed to initialize"
At line:1 char:32
+ [System.Net.WebRequest]::Create <<<< ($Uri)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Can you please help what might caused this problem?

I tried to download a image file using power shell and i got the following error

PS C:\> $p = New-Object System.Net.WebClient
PSC:\>$p.DownloadFile("https://upload.wikimedia.org/wikipedia/en/e/ec/Soccer_ball.svg","C:Users\Tamil\Downloads\Soccer_ball.svg.jpg")
Exception calling "DownloadFile" with "2" argument(s): "An
exception occurred during a WebClient request."
At line:1 char:1
+ $p.DownloadFile("https://upload.wikimedia.org/wikipedia/en/e/ec/Socce
...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
As Ash already mentioned in comment that local path is not valid and you need to provide the same extension as the image to download. So that you can download the image properly and able to view it.
I was able to download the image using:
$p.DownloadFile("https://upload.wikimedia.org/wikipedia/en/e/ec/Soccer_ball.svg","C:\test.svg")

I have a problem with "Create an Azure AD App" Specifically with the powershell Script "Create-AADIdentityApp.ps1"

I have installed Azure stack development kit and i am trying to install the App service.
Then when i have to run the PS1 script Create-AADIdentityApp.ps1 i fill in the following parameters
DirectoryTenantName
AdminArmEndpoint
TenantArmEndpoint
CertificateFilePath
Then i get the following error
New-Object : Exception calling ".ctor" with "3" argument(s): "The system cannot find the file specified.
"
At C:\app-service-certificate-install\Create-AADIdentityApp.ps1:81 char:24
+ ... rtificate = New-Object System.Security.Cryptography.X509Certificates. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
does anyone have any experience?
You provided a invalid CertificateFilePath.
It should be Full path to the identity application certificate file generated earlier.
Please check and correct it.

How do I get cause of Aggregte Exception in Service Fabric?

I am getting an Aggregate exception when deploying a guest application into my local cluster
Unfortunately the error message is useless
2>Test-ServiceFabricApplicationPackage : One or more errors occurred.
2>At C:\Program Files\Microsoft SDKs\Service
2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-UpgradedServiceFabricApplication.ps1:135 char:38
2>+ ... nSuccess = (Test-ServiceFabricApplicationPackage $AppPkgPathToUse -Im ...
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : NotSpecified: (:) [Test-ServiceFabricApplicationPackage], AggregateException
2> + FullyQualifiedErrorId : TestApplicationPackageErrorId,Microsoft.ServiceFabric.Powershell.TestApplicationPackage
How do I get more information to see the exact cause of this?
I am deploying using Visual Studios publish
Paul

PowerShell "A generic error occurred in GDI+."

Hi Guys, I'm trying to modify this PowerShell script and put it in windows startup. So every restart a VBScript will call this PowerShell script and it will update the info like a Windows Sysinternals BGinfo.
https://pastebin.com/nDh2L9dm
# Close Graphics
$image.Dispose();
# Save and close Bitmap
$background.Save($out, [system.drawing.imaging.imageformat]::Png);
$background.Dispose();
$bmp.Dispose();
# Output file
Get-Item -Path $out
This is the error I get in PowerShell ISE
Exception calling "Save" with "2" argument(s): "A generic error occurred in GDI+."
At D:\Desktop\PS-BGInfo-My-Version.ps1:195 char:5
+ $background.Save($out, [system.drawing.imaging.imageformat]::Png) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ExternalException