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

Getting "missing reference errors" in Visual Code and dotnet script. #727

Open
mmarvb8h opened this issue May 26, 2023 · 1 comment
Open

Comments

@mmarvb8h
Copy link

Mac OS ARM
net7

dotnet script with Visual Code.

In the editor window i see the below errors with red underlines.

ERROR: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

ERROR: The name 'WebApplication' does not exist in the current context

script does contain the nuget reference:

#r "nuget: Microsoft.AspNetCore.App, 7.0.5"

The application runs fine. So i'm assuming the issue is in Intellisense. Have i set up something wrong?

thx
Marvin Foster -> mmarvb7@gmail.com

@mmarvb8h
Copy link
Author

mmarvb8h commented May 27, 2023

Solved: While responding i noticed that the .csprog file used by dotnet-script is missing the tag <ImplicitUsings>enable<ImplicitUsings>. I removed from my Webapi app and received the same Intellisense wornings during build. If i choose to ignore, app runs anyway. So that appears to be the issue.

I noticed that in dotnet script, the .csproj file re-generated. Is there a template somewhere that i can add this missing tag?

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

1 participant