Calen
Calen
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
C:\Users\calen\OneDrive\Documents\Capella University Homework\IT4747\U04a1_WinForm_DotNet7\U04a1_WinForm_DotNet7\U04a1_WinForm_DotNet7.csproj and C:\Users\calen\OneDrive\Documents\Capella University Homework\IT4747\U04a1_WinForm_DotNet7\Course\Course.csproj
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace u04a1_Registration_WinForm
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace u04a1_Registration_WinForm
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
cs namespace Courses
{
public class Course
{
// Parameterized constructor sets values for all properties
public Course(string courseNumber, string courseTitle, int credits, int weeks)
{
CourseNumber = courseNumber;
CourseTitle = courseTitle;
Credits = credits;
LengthInWeeks = weeks;
// Initialize IsRegistered to false
IsRegistered = false;
}

// These properties are auto-implemented and read only (init allows setting via constructor).
public string CourseNumber { get; init; }
public string CourseTitle { get; init; }
public int Credits { get; init; }
public int LengthInWeeks { get; init; }
// IsRegistered is read-write
public bool IsRegistered { get; set; }

public override string ToString()
{
return $"{CourseNumber}. {CourseTitle}. ({Credits})";
}

}
}
cs namespace Courses
{
public class Course
{
// Parameterized constructor sets values for all properties
public Course(string courseNumber, string courseTitle, int credits, int weeks)
{
CourseNumber = courseNumber;
CourseTitle = courseTitle;
Credits = credits;
LengthInWeeks = weeks;
// Initialize IsRegistered to false
IsRegistered = false;
}

// These properties are auto-implemented and read only (init allows setting via constructor).
public string CourseNumber { get; init; }
public string CourseTitle { get; init; }
public int Credits { get; init; }
public int LengthInWeeks { get; init; }
// IsRegistered is read-write
public bool IsRegistered { get; set; }

public override string ToString()
{
return $"{CourseNumber}. {CourseTitle}. ({Credits})";
}

}
}
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
cs using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Courses;
using u04a1_Registration_WinForm;

namespace Capella.IT4747
{
public class Validator
{
public static int ValidateRegistration(int IsRegistered, List<Course> courses)
{
int validationResult = 0;
int totalCCredits = 0;

foreach (Course course in courses)
{
if (course.IsRegistered)
{
totalCCredits += course.Credits;
}
}
if (courses[IsRegistered].IsRegistered)
{
validationResult = -2;
}
else if (totalCCredits + courses[IsRegistered].Credits > 9)
{
validationResult = -3;
}
return validationResult;



}
}
}
cs using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Courses;
using u04a1_Registration_WinForm;

namespace Capella.IT4747
{
public class Validator
{
public static int ValidateRegistration(int IsRegistered, List<Course> courses)
{
int validationResult = 0;
int totalCCredits = 0;

foreach (Course course in courses)
{
if (course.IsRegistered)
{
totalCCredits += course.Credits;
}
}
if (courses[IsRegistered].IsRegistered)
{
validationResult = -2;
}
else if (totalCCredits + courses[IsRegistered].Credits > 9)
{
validationResult = -3;
}
return validationResult;



}
}
}
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
8 replies
CC#
Created by Calen on 12/9/2023 in #help
Nuget SourceRoot | Microsoft.Build.Framework.ITaskItem | MSB4094 Error
cs <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<PropertyGroup>
<_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.GitHub.dll</_SourceLinkGitHubAssemblyFile>
<_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.GitHub.dll</_SourceLinkGitHubAssemblyFile>
</PropertyGroup>

<UsingTask TaskName="Microsoft.SourceLink.GitHub.GetSourceLinkUrl" AssemblyFile="$(_SourceLinkGitHubAssemblyFile)"/>
<UsingTask TaskName="Microsoft.SourceLink.GitHub.TranslateRepositoryUrls" AssemblyFile="$(_SourceLinkGitHubAssemblyFile)"/>

<PropertyGroup>
<SourceLinkUrlInitializerTargets>$(SourceLinkUrlInitializerTargets);_InitializeGitHubSourceLinkUrl</SourceLinkUrlInitializerTargets>
<SourceControlManagerUrlTranslationTargets>$(SourceControlManagerUrlTranslationTargets);TranslateGitHubUrlsInSourceControlInformation</SourceControlManagerUrlTranslationTargets>
</PropertyGroup>

<Target Name="_InitializeGitHubSourceLinkUrl" Outputs="%(SourceRoot.Identity)">
<!--
The task calculates SourceLink URL for a given SourceRoot.

If the SourceRoot is associated with a git repository with a recognized domain the <see cref="SourceLinkUrl"/>
output property is set to the content URL corresponding to the domain, otherwise it is set to string "N/A".

Recognized domains are specified via Hosts (initialized from SourceLinkGitHubHost item group).
In addition, if SourceLinkHasSingleProvider is true an implicit host is parsed from RepositoryUrl.

Example of SourceLinkGitHubHost items:

<ItemGroup>
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com"/>
<SourceLinkGitHubHost Include="mygithub1.com" /> ContentUrl defaults to https://mygithub1.com/raw
<SourceLinkGitHubHost Include="mygithub2.com:8080" /> ContentUrl defaults to https://mygithub2.com:8080/raw
</ItemGroup>

ContentUrl is optional. If not specified it defaults to "https://{domain}/raw".
-->
<Microsoft.SourceLink.GitHub.GetSourceLinkUrl RepositoryUrl="$(PrivateRepositoryUrl)" SourceRoot="@(SourceRoot)" Hosts="@(SourceLinkGitHubHost)" IsSingleProvider="$(SourceLinkHasSingleProvider)">
<Output TaskParameter="SourceLinkUrl" PropertyName="_SourceLinkUrlToUpdate"/>
</Microsoft.SourceLink.GitHub.GetSourceLinkUrl>

<ItemGroup>
<!-- Only update the SourceLinkUrl metadata if the SourceRoot belongs to this source control -->
<SourceRoot Update="%(Identity)" SourceLinkUrl="$(_SourceLinkUrlToUpdate)" Condition="'$(_SourceLinkUrlToUpdate)' != 'N/A'"/>
</ItemGroup>
</Target>

<!--
We need to translate ssh URLs to https.
-->
<Target Name="TranslateGitHubUrlsInSourceControlInformation">

<ItemGroup>
<_TranslatedSourceRoot Remove="@(_TranslatedSourceRoot)"/>
</ItemGroup>

=====> <Microsoft.SourceLink.GitHub.TranslateRepositoryUrls RepositoryUrl="$(ScmRepositoryUrl)" SourceRoots="@(SourceRoot)" Hosts="@(SourceLinkGitHubHost)" IsSingleProvider="$(SourceLinkHasSingleProvider)">
<Output TaskParameter="TranslatedRepositoryUrl" PropertyName="ScmRepositoryUrl"/>
<Output TaskParameter="TranslatedSourceRoots" ItemName="_TranslatedSourceRoot"/>
</Microsoft.SourceLink.GitHub.TranslateRepositoryUrls>

<ItemGroup>
<SourceRoot Remove="@(SourceRoot)"/>
<SourceRoot Include="@(_TranslatedSourceRoot)"/>
</ItemGroup>

</Target>

</Project>
cs <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<PropertyGroup>
<_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.GitHub.dll</_SourceLinkGitHubAssemblyFile>
<_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.GitHub.dll</_SourceLinkGitHubAssemblyFile>
</PropertyGroup>

<UsingTask TaskName="Microsoft.SourceLink.GitHub.GetSourceLinkUrl" AssemblyFile="$(_SourceLinkGitHubAssemblyFile)"/>
<UsingTask TaskName="Microsoft.SourceLink.GitHub.TranslateRepositoryUrls" AssemblyFile="$(_SourceLinkGitHubAssemblyFile)"/>

<PropertyGroup>
<SourceLinkUrlInitializerTargets>$(SourceLinkUrlInitializerTargets);_InitializeGitHubSourceLinkUrl</SourceLinkUrlInitializerTargets>
<SourceControlManagerUrlTranslationTargets>$(SourceControlManagerUrlTranslationTargets);TranslateGitHubUrlsInSourceControlInformation</SourceControlManagerUrlTranslationTargets>
</PropertyGroup>

<Target Name="_InitializeGitHubSourceLinkUrl" Outputs="%(SourceRoot.Identity)">
<!--
The task calculates SourceLink URL for a given SourceRoot.

If the SourceRoot is associated with a git repository with a recognized domain the <see cref="SourceLinkUrl"/>
output property is set to the content URL corresponding to the domain, otherwise it is set to string "N/A".

Recognized domains are specified via Hosts (initialized from SourceLinkGitHubHost item group).
In addition, if SourceLinkHasSingleProvider is true an implicit host is parsed from RepositoryUrl.

Example of SourceLinkGitHubHost items:

<ItemGroup>
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com"/>
<SourceLinkGitHubHost Include="mygithub1.com" /> ContentUrl defaults to https://mygithub1.com/raw
<SourceLinkGitHubHost Include="mygithub2.com:8080" /> ContentUrl defaults to https://mygithub2.com:8080/raw
</ItemGroup>

ContentUrl is optional. If not specified it defaults to "https://{domain}/raw".
-->
<Microsoft.SourceLink.GitHub.GetSourceLinkUrl RepositoryUrl="$(PrivateRepositoryUrl)" SourceRoot="@(SourceRoot)" Hosts="@(SourceLinkGitHubHost)" IsSingleProvider="$(SourceLinkHasSingleProvider)">
<Output TaskParameter="SourceLinkUrl" PropertyName="_SourceLinkUrlToUpdate"/>
</Microsoft.SourceLink.GitHub.GetSourceLinkUrl>

<ItemGroup>
<!-- Only update the SourceLinkUrl metadata if the SourceRoot belongs to this source control -->
<SourceRoot Update="%(Identity)" SourceLinkUrl="$(_SourceLinkUrlToUpdate)" Condition="'$(_SourceLinkUrlToUpdate)' != 'N/A'"/>
</ItemGroup>
</Target>

<!--
We need to translate ssh URLs to https.
-->
<Target Name="TranslateGitHubUrlsInSourceControlInformation">

<ItemGroup>
<_TranslatedSourceRoot Remove="@(_TranslatedSourceRoot)"/>
</ItemGroup>

=====> <Microsoft.SourceLink.GitHub.TranslateRepositoryUrls RepositoryUrl="$(ScmRepositoryUrl)" SourceRoots="@(SourceRoot)" Hosts="@(SourceLinkGitHubHost)" IsSingleProvider="$(SourceLinkHasSingleProvider)">
<Output TaskParameter="TranslatedRepositoryUrl" PropertyName="ScmRepositoryUrl"/>
<Output TaskParameter="TranslatedSourceRoots" ItemName="_TranslatedSourceRoot"/>
</Microsoft.SourceLink.GitHub.TranslateRepositoryUrls>

<ItemGroup>
<SourceRoot Remove="@(SourceRoot)"/>
<SourceRoot Include="@(_TranslatedSourceRoot)"/>
</ItemGroup>

</Target>

</Project>
I pointed out the area where the code is drawing the error from with a ' =====> '
8 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
sounds good!
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I totally understand. Again, thank you for the help with this!
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I really appreciate all the time you've spent in helping me out with this, this works for assignment and I really learned a lot and it made sense what you walked me through with. I noticed you have experience in WPF and that is also something I will be working on as well as ADO.NET with SQL. I don't want to take up much more of your time but if you're available in the future, I'd appreciate getting your .02 on some of that as well if it's needed
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I have to get in a whole different mindset with programming that everything has to be written out.
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
Worked like a charm. So, totalCredits += selectedCourse.Credits; reads the credit amount for a class, and then the second valueLabel.Text actually prints out the values of the courses?
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
How would that be, I tried
totalCredits += totalCreditValueLabel.Text;
totalCredits += totalCreditValueLabel.Text;
but got an error
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
No description
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I'm not finding that label
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
Are you asking me to come up with a name or what the label is called? cause I see totalCredits = 0 up top
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I'm looking for the line with the ints we need to change to a string
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
so what are the modifications that I need to do with the totalCredits?
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I have one question, in regards to the label, were you referring to line 92 with the credits?
235 replies
CC#
Created by Calen on 11/26/2023 in #help
WinForms Course Registration/Validation Homework
I understand, I appreciate you taking time out of your night to help me out with this. thank you
235 replies