Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors after referencing this package #7

Closed
paulguz-datapa opened this issue Feb 16, 2022 · 7 comments
Closed

Build errors after referencing this package #7

paulguz-datapa opened this issue Feb 16, 2022 · 7 comments

Comments

@paulguz-datapa
Copy link

paulguz-datapa commented Feb 16, 2022

On two different development machines, we've experienced build errors after referencing this package.

It seems that nuget packages are no longer recognised.

I was able to get building again after clearing my nuget folders. I, strangely, also had to reinstall the .Net 6 SDK.

This happens even when publishing in Debug mode.

Attached is an example of the errors experienced. We're using .Net 6.0.102 and Visual Studio 2022 17.0.6, on Windows 11.

MicrosoftTeams-image

@stavroskasidis
Copy link
Owner

stavroskasidis commented Feb 17, 2022

What version of the package are you using? There was an issue in the previous versions where you had to clean the solution before publishing.

Are you publishing through command line or Visual Studio?

Does build break after a publish or during a publish? A solution clean should fix any of these problems, no need to clean nuget cache or reinstall sdks.

@paulguz-datapa
Copy link
Author

Version 1.3. Publishing via Visual Studio. The build breaks after a publish. My colleague reports that he is only building in Debug. Cleaning the solution doesn't fix it, hence needing to clean nuget (nuget locals all -clear).

For me it is now fine, but my colleague still can't get it to publish (in Debug), even after cleaning the solution and nuget.

@paulguz-datapa
Copy link
Author

It's not just nuget. There's the BadImageFormatException regarding the Blazor project's DLL (see screenshot). What clue does that provide?

@paulguz-datapa
Copy link
Author

For what it's worth, our DevOps and Docker builds do not seem to be affected.

@paulguz-datapa
Copy link
Author

paulguz-datapa commented Feb 17, 2022

I've tried to reproduce this on anoher machine, but with no success - all builds and publishes are OK. That machine is Server 2019 (1809 - it was a dormant VM) with VS 17.1. I don't know if Windows 11 or VS 17.0 would be at fault.. Also, 17.1 comes with .Net 6.0.2, as opposed to 6.0.102 before.

@stavroskasidis
Copy link
Owner

The bad image exception happens because the previous publish modified the dlls in the obj folder and the build system does not understand that they must be refreshed. Have you tried deleting the bin/obj folders of the client and server projects ?

The tasks in the package are only running during a publish (either Debug or Release).

I will try to reproduce using VS, I have only been testing everything through command line. I am though gonna use and support only the latest versions (sdk and VS), in case the version does matter.

@stavroskasidis
Copy link
Owner

Closing due to inactivity and unable to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants