• .net core源码调试前的配置


    一直想想研究.net core的源码,参照 solenovex大牛的方法,最后终于成功启动了.net core源码,过程如下:

    1、powershell定位到 X:aspnetcoreengscripts,运行其中的InstallVisualStudio.ps1,在弹出的VS修改安装界面后,直接点修改,安装完成后关闭即可。

    2、cmd定位到X:aspnetcore目录下,运行restore.cmd,此时会下载一个目录X:aspnetcore.dotnet,关闭cmd窗口停止restore进程,编辑目录下的dotnet-install.ps1文件,

    Say "Downloading link: $DownloadLink"
    try {
    DownloadFile -Source $DownloadLink -OutPath $ZipPath

    修改成

    Say "Downloading link: $DownloadLink,$ZipPath"
    try {
    while(![System.IO.File]::Exists($ZipPath)){
    Start-Sleep -s 5
    }
    Say "$ZipPath is has exists"
    # DownloadFile -Source $DownloadLink -OutPath $ZipPath

    作出上面修改的原因是,powershell可能是单线程下载或网络原因(你懂的),

    DownloadFile -Source $DownloadLink -OutPath $ZipPath 这句话是下载安装包 ,我们注释掉它,不让它下载,

    Say "Downloading link: $DownloadLink,$ZipPath" 中的$DownloadLink是远程下载地址,$ZipPath是临时文件路径,知道了这两个地址后用循环判断,如果文件不存在就休眠5秒,这时我们可以用多线程下载工具或浏览器下载远程地址的文件,下载完成后复制到临时目录改成$ZipPath的临时文件名,然后线程就会解压文件进行安装,这样就不用等很久才能下载安装包。

    3、restore有可能会有些文件没下载会,也可以在cmd下执行build.cmd命令,估计作用和restore.cmd是一样的。

    4、成功后还要修改D:aspnetcoresrcComponentsServersrcMicrosoft.AspNetCore.Components.Server.csproj  具体问题看 https://github.com/dotnet/aspnetcore/pull/18713/files/9142fbf5940c4c8cd8cc66f50fe63569f50747e0#diff-8d3e3b66d47490ce28ba798996aea5ec

    修改成如下内容,对照修改下面绿色粗体内容

    <Project Sdk="Microsoft.NET.Sdk">

      <PropertyGroup>
        <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
        <Description>Runtime server features for ASP.NET Core Components.</Description>
        <IsAspNetCoreApp>true</IsAspNetCoreApp>
        <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <NoWarn>CS0436;$(NoWarn)</NoWarn>
        <DefineConstants>$(DefineConstants);ENABLE_UNSAFE_MSGPACK;SPAN_BUILTIN;MESSAGEPACK_INTERNAL;COMPONENTS_SERVER</DefineConstants>
        <IsPackable>false</IsPackable>
      </PropertyGroup>

      <ItemGroup>
        <Reference Include="Microsoft.AspNetCore.Components.Authorization" />
        <Reference Include="Microsoft.AspNetCore.Components.Web" />
        <Reference Include="Microsoft.AspNetCore.DataProtection.Extensions" />
        <Reference Include="Microsoft.AspNetCore.SignalR" />
        <Reference Include="Microsoft.AspNetCore.StaticFiles" />
        <Reference Include="Microsoft.Extensions.Caching.Memory" />
        <Reference Include="Microsoft.Extensions.FileProviders.Composite" />
        <Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
        <Reference Include="Microsoft.Extensions.Logging" />
        <Reference Include="Microsoft.Extensions.ValueStopwatch.Sources" PrivateAssets="All" />

        <!-- Add a project dependency without reference output assemblies to enforce build order -->
        <!-- Applying workaround for https://github.com/microsoft/msbuild/issues/2661 and https://github.com/dotnet/sdk/issues/952 -->
        <ProjectReference
          Include="....Web.JSMicrosoft.AspNetCore.Components.Web.JS.npmproj"
          ReferenceOutputAssemblies="false"
          SkipGetTargetFrameworkProperties="true"
          UndefineProperties="TargetFramework"
          Private="false"
          Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />
      </ItemGroup>

      <PropertyGroup>
        <MessagePackRoot>$(RepoRoot)srcsubmodulesMessagePack-CSharpsrcMessagePack.UnityClientAssetsScriptsMessagePack</MessagePackRoot>
      </PropertyGroup>

      <ItemGroup>
        <Compile Include="$(ComponentsSharedSourceRoot)srcCacheHeaderSettings.cs" Link="SharedCacheHeaderSettings.cs" />
        <Compile Include="$(ComponentsSharedSourceRoot)srcArrayBuilder.cs" LinkBase="Circuits" />
        <Compile Include="$(ComponentsSharedSourceRoot)srcElementReferenceJsonConverter.cs" />

        <Compile Include="....SharedsrcBrowserNavigationManagerInterop.cs" />
        <Compile Include="....SharedsrcJsonSerializerOptionsProvider.cs" />
        <Compile Include="....SharedsrcWebEventData.cs" />

        <Compile Include="$(RepoRoot)srcSignalRcommonSharedBinaryMessageFormatter.cs" LinkBase="BlazorPack" />
        <Compile Include="$(RepoRoot)srcSignalRcommonSharedBinaryMessageParser.cs" LinkBase="BlazorPack" />
        <Compile Include="$(RepoRoot)srcSignalRcommonSharedMemoryBufferWriter.cs" LinkBase="BlazorPack" />

        <!-- MessagePack -->
        <Compile Include="$(MessagePackRoot)BufferWriter.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)ExtensionHeader.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)ExtensionResult.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)MessagePackCode.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)MessagePackReader.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)T4MessagePackReader.Integers.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)MessagePackSerializationException.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)MessagePackWriter.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)Nil.cs" LinkBase="BlazorPackMessagePack" />
        <!--<Compile Include="$(MessagePackRoot)FloatBits.cs" LinkBase="BlazorPackMessagePack" />-->
        <Compile Include="$(MessagePackRoot)InternalDateTimeConstants.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)StringEncoding.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)SequencePool.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)SequenceReader.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)SequenceReaderExtensions.cs" LinkBase="BlazorPackMessagePack" />
        <Compile Include="$(MessagePackRoot)Utilities.cs" LinkBase="BlazorPackMessagePack" />

        <!-- Shared descriptor infrastructure with MVC -->
        <Compile Include="$(RepoRoot)srcSharedComponentsServerComponent.cs" />
        <Compile Include="$(RepoRoot)srcSharedComponentsComponentParameter.cs" />
        <Compile Include="$(RepoRoot)srcSharedComponentsServerComponentSerializationSettings.cs" />
        <Compile Include="$(RepoRoot)srcSharedComponentsServerComponentMarker.cs" />
      </ItemGroup>

      <PropertyGroup>
        <BlazorServerJSFile>....Web.JSdist$(Configuration)lazor.server.js</BlazorServerJSFile>
      </PropertyGroup>

      <ItemGroup>
        <EmbeddedResource Include="$(BlazorServerJSFile)" LogicalName="_framework/%(Filename)%(Extension)" />
        <EmbeddedResource Include="$(BlazorServerJSFile).map" LogicalName="_framework/%(Filename)%(Extension)" Condition="Exists('$(BlazorServerJSFile).map')" />
      </ItemGroup>

    </Project>
     
    5、这时可以打开 其中的源码解决方案,比如 X:aspnetcoresrcMvc ,双击这个目录下的startvs.cmd ,会调用VS打开 MVC.sln并还原依赖的包,直接打开MVC.sln好像无法加载项目,我以后再试。
    6、如果正常打开项目,可以试着生成解决方案,如果生成成功,那么调试就没问题了。默认是test目录下的BasicWebSite项目为启动项目的,你也可以修改其它项目为启动项目。
    7、.net core源码调试成功,记下解决经历以备忘也可以帮助到其他的人。
  • 相关阅读:
    Qt QSS美化 基础知识
    Qt QSS教程 QComboBox
    Qt QSS教程 QSpinBox
    Qt QSS教程 QLineEdit
    Qt QSlider qss(round handle) 圆形滑块
    Qt QSS之QSlider滑动条美化
    Qt Creator中使用qss对界面美化没有作用(效果)的问题
    Qt Creator 设置Qss文件文本高亮
    tensorrt中builder.max_workspace_size的作用
    C++宏的一些较复杂的用法,反斜杠,do {}while(0)
  • 原文地址:https://www.cnblogs.com/billboy/p/12830334.html
Copyright © 2020-2023  润新知