SimpleBrowserDotNet/SimpleBrowser

TeamCity Build Failing

kevingy opened this issue · 11 comments

I need some help from someone with more TeamCity experience than I have. The TeamCity build has been failing for about 8 months. There hasn't been a lot of changes since then, but I see the potential for more coming soon. I was having a problem where the build wasn't downloading Nuget packages. I may or may not have fixed that. I can't tell because the build is just hanging.

@jbuedel Are you available to assist? I recall that you did a lot (all?) of the TeamCity setup initially.

Can do. I’ll look into it soon

I wonder if the issue is that the build is configured to TargetFramework=net40. The unit test project doesn't have a net40 target. It has a net45 target. It doesn't make sense that this would cause the project to not be able to find dependencies. I don't have anything else.

We have a task to upgrade all of the projects to net45. Maybe leave this until the 45 update is complete. The build has been broken for 8 months. Being broken a bit longer won't hurt.

I was having an issue (#198) with TLS 1.2 support and since it wasn't completed I downloaded the source, made the changes to net472 (skipping net45) and it seems to be working well. (Thank you kevingy for stating the necessary change to the Browser constructor.) Before I made the changes I noticed the test project version was net45 already and it did NOT seem to be working, although it did not complain when compiling. I suspicion the cause to be in the dependency load for RazorLight. Also, the targetFramework selector in the project files was NOT working, necessitating changes to be made to the .csprog files directly. I bet I still have some of that set incorrectly.

Teun commented

I can have a look at it. It is still failing. The error message is rather mysterious.

I also expect that the key for publishing to nuget.org is expired. I had to create a new one for the WebDriver project. But that will only become an issue once the build stops failing.

Teun commented

Not quite working, but made some prgress:

  • 4 unit tests are failing
  • nuget pack gives a weird error (Unable to find 'bin\Release\SimpleBrowser\bin\Release'. Make sure the project has been built.) It seems related to this issue in Nuget: NuGet/Home#4054

Maybe @Styxxy could have a look into this. He set up the dual targeting and may know of a way to get nuget pack working for this setup. Maybe switch back to packing based on the nuspec instead of the csproj?

Teun commented

I got myself a Windows dev machine and have it partially working. There were quite some little things wrong in the code base. On my machine (culture: nl-NL) the unit tests for NumberInput were broken. In a large number of places the code for that element does string<->decimal conversions without worrying about cultures at all. That can't be right. I fixed all of those places, but the code can now use some refactoring and cleaning up.
The solution itself is building both net45 and netstandard2.0 when running in VS2017, but from MSBuild, I can get only net45 working. The nuget pack command also fails (known Nuget bug). I resorted to packaging only the net45 version for now. The package is now published as a prerelease version to nuget. It works fine when running Update-Package for an existing project and to my surprise, it even works from .NET Core 2.1 with a warning (NU1701 Package 'SimpleBrowser 0.5.154-pre' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project).

  1. Can some more people try to use this prerelease version please? Just run Update-Package SimpleBrowser -IncludePrerelease
  2. I think that when after 2.5 year we publish a new package with so many changes in it, we should probably reflect this in the version number? 0.6.x?
  • the fixed version is in a branch. I have configured TeamCity to be able to build feature branches. We should probably use this for building pull requests too.
  • then maybe we are prepared to automatically create packages for any master commit, because we can already do a full build with tests AND publishing the package as a prerelease before touching master?

@Teun Which errors do you get? On command line, when I did the conversion it worked. But maybe something changed in the meantime :-).

Teun commented

If you run nuget pack on the csproj file (the modern approach), it logs:

Unable to find 'bin\Release\SimpleBrowser\bin\Release\'. Make sure the project has been built.

Link to build log, log in as guest. This is the NuGet issue with an error message that looks suspiciously similar: NuGet/Home#4054.

The workaround I tried was to use the nuspec file, but then you have to make sure that the build step has built both target platforms. I think this would be possible, but for some reason I couldn't get it to work. Check on a log of this approach here.

The TeamCity build is no longer failing. That would be good news, except that TeamCity isn't building at all. Our project now requires MSBuildTools16.0_x86_Path, but there are no TeamCity build agents that support that requirement.

Since TeamCity no longer works, what about moving over to Azure DevOps Pipelines? I've used it for a few other projects. It seems fairly simple.

Cured the disease by killing the patient. CI/CD is now on Azure DevOps Pipelines.