Skip to content

Conversation

@perlun
Copy link
Contributor

@perlun perlun commented Sep 6, 2020

The example was incomplete; System.Threading.Thread was being referenced without the namespace being properly imported.

@perlun perlun requested a review from a team as a code owner September 6, 2020 19:20
@dotnet-bot dotnet-bot added this to the September 2020 milestone Sep 6, 2020
@IEvangelist
Copy link
Member

IEvangelist commented Sep 8, 2020

Hi 👋 @perlun
Thank you so much for posting this issue. We really appreciate it. Could you please add a C# project to the unloading directory:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <StartupObject>test.Program</StartupObject>
  </PropertyGroup>

</Project>

We have a build validation that requires a project to compile from.

@IEvangelist IEvangelist self-assigned this Sep 8, 2020
@perlun
Copy link
Contributor Author

perlun commented Sep 9, 2020

@IEvangelist No probs, sounds good so we can avoid compilation issues in these examples going forward. I added a .csproj file, let's hope it passes CI runs this time.

@perlun
Copy link
Contributor Author

perlun commented Sep 9, 2020

This was bit of a can of worms actually, but I think I have most problems resolved now. After adding the .csproj file, some other compilation errors were discovered. Opening the project in JetBrains Rider didn't work so well, since I didn't have the .NET 5 preview installed. After installing it, things worked much smoother and I could fix most of these, but...

##[error]simple_example.cs(13,33): error CS0111: Type 'TestAssemblyLoadContext' already defines a member called 'Load' with the same parameter types [D:\a\docs\docs\samples\snippets\standard\assembly\unloading\unloading.csproj]
##[error]simple_example.cs(7,7): error CS0101: The namespace '<global namespace>' already contains a definition for 'TestAssemblyLoadContext' [D:\a\docs\docs\samples\snippets\standard\assembly\unloading\unloading.csproj]
##[error]Process completed with exit code 1.

...the TestAssemblyLoadContext name is being overloaded in two of these examples, which aint going to work. One of them would need to be renamed. Which one should I rename? Are there any references to the class names there (in the actual docs) that has to be fixed as well? (Update: I guess we could just put them in separate namespaces instead, that's how the other unloading examples are done.)

(Btw, https://dotnetcli.blob.core.windows.net is really slow where I am (400 KiB/s on a 100 Mbit connection), would be good to put this up behind a proper CDN like I presume the official downloads are. 😎)

@IEvangelist
Copy link
Member

Good to know, I'd be good with you adding a namespace for each of these.

The example was incomplete; `System.Threading.Thread` was being referenced without the namespace being properly imported.
@perlun
Copy link
Contributor Author

perlun commented Sep 9, 2020

@IEvangelist

Good to know, I'd be good with you adding a namespace for each of these.

You've got it, compiles fine locally now. 👍

Copy link
Member

@IEvangelist IEvangelist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, we'll :shipit: - thank you 🙏

@IEvangelist IEvangelist merged commit a4da3f1 into dotnet:master Sep 9, 2020
@perlun perlun deleted the patch-1 branch January 8, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants