Wednesday, October 21, 2020

Remove all packages from a specific project within a solution

 Be careful: This will uninstall ALL packages in the project. If -Force parameter is used, packages are removed even if dependencies exist.

Get-Package -ProjectName "YourProjectName" | 
Uninstall-Package -ProjectName "YourProjectName" -RemoveDependencies -Force

Remove all packages from all projects in the solution

 Be careful: This will uninstall ALL packages in the solution. If -Force parameter is used, packages are removed even if dependencies exist.

Get-Package | Uninstall-Package -RemoveDependencies -Force

Thursday, January 2, 2020

How to check the value of observable in console.log ?

With a regular observable you only get the value when it changes, so if you want to console.log out the value you will need to console.log it in the subscription:



  this.buyer12Org$ = this.GetOrg();
  this.buyer12Org$.subscribe((res=> console.log('buyer12'res));

Saturday, August 17, 2019

package-lock-json vs package-json

package-lock.json: records the exact version of each installed package which allows you to re-install them. Future installs will be able to build an identical dependency tree.
package.json: records the minimum version you app needs. If you update the versions of a particular package, the change is not going to be reflected here.

Thursday, August 15, 2019

Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?

class App extends React.Component {
render() {
return (
<Header />
<Content/>
);
}
}

This code throw error as follow :

./src/App.js
  Line 9:  Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?

   7 |     return (
   8 |     
> 9 | | ^ 10 | ); 11 | } 12 | }

to solve that error that you need to put your component tags into elclosing tags
like this
return (
    <div>
       <Comp1 />
       <Comp2 />
    </div>
)
or you can use the <React.Fragment>
return (
    <React.Fragment>
       <Comp1 />
       <Comp2 />
    </React.Fragment>
) 

https://reactjs.org/docs/fragments.html 






Error : verbose stack Error: ENOENT: no such file or directory, open 'Roaming\npm-cache\_npx\1768\package.json


When running npx (with any arguments, but -v is easiest to test) from the global install folder, the following error is produced.




The above error is due the white space contain in your username of PC. The command npx create-react-app doesn't work in this situation and shows error.

Solution : 


  1. run npm config edit to edit your config
  2. change cache path,e.g.
    from cache=D:\program file\npm-cache to cache=D:\progra~1\npm-cache



ASP.NET Core

 Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...