microsoftlearning / 20483-programming-in-c-sharp Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm an MCT, instructing - among other - The 20483 Programming in C# Course.
I've been using self-developed Labs in the course, but thought I would give the official material a try after the recent update.
First, it is important to hold in mind, that the new Labs are required to run on a very mixed set of computers, each with their own level of updates and installed software.
I've tried using my own office/development computer and quickly ran into problems:
Database 1:
Creating a database, using then delivered script SetupSchoolDB.cmd, was impossible - Windows rejected this with a warning about dangerous software.
Database 2:
Instead I tried to execute the backing script (SchoolDB.sql) from a Query inside Visual Studio (Enterprise 2017, release 15.7.4). The result was multiple errors, mostly because the script tries to force the location and size of the database files.
A simple workaround is to delete the lines from the script, after witch the database gets created.
NOTE!
This creates the database on my default local server, which - as far as I know - was installed by Visual Studio. Target is simply: (localdb)\MSSQLLocalDB
Labs in Visual Studio 1:
When opening the first Lab, I am met by a message saying that the project requires .Net 4.7.
I've only got 4.6.1 - the dialog suggest downgrading the project to that version.
Do any of the labs actually require 4.7 or can an older version work?
Labs in Visual Studio 2:
Finally able to execute the application - hit F5 and we are up and running.
No. After a long time the form shows, but no data.
Investigation in the Config file shows, that the Connection String references ".\sqlexpress".
SQLexpress 2017 is actually one of the requirement in the setup guide for the Course, but why?
Changing the reference to "(localdb)\MSSQLLocalDB" makes everything run smoothly. . .
I haven't come any further in my experimenting with the labs.
Finally a comment with respect to the Labs. This is NOT directed at this course specifically, but more in general:
Our Students use more time, trying to understand the Application in general, actually working with code for the current subject is usually a very minor part of the time used.
In Module 11: Upgrade the Grades Report | Task 3: Build and test the application | of Exercise 1 | Step 3 directs the end-user to put in a password of password but it should be password99.
Thanks!
Scripts needs Quotes around the paths - som installations (especially individual user installations) have a space somewhere in the path.
Also a problem when actually running the script (after correcting the above).
Windows reports some kind of access error, due to the script specifying the exact placement of the db-files.
When this specification are removed (db-files placed with the sql-instance), the script runs fine.
The setup guide does not address the requirement for word to be installed. beginning with mod 11, word must be installed to satisfy the interop library requirements of the labs
For MOD08, the Lab Manual does not match the LAK or the code. E.g. it refers to Grades.WPF, not GradesPrototype, and tells them to add a regular service reference.
Not a major issue, mainly posting this for students. In Module 8, exercise 1, task 1, step 10, there is already a connection string in the Web.config file so you need to delete that then paste in the previously copied connection string.
As this training is based on the .NET Framework and an old version of Visual Studio, it would be useful to update it to .NET Core 3.1 and C# 8 and going forward to .NET 5.
I started on doing some updates in the dotnetcore3 branch of https://github.com/christiannagel/20483-Programming-in-C-Sharp, but don't have enough spare-time to update everything. It's a major change.
Because of the major changes that cannot be done all at once, a new branch in the MicrosoftLearning repository would be useful, probably also a complete new repository similar to the ASP.NET training.
Changes needed:
Host
class)To update the WPF applications, try-convert is a useful tool.
When displaying date of birth, the lab uses the current locale (in my case Danish: dd-mm-yyyy).
When saving a student, the code uses "ParseExact", expecting a US format (mm/dd-yyyy), which results in an exception.
The solution provided and the instructions for the TestValidGrade TestMethod are incorrect causing this test method to fail the unit test.
The following command parses 01/01/2012 from a datetime to a string in doing so it becomes 1/1/2012.
GradesPrototype.Data.Grade grade = new GradesPrototype.Data.Grade(1, "01/01/2012", "Math", "A-", "Very good");
Simply changing the assert to the following allows the unit test to execute without errors.
Assert.AreEqual(grade.AssessmentDate, "1/1/2012");
The parse as far as I can tell happens in Grade.cs: line 41 of the solution. DateTime.ToString("d"); drops leading 0's.
Hello,
On the book, presentations and OneNote notes it's stated that there are 3 exercices however on MD of the Lab Files and LAK there is only 2.
The missing exercise is "Persisting the serialized grade to a File".
Reviewing the book the "Exercise 2: Previewing the grades reports" seems it was blended the the excersise 2 of the MD.
Maybe a warning can added to not cause confusion with the class on the documentation.
Step 3 lacks the specification of the requirement to create a new Class Library (.Net Framework) project to allow the ADO.NET Entity Data Model template to become available as an option in the Add New Item dialog on the project. A student could easily choose for the .NET Standard variant that will not show the particular new item template, especialy since it is listed as a later option.
when I run the SetupSchoolDB.cmd no database is created.
Microsoft.Data.Services, Version=5.8.3.0
should be
Microsoft.Data.Services, Version=5.8.4.0
Just noticed that the font used in the lab does not exists anymore in Visual Studio 2017 (Buxton Sketch). Can be replace with Segoe Script.
Hi,
The SkillPipe manual for this course states:
This revision of the course does not include virtual machines. The minimum hardware and software requirements are detailed in the course's Setup Guide, at: https://github.com/MicrosoftLearning/20483-Programming-in-C-Sharp.
However, this guide seems to be missing.
Thanks,
KenS
Dear All,
In Module 8, Exercise 2 has the following url:
http://localhost:1655/Services/GradesWebDataService.svc/$metadata
However, when we try to configure it (Add Service Reference) we are getting the below error:
In the new directory for Module 8 the following package folder is not found in the location listed. I am unable to find it anywhere in the new Allfiles. The new solution also wont run properly for Ex1, whereas the old GRades.WebDataService.svc that uses the Data.Services version 5.8.3.0 opens in Edge without issue.
In the Reference Manager – Grades.Web dialog box do the following steps:
Click Projects,and then select Grades.DataModel.
Click Browse.
In the Select the files to reference dialog box, browse to the [Repository
Root]\Allfiles\Mod08\Labfiles\Starter\Exercise 1\packages\EntityFramework.5.0.0\lib\net45 folder, click
EntityFramework.dll, and click Add.
Click OK.
The following folder does not exist in the repository? [Repository Root]\Allfiles\Mod08\Labfiles\Starter\Exercise 1\packages\EntityFramework.5.0.0\lib\net45
I need to reference it but I can't seem to find it? Maybe I'm doing something wrong or looking in the wrong place. Here is the exact part of the question:
"Add a reference to the EntityFramework assembly. This assembly is located in the [Repository Root]\Allfiles\Mod08\Labfiles\Starter\Exercise 1\packages\EntityFramework.5.0.0\lib\net45 folder."
Please advise. Thanks
The example of a Linq query on a collection in Module 3 fails on prices.Keys in the query. The compiler error CS1935 is reported: "Could not find an implementation of the query pattern for source type 'ICollection'. 'Cast' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?"
The code fragment causing the problem is the following:
Hashtable prices = new Hashtable();
prices.Add("Café au Lait", 1.99M);
prices.Add("Caffe Americano", 1.89M);
prices.Add("Café Mocha", 2.99M);
prices.Add("Cappuccino", 2.49M);
prices.Add("Espresso", 1.49M);
prices.Add("Espresso Romano", 1.59M);
prices.Add("English Tea", 1.69M);
prices.Add("Juice", 2.89M);
// Select all the drinks that cost less than $2.00, and order them by cost.
var bargains =
from string drink in prices.Keys
where (Decimal)prices[drink] < 2.00M
orderby prices[drink] ascending
select drink;
// Display the results.
foreach (string bargain in bargains)
{
Console.WriteLine(bargain);
}
Console.ReadLine();
Please advice.
Module 2 exercise 2 does not actually look like it's a complete solution, as per the instructions. The data does not save back to the database.
Hey guys,
I am using the Mod02 - Lab 2 for the Programming in C# - 20483C course.
Exercise 3: Saving Changes to the Class List
Task 3: Add exception handling to the code to catch concurrency, update, and general exceptions
While I am using the code for adding exception handling to the code to catch concurrency, update and general exceptions, it looks that OptimisticConcurrencyException not raising.
I am running 2 instances at the same time (1 from VS, 1 from the binary folder), I change the item from the VS, and then when I try to change it from the other instance, I can still change it again.
Last change always wins which is wrong.
Did anybody experience the same issue ?
Could you please validate/test the piece of code from your side ?
Why does OptimisticConcurrencyException or UpdateException not fire ?
Should I need to use a specific version of EF ?
thanks,
Michael
Task 1 Step 12.
When running the CreateCerrficate.cmd command the following error appears: 'makecert' is not recognized as an internal or external command.
Using Visual Studio 2017 and VS Developer Command Prompt 2017.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.