Skip to content

Conversation

lindexi
Copy link
Member

@lindexi lindexi commented Jan 6, 2022

Summary

Fix code format and fix the API usage.

Fix code format and fix the API usage.
@dotnet-bot dotnet-bot added this to the January 2022 milestone Jan 6, 2022
@IEvangelist
Copy link
Member

Hi @lindexi - thank you for fixing this. There is a build error, could you please also add a new .csproj for this?

Check failure on line 1 in samples/snippets/csharp/VS_Snippets_CLR/Asynchronous_File_IO_async/cs/example.cs

GitHub Actions
/ snippets-build

samples/snippets/csharp/VS_Snippets_CLR/Asynchronous_File_IO_async/cs/example.cs#L1

😵 Project missing. A project (and optionally a solution file) must be in this directory or one of the parent directories to validate and build this code

@lindexi
Copy link
Member Author

lindexi commented Jan 7, 2022

@IEvangelist Sorry, I can not compile the project after I added the csproj file. Because we define the same MainWindow class in example.cs and example3.cs and example4.cs

Should I rename the MainWindow to MainWindow3 or MainWindow4 in example3.cs and example4.cs ?

<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Youssef1313 Because we define the same MainWindow class in example.cs and example3.cs and example4.cs

Copy link
Member

Choose a reason for hiding this comment

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

The problem with EnableDefaultCompileItems being false is that it beats the purpose of the csproj, which is to make sure the code compiles properly. If the examples are completely independent, I'd make a folder for each of them, each with its own csproj. @IEvangelist Do you agree?

Copy link
Member

Choose a reason for hiding this comment

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

Actually example3 and example4 doesn't seem to be referenced. So they can just be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

@IEvangelist Can I delete the example3.cs and example4.cs file and create the MainWindow2.xaml file?

Copy link
Member

Choose a reason for hiding this comment

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

You'd have to verify that those two files are in fact not being referenced, if you can prove that then yes.

@IEvangelist IEvangelist merged commit d43f86b into dotnet:main Jan 11, 2022
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.

4 participants