New to Visual Studio, program won't build - c#

I am relatively new to Visual Studio, C#, and using Github. I am trying to get the example for AncestralTrees working (Found here: https://github.com/fire-eggs/Ancestral-Tree). I cloned the repo and try to build, but I get a set of errors that do not make sense.
First is that AppSettings.cs and MruStripMenu.cs could not be found. Are these default config files I have to provide, or am I missing something?
And second is that .NET framework v4.5 wasn't found. For this I am a bit confused, because I thought it was backwards compatible, and I have v6.0.301 installed. To try and fix this error, I went to the website provided and downloaded it, but it wouldn't install as I already have a newer version. Again, am I missing something?
Any help would be greatly appreciated!

For the compatibility issue, .Net Core (6.0) and .Net Framework (4.5) are different animals, with .Net Core as more of a successor to Framework. They are very similar, but there are some breaking changes between Framework and Core, and if a project was intended for .Net Framework 4.5 you will want to have it installed on your system and set as the build target for the project in Visual Studio. You could probably also build for 4.7 or 4.8.
For the files, if they are part of the repo I would expect them to be there. I'd check your file system and see if the files are there, and then check the repo on github and see if they are included in the repo. If not, you may need an additional repo or you may need to manually add a NuGet package.
I did notice this at the bottom of the github page:
This program is both a demo of my GEDCOM library: YAGP, and a hopefully useful program in itself.
Where the "YAGP" text is a dead link. So I would expect to also need this project, which either no longer exists or is not public. This is probably the correct address:
https://github.com/fire-eggs/YAGP
(I submitted a change with the fixed link.)

Related

Install .Net Framework 4.5 Targeting Pack

please help.
I have installed quite a lot of framework and development pack. as you can see in the image.
unfortunately I want to access an ancient project. this project runs on .net framwork 4.5, and must not be upgraded.
I have visual studio 22 installed, but whenever i open the solution, i get the following error as seem in the image bellow.
At the moment I have succeeded in installing the target park for 4.5.2 but it is not helping.
I have tried to install the .net framework 4.5 runtime, but i get the error bellow.
Please help
With help of #JonasH and #Narish, I took time to study the documentation to understand what is happening.
Following an article referenced by #Narish, I made a copy of the v4.5.1 folder in the .NETFramework dir, which is still compatible with v4.5 and renamed it to v4.5
As of this moment, the legacy code and & still opens.

ASP.NET Core 6 Error: InvalidOperationException: A descriptor for '/Pages/Error.cshtml' was not found

I am new to ASP.NET Core 6 Web Applications. I am encountering a problem when I run my web application for first time.
I receive this error:
InvalidOperationException: A descriptor for '/Pages/Error.cshtml' was not found.
I need help to solve this issue.
There is a GitHub issue related to this error message, although the specifics of that particular case will be different. In it, contributor #pranavkm offers the following guidance:
The app references a 6.0 runtime and a 3.1 version of Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (transitively via https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc/1.1.2). We recently made a behavior change to Mvc which requires a compatible (6.0 versioned) runtime compilation when that feature is used. Adding a package reference to the 6.0 version gets you past that issue.
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.0-preview.2.21101.10" />
Mixing package versions (using 3.x or 5.x versioned package with the 6.0 runtime) isn't necessarily always going to work. We anticipate users to update their packages as part of the migration. I can run this by more people in the dev team, but it's unlikely that we will do any additional work here.
Now, obviously, you probably aren't using Volo.Abp—and, by extension, may not be using Razor Runtime Compilation. As a result, the source of your specific error is likely different. But the cause of your error should be the same: One of your dependencies maintains a reference to a legacy 3.x or 5.x package with incompatible code.
By evaluating your stack trace, you should be able to identify the specific culprit—and, hopefully, the developer has included an updated version of their package by now.
If it's due to a downstream dependency, as in the above example, you will need to drill down in the dependency graph on NuGet to find the offending package that relies on the 3.x or 5.x runtime. If that's the case, hopefully there is a newer compatible version, and then you can establish an explicit dependency to the upgraded version via NuGet.
If there isn't a newer compatible version of the offending package, you'll need to contact the vendor, and/or wait for them to release an update for .NET 6.
My solution was to change the target framework from net6 to net5, because it seems like the VS2019 probably unable to run the net6.0 application.
I had the same error and, after a package version wild goose chase, realised the page in question was excluded from my project:
This was fine until I moved over to VS 2022 for the .net 6 upgrade, and when I deleted the excluded files everything worked fine.
So I suppose that it was an issue with VS 2022 - unless someone can explain to me why it is legitimate for VS2022 to try to serve a page that is excluded from the project (when VS 2019 did not).

one or more projects require a platform SDK(UAP, 10.0.16299.91)

I am trying to open the UWP project but however because of versioning issue I am not able to load the project. It gives me following error.
However, this version is already installed and even I have tried to install it again. But even after that is again giving me the same error.
I have updated the project version in .csproj file also as below. The version which is mentioned in the screenshot is already installed.
<TargetPlatformVersion>10.0.16299.91</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.15</TargetPlatformMinVersion>
After doing all this it still gives the error as Visual Studio Update Required.
Any help on this appreciated!
Don't try to target your project to 10.0.16299.91 from your csproj, you can specific the target version to 10.0.16299.0 as Jet suggested. The build version is different from target version.
Thinking about this, if your customer is on 10.0.16299.0, then he cannot use your app? This is not reasonable. By the way, when you load your project, it will asks you to retarget your project, you can find the supported target version listed there.

Missing namespaces when downgrading to asp.net 4.0

I just had to downgrade my ASP.Net 4.5 application to an ASP.Net 4.0 application, because our servers don't support 4.5. The way I downgraded it was pretty simple:
Project -> Properties -> Application -> Target Framework
When it finished doing stuff, I restarted the solution, tried to start debugging, but it stopped right after I started debugging, giving me first some errors (which say they can't find some namespaces) for a fraction of a second and after the errors disappeared it gives me 127 warnings that all look like this:
Now I know what the problem is here, but I don't know how to solve this issue.. Does anyone know how to fix these warnings?
Thanks in advance
INFO
I'm using Visual Studio 2015 Community
Remove your current references to the Dlls in question and them add them again, it should load the correct versions of the Dlls. Because you had references to the 4.5 versions and then changed the project target the references are invalid now because they are build against a higher version framework. Changing the projects framework version target does NOT update the references in most cases
It is actually not that easy when it comes with ASP.NET. You have to go through all web.config(s) and downgrade referenced libraries. If its new project, just create new ASP.NET on .NET 4 and compare its web.config(s) with yours.

C# Referencing Quartz.DLL. Error on Debug losing Reference

I'm trying to build a simple scheduler using Quartz.NET, but when I try to run my program it "loses" the reference and gives me 8 errors. If I re-add the reference, which never actually disappeared, the errors go away, but the program just does the same thing. I'm working on the project on a Team Server Foundation which is completely new to me. I committed the changes, but I simply can't get the third-party references to stick.
I saved the Quartz.DLL in my project in a lib folder.
Here's a screenshot of the errors I'm receiving.
I should also note that I'm not really super familiar with C# or Visual Studios. Any advice on how to add and manage a third-party library would be great.
check if your project's properties is running under .net 4.0 and not client profile.
I think your issue is the using System.DateTime; above using Quartz;. Try removing that to see if it fixes the issues.
Also, if you are running Quartz 2.0, you need to be sure that you are targetting at least the .Net 3.5 framework, not 2.0. See the breaking changes information here.
Right click on Home_Control project. Select properties >> Select Application tab >> Look for the Target framework: >> Change it to .Net Framework 4 (Note: Please select the appropriate version depending on your project. Please Don't Select .Net Framework 4 Client Profile or .Net Framework 3.5 Client Profile).
Try Building the project now.
remove the Qurtz reference and add new reference manually . Use reference from netXX-client folder in package folder.

Categories