从网上找到一个vs2015的项目,升级到vs2019编译,报错说找不到mscore.lib,在系统里找了一圈,发现确实没有这个文件。上网一搜,几乎都没哪个能清楚说明这个文件到底在哪里。
正确答案:
在.NET framework 的SDK里面,如下图所示,是在.NET Framework 4.6.1 SDK中,不是那个.NET Framework 4.6目标包。实际 上,应该是任何一个framework的SDK包都可以。我试了一下,安装完后立刻就可以编译了。
如果不想安装SDK,就下载这个到项目里直接编译就好了,如下
https://download.csdn.net/download/tanmx219/12745012
下面是网上给出的一个参考,这里还设置了环境变量(一般不需要,SDK会自己设置这些参数)
[vc141] LNK1104: cannot open file 'MSCOREE.libhttps://developercommunity.visualstudio.com/content/problem/1087638/vc141-lnk1104-cannot-open-file-mscoreelib.html
SummaryCannot build C++/CLI project. Linker returns
LINK : fatal error LNK1104: cannot open file 'MSCOREE.lib'Investigation
MSCOREE.lib on my laptop is located in “C:Program Files (x86)Windows KitsNETFXSDK4.8Libumx64” folder.
In the “Configuration Properties -> VC++ Directories” the value of “Library Directories” is
$(VC_LibraryPath_x64) $(WindowsSDK_LibraryPath_x64) $(NETFXKitsDir)Libumx64
Which is after parameters are applied equals to
C:Program Files (x86)Microsoft Visual Studio2019ProfessionalVCToolsMSVC14.16.27023libx64 C:Program Files (x86)Microsoft Visual Studio2019ProfessionalVCToolsMSVC14.16.27023atlmfclibx64 C:Program Files (x86)Microsoft Visual Studio2019ProfessionalVCAuxiliaryVSlibx64 C:Program Files (x86)Windows Kits10lib10.0.16299.0ucrtx64 C:Program Files (x86)Windows Kits10lib10.0.16299.0umx64 libumx64 Libumx64
See last two lines at bottom. Those are values of $(NETFXKitsDir)Libumx64.
So, for some reason for the toolset “vc141” the value of NETFXKitsDir is not defined. If I create NETFXKitsDir environment variable equal to C:Program Files (x86)Windows KitsNETFXSDK4.8, then I can build the project.
Environment:- Visual Studio 2019
- Toolset: vc141
- Project’s Target Framework Version: 4.7.2
- NET Framework 4-4.6 development tools
- NET Framework 4.6.1 development tools
- NET Framework 4.8 development tools
- C++/CLI support for v142 build tools
- C++/CLI support for v141 build tools
- MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)



