Thursday, December 23, 2021

If you did not select routing option on the project make time so how can add.

 This solution to experience and fresher "If you did not select routing option on the project make time so how can add. "

The solution are as below :- Run below command.


ng generate module app-routing --flat --module=app


Thank you ! 



Wednesday, October 27, 2021

npm WARN npm npm does not support Node.js v14.15.4

 First you need to open your command line, and use " npm install -g npm@latest  or npm install " you'll get the error like this

C:\Users\yourname>npm install -g npm@latest
npm WARN npm npm does not support Node.js v14.7.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR! 
C:\Users\BOMWALMIKIA\AppData\Roaming\npm-cache\_logs\2020-08 10T09_36_56_388Z-debug.log

Solution 

  • Go to the path where you can find the debug log (this file is found in your npm-cache folder) C:\Users\yourname\AppData\Roaming
  • Delete the NPM and NPM-Cache folder, but DO NOT reinstall node. Once deleted go back to your command line and re-use the command " npm install -g npm@latest "



Tuesday, September 21, 2021

How to: Chrome: allow localhost site even without https certificate

 So as we all are learning, chrome is blocking entirely https sites, even those from localhosts. Sometimes you a presented with a warning screen. Sometimes you are presented with a connect to network screen despite being fully connected to the internet.

For those of us with application specific programs that do not require a certificate, maybe a self hosted test website or whatever you need. Chrome does allow you to override the warning about https certificates if the address is localhost.


1 Steps total

Step 1: Open Google Chrome

Enter the below into the address bar in google chrome.

chrome://flags/#allow-insecure-localhost

Set the option to enabled on allow-insecure-localhost.


Now you can able to access the localhost 

Monday, September 13, 2021

ASP.Net WCF: The service cannot be activated because it does not support ASP.NET compatibility

 The following error is thrown by the ASP.Net WCF Service when the aspNetCompatibilityEnabled attribute is set to true in Web.Config file.

The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the Web.Config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.


The Solution
The above error occurs because in order to make the WCF Service work in ASP.Net compatibility mode, you also need to decorate the WCF Service class with the AspNetCompatibilityRequirements attribute.
Below are the correct steps to make the WCF Service work in ASP.Net compatibility mode,
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

If some case the above solution is not work go with below solution 
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>

Thank you Hope it is help you



Tuesday, August 17, 2021

How do I clone a branch in Git?

 If you want to clone you code from DevOps using the ,cmd so steps are as below :-


Step 1:- Go to your branch and copy the clone Path(HTTPS or SSH).Use 

Step 2:- Go CMD and open your path where you want to clone your code.

Ste 3 :- Use this command git clone  <Step 1 Path>.

The full commands are as below 


 


Thank you Hope it is help you.

Friday, August 13, 2021

How to Downgrade/Upgrade angular version.

 If you want to Downgrade/Upgrade you angular version then you have follow the below steps.


Step 1:- npm uninstall -g @angular/cli

Step 2:- npm cache clean --force

Step 3:- Specify which version you want to install

npm install -g @angular/cli@x.x.x(For search list of version pls click here)


This will get the latest cli version: npm install -g @angular/cli



Thank you!


Node Sass version 6.0.1 is incompatible with ^4.0.0. angular

 When you getting error  "Node Sass version 6.0.1 is incompatible with ^4.0.0. angular" .The solution are as below:-

Step 1:- npm uninstall node-sass 

Step 2:- npm install node-sass@4.14.1

I thing it will help you.


Thank you 



Wednesday, June 23, 2021

Port 4200 is already in use. Use '--port' to specify a different port.

 if you are getting Port 4200 is already in use. Use '--port' to specify a different port the use below command.


ng serve --open --port 4201.

Thank you.

ERROR in node_modules/@types/googlemaps/reference/info-window.d.ts(73,71): error TS2304: Cannot find name 'unknown'.

 When you have issue in googlemaps in angular the solution are as below :-


run the command npm i @types/googlemaps@3.38.0



Thank you !

node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected error after installation of Angular 6

 If you I got an error node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected solution is as below 


You need to do some changes in package.json.

Go to package.json and modify "rxjs": "^6.0.0" to "rxjs": "6.0.0"Then run npm update in your project.




Thank you ,


Tuesday, June 8, 2021

How to get multiple value from dropdown in angular ?

 Hello Friends 

 In this artical  i will share you "How to get  multiple value from dropdown"  Hope it will help you.

The sample code are as below:-

 <div class="col-12 mt-4">
   <label>Account Name:</label>
      <select [(ngModel)]="dlAccountname" id="dlAccountname" name="dlAccountname"
                        class="form-control full-width">
             <option value="" selected="selected">Please Select Account Name</option>                      
               <option *ngFor="let item of AccountList;" [ngValue]="item" > 
                   {{ item.Canvas_Name }}
                            
                        </option>
                    </select>
                </div>

Wednesday, March 31, 2021

SQL server: can't save/change table design

If  you need to change settings to save the changes from design then you have follow below steps.

  1. Open SQL Server Management Studio (SSMS).
  2. On the Tools menu, click Options.
  3. In the navigation pane of the Options window, click Designers.
  4. Select or clear the Prevent saving changes that require the table re-creation check box, and then click OK.


Uncheck the prevent saving changes that require table re-creation.


!Thank you!




Wednesday, March 10, 2021

Back quote

 Alternatively known as acute, backtick, left quote, or an open quote, the back quote or backquote is a punctuation mark (`). It's on the same U.S. computer keyboard key as the tilde.

 

Where is the back quote key on the keyboard?

Below is an overview of a computer keyboard with the back quote key highlighted in blue.

How to create the ` symbol

Creating the ` symbol on a U.S. keyboard

To create a back quote using a U.S. keyboard, press the `, which is located directly below the Esc key. This key is also used for typing the tilde ( ~ ) character if the Shift key is held while it is pressed.

Creating the ` symbol on a smartphone or tablet

To create a back quote on a smartphone or tablet locate the single quote in the numbers (123) or symbols (sym) section, and tap and hold the ' symbol. As you continue to hold down on the ' symbol, a menu containing the back quote appears. Drag your finger up to the back quote and let go to insert the symbol.

 

Thank you.
 

 

 

Keyboard special characters

 

Keyboard special characters

Below is a list of special characters available on the typical U.S. keyboard, with links to their related pages.


Key/symbolExplanation
~                    
Tilde.
` Acute, back quote, grave, grave accent, left quote, open quote, or a push.
! Exclamation mark, exclamation point, or bang.
@ Ampersat, arobase, asperand, at, or at symbol.
# Octothorpe, number, pound, sharp, or hash.
$ Dollar sign or generic currency.
% Percent.
^ Caret or circumflex.
& Ampersand, epershand, or and symbol.
* Asterisk, mathematical multiplication symbol, and sometimes referred to as star.
( Open or left parenthesis.
) Close or right parenthesis.
- Hyphen, minus, or dash.
_ Underscore.
+ Plus.
= Equal.
{ Open brace, squiggly brackets, or curly bracket.
} Close brace, squiggly brackets, or curly bracket.
[ Open bracket.
] Closed bracket.
| Pipe, or, or vertical bar.
\ Backslash or reverse solidus.
/ Forward slash, solidus, virgule, whack, and mathematical division symbol.
: Colon.
; Semicolon.
" Quote, quotation mark, or inverted commas.
' Apostrophe or single quote.
< Less than or angle brackets.
> Greater than or angle brackets.
, Comma.
. Period, dot or full stop.
? Question mark.      

 

 

Tilde.

 Alternatively referred to as the squiggly or twiddle, the tilde is a character ( ~ ) on keyboards below the Esc (escape key). It is on the same key as the back quote that resembles a squiggly line. The graphic gives a representation of how the tilde character may appear when typed.

 

Where is the tilde key on the keyboard?

Below is an overview of a computer keyboard with the tilde key highlighted in blue.

 


 

How to create the ~ symbol

Creating the ~ symbol on a U.S. keyboard

To create the tilde symbol using a U.S. keyboard hold down Shift and press ~. This symbol is on the same key as back quote ( ` ), in the top-left portion of the keyboard under Esc.

Creating the ~ symbol on a smartphone or tablet

To create a tilde on a smartphone or tablet's on-screen keyboard, tap the numbers button (123), then the symbols button (#+=). Then, tap the tilde (~) button.

 

Thank you.

 

Tuesday, March 9, 2021

Shortcut Key for Table Details in Sql Server Management Studio

 

Shortcut Key for Table Details in Sql Server Management Studio


If you select a table name in the query window of Sql Server Management Studio
and press ALT + F1 it will display the details of that table.

In the background shortcut key will execute sp_help on your behalf, so in this example it executes: sp_help users, which is much quicker than typing it.

I'm running Sql Server Management Studio 2018.



Thank you Hope it is help you.


Wednesday, February 24, 2021

How to fix error “ANCM In-Process Handler Load Failure”?

If you are getting this error:


This issue in .Net core 2.2. so one solution is for it checks the Dotnet-hosting version if you are you are using less than the 2.2.8 upgrade it into 2.2.8 version then the issue will be solved.
Hope it helps you.Thank you 




Wednesday, February 3, 2021

How can I call an async method in Main?

That kind if issue are facing beginner and those developer are not familiar with async and await used.
So in this post i have explain you how to call async method.

 
namespace PracticeHemaware
{
class Program
{
private static string result = "123";

static void Main(string[] args)
{
var data= Task.Run(async () => await saytest());
// saytest(result).Wait();
Console.WriteLine(data.Result);

Console.Read();
}
static async Task<string> saytest()
{
await Task.Delay(5);
result = "Hello World";
return result;
}
}
}
this is my code and saytest() is my async method.

Thank you.

Tuesday, February 2, 2021

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync

 Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync 

Error:
Full error is as below, while generating reports in Developer VM.

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation) at

Reason:
Azure emulator service is not running due to port conflict with another windows service.
 
How to find what is running on what port?

using any of the below commands in cmd will give you list of the ports used by services.

netstat -bano

netstat -a

In my case, those ports were in use by windows application, which i can not stop or change port.

How to solve error?

To resolve this error open CMD with Administrative privileges

Navigate to location: "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\"

Execute command AzureStorageEmulator.exe start.

In my case service was not started due to same ports were being used by another application.

I have changed port number for Azure Emulator to run on different port and started service.

Below is Picturization for the same.


 

 

 

 

 

 

 

Thank you .

Upload Image To Azure China Blob Storage In ASP.NET MVC

 Upload Image To Azure China Blob Storage In ASP.NET MVC Code.
 1st step:-Use below code in web.config file.

<appSettings>
    <add key="StorageAccountName" value="YOURAZURECHINAACCOUNTNAME" />
    <add key="StorageAccountKey" value="YOURAZURECHINAACCOUNTKEY" />
  </appSettings>

The below is controller code

I am using service here the code are as below:-

using Microsoft.Azure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web;

namespace BlobStorageDemo
{
    public class ImageService
    {
        public async Task<string> UploadImageAsync(HttpPostedFileBase imageToUpload)
        {
            string account = CloudConfigurationManager.GetSetting("StorageAccountName");
            string key = CloudConfigurationManager.GetSetting("StorageAccountKey");
            string imageFullPath = null;
            if (imageToUpload == null || imageToUpload.ContentLength==0)
            {
                return null;
            }
            try
            {
                StorageCredentials credn = new StorageCredentials(account, key);
                CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(credn, new Uri("https://deice2staging.blob.core.chinacloudapi.cn "),
           new Uri(" https://deice2staging.blob.core.chinacloudapi.cn/ "),
           new Uri("https://deice2staging.blob.core.chinacloudapi.cn/ "), null);
                //CloudStorageAccount cloudStorageAccount = ConnectionString.GetConnectionString();
                CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
                CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference("blobstor1");

                if(await cloudBlobContainer.CreateIfNotExistsAsync())
                {
                    await cloudBlobContainer.SetPermissionsAsync(
                        new BlobContainerPermissions {
                            PublicAccess = BlobContainerPublicAccessType.Blob
                        }
                        );
                }
                string imageName = Guid.NewGuid().ToString() + "-" + Path.GetExtension(imageToUpload.FileName);

                CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(imageName);
                cloudBlockBlob.Properties.ContentType = imageToUpload.ContentType;
                await cloudBlockBlob.UploadFromStreamAsync(imageToUpload.InputStream);

               imageFullPath = cloudBlockBlob.Uri.ToString();
            }
            catch (Exception ex)
            {

            }
            return imageFullPath;
        }
    }
}

and my UI code are as below :-


@{
    ViewBag.Title = "Upload";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Upload Image</h2>
<br />

@using (Html.BeginForm("Upload", "Image", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <fieldset class="form-horizontal">
        <div class="form-group">
            <label class="control-label col-md-2" for="Photo">Photo</label>
            <div class="col-md-10">
                <input type="file" name="photo" />
            </div>
        </div>
        <div class="form-group">
            &nbsp;
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Submit" class="btn" />
            </div>

        </div>
    </fieldset>
   
}


Thank you .

Hope it is help you