Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting started app #3079

Merged
merged 5 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions entity-framework/core/get-started/overview/first-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,7 @@ dotnet run

### [Visual Studio](#tab/visual-studio)

Visual Studio uses an inconsistent working directory when running .NET Core console apps. (see [dotnet/project-system#3619](https://github.com/dotnet/project-system/issues/3619)) This results in an exception being thrown: *no such table: Blogs*. To update the working directory:

* Right-click on the project and select **Edit Project File**
* Just below the *TargetFramework* property, add the following:

```xml
<StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory>
```

* Save the file

Now you can run the app:

* **Debug > Start Without Debugging**
**Debug > Start Without Debugging**

---

Expand Down
4 changes: 3 additions & 1 deletion samples/core/GetStarted/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ public class BloggingContext : DbContext
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }

// The following configures EF to create a Sqlite database file as `C:\blogging.db`.
// For Mac or Linux, change this to `/tmp/blogging.db` or any other absolute path.
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite("Data Source=blogging.db");
=> options.UseSqlite(@"Data Source=C:\blogging.db");
Copy link
Contributor

Choose a reason for hiding this comment

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

The VS Mac tab is available but probably not what you want. Need either code comments or note before code for mac/linix

Copy link
Member Author

Choose a reason for hiding this comment

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

How does this note look?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can also add a comment here in code what to use if your are using mac/linux.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, it turns out even folks reading localized content prefer helpful english code comments. I hate the chrome of a note. I'd move this to the code comments and remove the note. Note chrome detracts from the flow of the article.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to note into a code comment

}

public class Blog
Expand Down