Tag Archives: Windows

Solutions to problems such as failed to load the hostfxr.dll of. Net core SDK after Windows system installation

The reason is that the problem of “failed to load the hostfxr. DLL” broke out after installing the. Net core SDK on a windows2008r2 computer and then executing dotnet -- info on the command line. It has also been encountered before, but it has been solved, but no record has been made, which has caused another Google here! So write an article and record it. In addition, some 500.25 problems are also caused by this reason!

Author: Yi lezhu

Original address: https://www.cnblogs.com/yilezhu/p/10057789.html

The specific error information is as follows:

Failed to load the dll from [C:\Program

Files \ dotnet \ host \ FXR \ version number \ hostfxr. DLL], HResult: 0x80070057

The library hostfxr.dll was found, but loading it from C:\Program

Files \ dotnet \ host \ FXR \ version number \ hostfxr.dll failed

Installing .NET Core prerequisites might help resolve this problem.

http://go.microsoft.com/fwlink/?LinkID=798306&amp ; clcid=0x409

The solution is to install this patch kb2533623. It should be noted here that different system versions need to correspond to specific patches, which can be divided into 32-bit and 64 bit. You can visit this page for specific information, https://support.microsoft.com/en-us/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot

This article provides the corresponding updates of Windows 7 and Windows Server 2008 R2. Please download and install them. Then execute the dotnet -- info command to see the long lost interface:

It seems that this problem only occurs in Windows 7 and Windows Server 2008 R2.

Of course, there are other situations that cause the. Net core SDK to run abnormally! Sometimes you need to install the update kb2999226. Please fill it up next time! Because I didn’t record the last time I needed to install the update kb2999226!

PIP install troubleshooting under Windows [How to Solve]

Error:

Traceback (most recent call last): File"C:\Python27\Python27\Scripts\pip-script.py", line 9, in<module> load_entry_point('pip==1.4.1','console_scripts', 'pip')() File"C:\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\__init__
 .py", line 148, in main

return command.main(args[1:], options) File"C:\Python27\Python27\lib\site-packages\pip-1.4.1-py2.7.egg\pip\basecomm
 and.py", line 169, in main
 text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 inposition 34: ordinal
 not in range(128)

Reason:
the CMD environment of windows defaults to GBK encoding, and pip defaults to UTF-8 encoding
however, in Linux and MAC, the terminal environment defaults to UTF-8 encoding, so no error will be reported

Solution:

Create a file sitecustomize.py in Python directory Python 27\lib\site-packages

import sys sys.setdefaultencoding('gbk')

Python will run this file automatically

 

Mysql5.7 service startup error on Windows

After installation, start the service net start mysql, which cannot be started. The log reports an error. Some system tables, mysql.user and other tables are missing

Solution:

Execute under Bin: mysqld — initialize execute — user = MySQL

After execution, generate the directory C: \ program files \ MySQL \ MySQL server 5.7 \ data. Create a new root user without a password

mysqladmin  – u   root   password   123456, specify the root user password

 

 

ps:

Net start MySQL
net stop MySQL
mysqld — install, install services on windows, mysqld — remove remove remove services

Mysqld — console start printing log
mysqladmin – uroot shutdown stop service

 

Here is the most important thing to pay attention to. When installing MySQL service, you must switch to the bin directory of MySQL installation directory, no matter whether you configure environment variables or not, otherwise the above error will be reported when starting the service after installation

Error reported by jmap command under Windows

    Recently, I changed my laptop. In the new working environment, the jmap command is actually reporting errors, and JPS, jstat, Jinfo and jstack can be used normally. Therefore, the problem of process number is preliminarily eliminated

Attaching to core 17536 from executable heap, please wait...
Error attaching to core file: Windbg Error: OpenDumpFile failed!
sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: OpenDumpFile failed!
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Native Method)
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(WindbgDebuggerLocal.java:160)
        at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673)
        at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:569)
        at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:335)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:191)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.PMap.main(PMap.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)

At the same time, I tried jmap heap XXX a non-existent process number (a pit is buried here first), but still reported the same error. According to the information of the exception stack, it is suspected that the command line under Windows does not have administrator permissions and cannot access the dump file, so I tried to run CMD as an administrator, and then jmap heap, However, the same mistake is reported:

I’m helpless now. Baidu and stackoverflow haven’t found a solution to the problem after walking around… Let’s go first

gorgeous separation line

I don’t know how long later, I suddenly remembered — “didn’t you hit the right command?” jmap – H take a look at the red box in the screenshot, and then lower your head in shame (it must be caused by eating too many mid autumn moon cakes, huh!)

as shown in the figure, jmap has three uses: 1. Connect the running process; 2. Analyze the core file, that is, dump file; 3. Connect the JVM processes of other machines. Therefore, the problem with the jmap heap XXX command above is that you forget to add “-” and jmap is regarded as analyzing the snapshot file of “heap”, and it is natural to report an error

Summary:

    In JDK’s own toolkit, for commands such as JPS, jmap, jstack, etc., specifying option generally requires “-” and the following parameters do not contain bars, which should be kept in mind. And make complaints about the exception. Don’t panic. You must read the abnormal information and abnormal stack carefully. In this case, the first line has already been clear. (if you put the filename out, you can print it out better)

[Solved] Windows Django Error: A server error occurred. Please contact the administrator.

This is because the get function is used in the view function to get data that does not exist
For example, there is no data in the database with the name hello1, use the following statement to access
message = Message.objects.get(name='hello1')

will report an error message = Message.objects.get(name='boddy1')

Solution.
 See the following figure:

Click the link in the box above to automatically enter line 323 of the debug.py file, and modify line 321 as shown in the figure below:

Run again:

In this case, the error message is normal, the query data does not exist

This problem does not exist in MAC and Linux, where the encoding has been set to utf8 by default.

In vmware10, centos7 mounts the shared folder of windows host, and prompts: error: cannot mount filesystem: no such device

1. Set sharing permissions

Write picture description here

2. Install VMware tools

Write picture description here

  • Click on the virtual machine
  • Click to install VMware tools
  • Copy VMwareTools-9.6.2-1688356.tar.gz in the /run/media/zhaojq/VMware\ Tools directory to the home directory
  • Generate vmware-tools-distrib after decompression
  1. [zhaojq @localhost vmware-tools-distrib] $ ls
  2. bin doc etc FILES INSTALL installer lib vmware-install.pl

Run ./vmware-install.pl

[zhaojq@localhost vmware-tools-distrib]$ ./vmware-install.pl 

Keep enter

  1. The path “” is not valid path to the gcc binary.
  2. Would you like to change it? [yes] no
  3. Enter no
  4. At The path “” IS not A! Valid path to at The 3.10 .0 – 514.26 .2.el7.x86_64 Kernel
  5. headers.
  6. Would you like to change it? [yes] no
  7. Enter no

Return after successful installation

  1. Enjoy ,
  2. – – at The VMware Team

2. Mount the shared folder of the Windows host

mnt/hgfs directory

  1. [zhaojq @localhost ~] cd /mnt/hgfs/
  2. [zhaojq @localhost hgfs] pwd
  3. /mnt/hgfs

vmware-hgfsclient command to view the current shared directory

  1. [zhaojq @localhost hgfs] $ vmware-hgfsclient
  2. E

mount error

  1. [zhaojq @localhost hgfs] $ sudo mount -t vmhgfs. host:/ E /mnt/hgfs
  2. Error : cannot mount filesystem: No such device

 

vmhgfs-fuse, need to install toolkit

  1. [zhaojq @localhost hgfs] $ yum install open-vm-tools-devel -y
  2. [zhaojq @localhost hgfs] $ vmhgfs-fuse. host:/ E /mnt/hgfs

 

3. View the mount

Note: Root privileges are required to view.

Disk E of the Windows host

Write picture description here

Mount situation under Centos virtual machine

  1. [root@localhost hgfs] # ls
  2. jashkenas-coffeescript- 1.12 . 6- 0-gf0e9837 .tar .gz LeaRun agile background development framework_6 . 3 .4 $RECYCLE .BIN System Volume Information
  3. LeaRun_6 . 3 .4 .zip node-v6 . 11 .1-linux-x64 .tar .xz redis- 3.2 . 9 .tar .gz

 

Mounted successfully

The Java – jar *. Jar prompt in CMD is unable to access jarfile *. Jar or windows can’t double-click to run jar file. What should I do

Front end developers must read! Starting from scratch, teach you to build a low code website platform in stages>>>

1. Switch to the directory of the target file, and then run Java – jar

2. After confirming the installation of Java virtual machine, double-click the jar file to be run or right-click the jar file, and select “open mode” → “select default program” in the pop-up menu

3. In the “open mode” setting window, click the check box before the option “always use the selected program to open this file”, and then click the “Browse” button next to it

4. Select the installation folder of Java virtual machine. If Java 7 is installed, the installation folder is generally “C:: program files?Java?Jre7?Bin” (please find the specific folder yourself). Find the javaw.exe file and click the “open” button

5、

At this time, it has been set to use the javaw.exe application to open the jar file, but in fact, there is no response when double clicking the jar file. This is because the open file parameter is not set

Enter “regedit” in the search box of the windows start menu, right-click the file regedit found above, and select “run as administrator” in the pop-up menu

6. In the registry editor, find “HKEY”_ CLASSES_ In the file open command, add the parameter “- jar” (without quotation marks), and the modified value is similar to: “C: program files, Java: jre7, Bin: javaw. Exe” – jar% 1 “(only need to add – jar parameter, no need to modify other information). Save and exit the registry editor

Solution to the error of cscope – Q option in Windows

In the past, some netizens left a message. When using cscope under windows, the following prompt appeared when using the – Q option:

D:\Temp> cscope -Rbkq
Input file specified two times.

cscope: cannot create inverted index; ignoring -q option
cscope: removed files ncscope.in.out and ncscope.po.out

At that time, easby thought that cscope of Windows version did not support – Q option

However, netizen Liang Feng left a message yesterday

Windows版本的cscope是支持-q选项的,出现以上错误是因为没找到合适的sort命令。所以只要cscope进程的工作目录下有GNU版本的sort就可以了。注意是进程的工作目录,不是可执行程序的目录。具体原因看一下cscope的代码片段。

build.c

#ifdef WIN32
snprintf(sortcommand, sizeof(sortcommand), “set LC_ALL=C && sort -T %s %s”, tmpdir, temp1);
#else
snprintf(sortcommand, sizeof(sortcommand), “env LC_ALL=C sort -T %s %s”, tmpdir, temp1);
#endif

So we did the experiment again. After cygwin is installed, cscope is used in the shell interface of cygwin, and the above error prompt does not appear. However, if you open the command line window of windows, cmd.exe, and execute cscope in it, the above error will appear

After carefully comparing the environment of cygwin with that of cmd.exe, it turns out that sort.exe, which comes with windows, is the ghost

In the shell window of cygwin, the setting of path environment variable will make it find the GNU version of sort.exe first, so the above cscope command can be executed successfully. But in the cmd.exe window, the path environment variable will make it find the sort.exe that comes with windows first instead of GNU sort.exe, so the above error prompt will appear

Knowing the cause of the problem, the solution is very simple. We can write a batch program, reset the path environment variable in this program, and make cscope use GNU version of sort.exe. The sample procedure is as follows:

D:\Temp> type cs.bat
@echo off
set path=c:\cygwin\bin;
cscope -Rbkq

In this batch process, first point the path environment variable to C:// cygwin/bin;, My cscope.exe and GNU version of sort.exe are in this directory. Next, execute the cscope command. Now it uses the GNU version of sort. Exe

Windows: SSH-add Error connecting to agent: No such file or directory [Solved]

Use ssh-add under Windows to report Error connecting to agent: No such file or directory

<a name=”mqFEu”></a>

Environmental information

  • Operating system: windows 10
  • Terminal: Windows PowerShell <a name=”pXQ8f”></a>

<a name=”EGV6M”></a>

problem

Error when using ssh-add

PS D:\code> ssh-add -l
Error connecting to agent: No such file or directory

<a name=”kxXYH”></a>

Processing steps

  • Check whether the ssh-agent service started successfully
PS D:\code> get-service ssh*

Status   Name               DisplayName
------   ----               -----------
Stopped  ssh-agent          OpenSSH Authentication Agent
  • Found that the ssh-agent service status is stopped, start the service
PS D:\code> Set-Service -Name ssh-agent -StartupType Manual
PS D:\code> Start-Service ssh-agent
  • Execute the ssh-add command to check whether it is successful
PS D:\code> ssh-add -l
2048 SHA256:Dw8iD5trSzInnsmmDpaXBusdfL2K3wM3b+GMulKNHbAU C:\Users\Administrator\.ssh\xxx-pc (RSA)
2048 SHA256:Mb4qKSueS8bqNALm3423eD98KdTIuEwnLvfVWTNPCusg C:\Users\Administrator\.ssh\yyy (RSA)
2048 SHA256:nyLi89QHTYFMr97sM0cG9I6sBfA82GpR9Os2WF0HlwA C:\Users\Administrator\.ssh\id_rsa (RSA)
  • problem solved

NPM install error reporting in Windows: solution to operation not permitted, rename

What are the eight life cycle hook functions of Vue>>>

Run the NPM install command to install the dependency package. It’s OK on the virtual machine installed by vagrant on MAC, and it’s OK on alicloud CentOS. However, it’s not successful on the same virtual machine installed by vagrant on windows. The error is as follows:

npm ERR! Error: EPERM: operation not permitted, rename ‘/usr/share/nginx/html/tanteng.me/node_modules/duplexify' -> ‘/usr/share/nginx/html/tanteng.me/node_modules/.duplexify.DELETE'

Solution: the solution is NPM install – no bin links, plus the following parameters