我想在Linux上使用.Net Core并具有最新版本:
> sudo pacman -Qs dotnet
local/dotnet-host 2.1.0-1
A generic driver for the .NET Core Command Line Interface
local/dotnet-runtime 2.1.0-1
The .NET Core runtime
local/dotnet-sdk 2.1.300-1
The .NET Core SDK
> dotnet --version
2.1.300
Run Code Online (Sandbox Code Playgroud)
但是,当我想运行示例应用程序(仅剃刀模板)时:
> dotnet run
Using launch settings from /home/user/src/WebRepTrack/Properties/launchSettings.json...
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found.
- Check application dependencies and target a framework version installed at:
/opt/dotnet/
- Installing .NET Core prerequisites …Run Code Online (Sandbox Code Playgroud) 在阅读了几篇关于The Heap和Stack(Rust-lang)的文章后,我了解到非原始类型/数据结构通常位于堆上,在堆栈中留下指针,指向特定对象所在的地址在堆.
堆值由堆栈上的变量引用,该变量包含堆上对象的内存地址.[Rust Essentials,Ivo Balbaert]
考虑以下示例:
struct Point {
x: u32,
y: u32,
}
fn main() {
let point = Point { x: 8, y: 16 };
// Is this address the value of the pointer at the stack, which points to
// the point-struct allocated in the heap, or is the printed address the
// heap-object's one?
println!("The struct is located at the address {:p}", &point);
}
Run Code Online (Sandbox Code Playgroud)
就我而言,输出是:
结构位于地址0x24fc58
那么,0x24fc58是堆栈引用指向的值(地址),还是在堆中分配struct-instance的直接内存地址?
一些额外的小问题: