当前位置:网站首页>. Net core stepping on the pit practice
. Net core stepping on the pit practice
2022-07-05 06:44:00 【Isaac Su】
.net core Step on the pit
0. Error message
To be exact, there are two pits , One about .net core Version of , Another one about compilation options . First post the error message .
0.1 Unable to open the project
The first mistake is not to start the project , I put it on VS2017, When opening an existing project , Report errors Project file is incomplete. Expected imports are missing
But this project is git In the database , All products use this . Why can't I open it locally ?
0.2 Project cannot be loaded
The same environment , Another project , There's a project, In the open sln after , This project The display is not loaded normally , stay error list Middle tip :
Error NU1105 Unable to find project information - The project file may be invalid or missing targets required for restore
And only this project cannot be loaded ,sln Others in the can .
0.3 System.BadImageFormatException
This problem is solved after the previous problem , Finally, I can open the compilation , But when it runs, it reports an error somewhere , This is this. System.BadImageFormatException
1 The first pit
1.1 VS edition
After consulting colleagues , He didn't find the reason , But he asked me that you didn't pretend vs2019 ah . I tried it on vs2019, And then I found out vs2019 Be able to open this project , Everything is all right , Use... Again vs2017 I can't open it .
1.2 .net core edition
Search for , Some people mentioned that .net core Why . Reviewed the instructions of the installation environment , It is required to follow .net core 2.1, I checked , Is, indeed, .net core 2.1 ah .
Later, I finally found a key place .
https://stackoverflow.com/questions/49432666/project-file-is-incomplete-expected-imports-are-missing
and
https://stackoverflow.com/questions/53329290/net-core-2-2-cant-be-selected-in-visual-studio-build-framework/55529011#55529011
Look at the instructions :
Issue details: 2.1.6xx & 2.2.2xx version of the sdks are only supported on Visual Studio 2019. VS 2017 needs 2.1.5xx & 2.2.1xx versions of the sdk.
Check my installed .net core edition 2.1.818, I want to see others .net core 2.1 Download interface 
above 2.1.818 Of visual studio support Is written 2019, Below 2.1.526 It's support vs2017 Of .
uninstall 2.1.818, install 2.1.526, VS2017 The project can be opened normally .
above 0.1 and 0.2 We've solved all our problems .
2. The second pit
2.1 x86
Compile successfully , debugging , However, an exception is thrown when running to a place where another library is called , This is this. System.BadImageFormatException, Search discovery , Usually because X86 and X64 Caused by the mixing of libraries . I know that other libraries use X86, I looked at the platform I chose when compiling , yes X86 ah 
2.2 Find clues
How did you find the problem later ? I am here attach to process When , There's a column of type It doesn't show all , I'll widen this column , It's all displayed , It says managed(V4.0.3xxx) X64.
What's going on? , What I chose was x86 ah ,
A light configure manager,
It's so deceptive ,active solution platform The choice is x86, But each project chose any cpu, So the last one is x64 Of .
Change to x86, recompile . success .
3 reflection
A little more , confirm .
边栏推荐
- Get class files and attributes by reflection
- ADG5412FBRUZ-RL7应用 双电源模拟开关和多路复用器IC
- 2022-5-第四周日报
- LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
- AE tutorial - path growth animation
- our solution
- 【高德地图POI踩坑】AMap.PlaceSearch无法使用
- Series of how MySQL works (VIII) 14 figures explain the atomicity of MySQL transactions and the principle of undo logging
- Page type
- Using handler in a new thread
猜你喜欢

1.手动创建Oracle数据库
![[Gaode map POI stepping pit] amap Placesearch cannot be used](/img/4c/55586ffcc2267c477a4532ab51a0c1.png)
[Gaode map POI stepping pit] amap Placesearch cannot be used

Instruction execution time

UTC, GPS time and Tai

Skywalking全部

Dameng database all

International Open Source firmware Foundation (osff) organization

7. Oracle table structure
![LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation](/img/1f/30407bce35c324cc90f139b6f09fd1.jpg)
LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation

Vscode configures the typera editor for MD
随机推荐
The problem of Chinese garbled code in the vscode output box can be solved once for life
Package webapp or H5 pages into apps
将webApp或者H5页面打包成App
1. Create Oracle database manually
Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter
vim
[QT] QT multithreading development qthread
如何正确在CSDN问答进行提问
Series of how MySQL works (VIII) 14 figures explain the atomicity of MySQL transactions and the principle of undo logging
2022/6/29-日报
All English in the code
求组合数 AcWing 887. 求组合数 III
Volcano 资源预留特性
[learning] database: several cases of index failure
Positive height system
FFmpeg build下载(包含old version)
Redis-01.初识Redis
[learning] database: MySQL query conditions have functions that lead to index failure. Establish functional indexes
博弈论 AcWing 892. 台阶-Nim游戏
SRE核心体系了解