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 reinstalling VS2019 #84

Closed
pijnappel opened this issue Jan 19, 2022 · 4 comments
Closed

Build errors after reinstalling VS2019 #84

pijnappel opened this issue Jan 19, 2022 · 4 comments

Comments

@pijnappel
Copy link

I have integrated Jab into my Xamarin Forms project. It worked very well until I had to reinstall VS2019 some days ago.
Since reinstalling I am getting build errors:

CS0246 The type or namespace name 'Jab' could not be found (are you missing a using directive or an assembly reference?)
and
CS0616 'ServiceProvider' is not an attribute class
and more indicating the Jab package contents cannot be resolved.

Jab

I also have the preview of VS2022 installed. There it works perfectly. My colleagues machine uses the same setup with VS2019 and the same code. For him the solution builds without an error.

I'm surely missing something. Thankful for any hints.

@pakrym
Copy link
Owner

pakrym commented Jan 19, 2022

Does the same solution build from the command line (dotnet build)?

What's your output of dotnet --info? Is it different from your colleagues?

@pijnappel
Copy link
Author

dotnet build shows different errors because Xamarin is not supported by .net 5.
But I compared the output of dotnet --info to my colleagus output. Turns out I had an old-ish version of the .net 6 preview running. I removed all previews and cleaned up, ran another uninstall-cleanup-install of VS2019.

Now the original error is gone and the namespace, as well as the attributes are recognized again. Unfortunately the solution still doesn't build because of the following error:

Error CS8032 An instance of analyzer Jab.ContainerGenerator cannot be created from C:\Users\me\.nuget\packages\jab\0.6.2\analyzers\dotnet\roslyn4.0\Jab.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

@pakrym
Copy link
Owner

pakrym commented Jan 20, 2022

I was able to repo your original issue. It's fixed in 0.6.3 package. Unfortunately, I wasn't able to reproduce the updated issue. Can you try the fix and see if it helps?

@pijnappel
Copy link
Author

That did the trick. I just had to update to Jab 0.6.3 and everything compiles and runs perfectly.
From your changes I can grasp what happened. I just wonder what I did differently to cause this.

Thank you very much!

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