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

The type or namespace name 'XXXXX' does not exist in the namespace 'XXXXXX' (are you missing an assembly reference?) BlazorHybrid (net6.0-maccatalyst), BlazorHybrid (net6.0-windows10.0.19041) #4060

Closed
nssidhu opened this issue Jan 11, 2022 · 4 comments
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects

Comments

@nssidhu
Copy link

nssidhu commented Jan 11, 2022

Description

I am using Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview Version 17.1.0 Preview 2.0

I am using DI for Platform Specific code. when i am using Android simulator, my project compiles without any error and runs without any error.

But when i change to iPhone local Device i get the following compile time errors. By creating shell implementation for the interface in remaining other platform i was able to get over Interface implementation error but .css error still remained.

image

Steps to Reproduce

Create Blazor MAUI Hybrid App

  1. Create Interface in the root of Blazor Hybrid App
  2. Implement Interface only in the Android App

Try running the App on Andorid Simulator, it should compile and run without any error.

Change the Device to iPhone Local Device
It will start displaying compile time error and app cannot be launched.
2) Implement the interface in other platform(Ok throw not implemented error)

Interface related error will no longer show up but .css related error still exists and app cannot be compiled or launched

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

ISO Platform is affected

Did you find any workaround?

none

Relevant log output

No response

@nssidhu nssidhu added the t/bug Something isn't working label Jan 11, 2022
@nssidhu
Copy link
Author

nssidhu commented Jan 11, 2022

I had to create empty shell Implementation for other platform to get around interface errors, but not sure how to resolve the .css error

@jsuarezruiz jsuarezruiz added this to New in Triage via automation Jan 11, 2022
@jsuarezruiz jsuarezruiz added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Jan 11, 2022
@Eilon
Copy link
Member

Eilon commented Jan 12, 2022

If the implementation exists only on some platforms but not others, then this error is expected. On the platform where the implementation doesn't exist, the code can't compile. You can add more #if WINDOW || ANDROID to import the namespace/types conditionally. Or, you can provide a "stub" implementation for the other platforms just to make things compile, even if the code just no-ops.

Can you confirm that is the case?

@nssidhu
Copy link
Author

nssidhu commented Jan 12, 2022

Stub Implementation did work, but still not able to compile because of .CSS Error.
The last two error in the screen shot are related to razor.css file. How do I resolve that ?

@Eilon
Copy link
Member

Eilon commented Jan 12, 2022

We need to investigate the issue you logged in #4061 . I'm not sure why it's happening.

@Eilon Eilon closed this as completed Jan 12, 2022
Triage automation moved this from New to Done Jan 12, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

4 participants