hi,
Iām trying to run the code (which I downloaded from github that is attached as a part of this course) and Iām getting build errors. Can you please help?
hi,
Iām trying to run the code (which I downloaded from github that is attached as a part of this course) and Iām getting build errors. Can you please help?
Hmm looks like something has the path hardcoded in there, but Iām not seeing this on a new machine with the code.
Can you please provide a few things, so I can try to replicate it here:
hi Hilary,
Thanks for checking. Iām using visual studio 2019 in windows. Also using .net core sdk 6 (latest version) since .net core sdk 2 is no logner supported.
Steps:
I just downloaded the code from git repository and unzipped it in my local machine and opened the solution in visual studio 2019 > Build the code. Iām getting the following error:
Build startedā¦
1>------ Build started: Project: APIChecksWithRestSharp, Configuration: Debug Any CPU ------
1>C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework ānetcoreapp2.2ā is out of support and will not receive security updates in the future. Please refer to .NET and .NET Core official support policy for more information about the support policy.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1166,5): warning MSB3191: Unable to create directory āC:\Users\g33kl\source\repos\APIChecksWithRestSharp\APIChecksWithRestSharpā. Access to the path āC:\Users\g33kl\source\repos\APIChecksWithRestSharp\APIChecksWithRestSharpā is denied.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1166,5): warning MSB4181: The āMakeDirā task returned false but did not log an error.
1>CSC : error CS0016: Could not write to output file āC:\Users\g33kl\source\repos\APIChecksWithRestSharp\APIChecksWithRestSharp\APIChecksWithRestSharp.xmlā ā āCould not find a part of the path āC:\Users\g33kl\source\repos\APIChecksWithRestSharp\APIChecksWithRestSharp\APIChecksWithRestSharp.xmlā.ā
1>Done building project āAPIChecksWithRestSharp.csprojā ā FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Please Note that I have Mac with me tooā¦I tried in Mac as well. In Mac the build was successful with visual study 2019 Mac. But Iām having another problem after I installing restsharp, tried to create the class library and did few coding related to restsharp by following the courseā¦It throws few errors in the var response = restrequest(Method.Get)
Hilary, Iām seeing the xml file(highlighted) in Mac while running the code which Iām not seeing in windows.
Thank you so much for this, it helps a lot!
I think I just need to update the base code to the latest frameworks and thatāll take care of a lot of the issues youāre seeing. Iāll make sure to do that this week.
With the RestSharp error, did you install the latest RestSharp version? There are breaking changes with the latest version unfortunately. If you can downgrade to 106.6.10 that would might work - if youāre already using that version, then Iāve got other stuff to update!
Thanks so much for investigating Hilary. I just installed the Restsharp package from visual studio as you mentioned in the course. Meanwhile, I will if downgrading the version of Restsharp helps. Please let me know if you find a fix so that I can continue with the course. Thanks for offering such a great course Hilary. I appreciate your effort.
2 things:
I found out how to fix the documentation error issue with the XML you initially described:
PropertyGroup
section, add this: <GenerateDocumentationFile>true</GenerateDocumentationFile>
The other thing:
I did the upgrade, and it looks like youāll have to go to Visual Studio 2022 (still community/free edition) to make it work with .NET 6 - thatās the latest version and has long term support.
Hereās the base code upgraded to the latest https://github.com/g33klady/APIChecksWithRestSharp/tree/feature/dotnet_upgrade
Please note! I did the upgrade and go through any build/running issues with CRUD tests but I havenāt done a complete test of everything (I might need to write some unit tests lol). Itās not merged in yet because itās still experimental, but you may have some success with it. I also havenāt touched RestSharpās latest version yet to see what changes need to be made, so please take this with that grain of salt. I wanted to get this out there ASAP
Hi Hilary,
Thanks so much. I will upgrade the visual studio and check with the latest base code to see if that works.
Regards,
Mohana