-
Notifications
You must be signed in to change notification settings - Fork 676
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
Loaded .csproj project is not refreshed when 'dotnet restore' is executed #1114
Comments
I added the following and OmniSharp immediately began to be able to see the namespaces for AspNetCore. Deleting the bin and obj folders, exiting, and removing the new item group below did not cause the issue to return. I am more confused now that it's working than I was when it wasn't working. <ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0-msbuild2-final" />
</ItemGroup> |
I added <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" /> and the extension method below wasn't recognized. I tried deleting bin and obj and restoring / running again to no avail. Once I exited and restarted VS Code, it stopped putting a red underline under the extension method. app.UseStaticFiles(); It seems that this problem must be that Omnisharp is slow at noticing newly added extension methods which are extremely important to .Net Core. |
This happened for me as well with an almost identical situation. |
Note that there isn't any automatic package restore for VS Code with the new csproj .NET Core proejcts. You must run a |
The issue tracking that work is #770. |
@DustinCampbell I am speaking about the plugin not recognizing that a package has been added. I use |
Yes, I totally agree. The two issues are related though. |
Ok, thanks. I was worried we had a disconnect. I will look forward to the completed MSBuild support (which has been pretty nice looking so far btw). |
OK. The issues aren't precisely related. I have a fix for this one. |
That is, I have a fix for the issue where the project doesn't update its references after a |
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview4-004233)
Product Information:
Version: 1.0.0-preview4-004233
Commit SHA-1 hash: 8cec61c6f7
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview4-004233
VS Code version: 1.8.1
C# Extension version: 1.6.2
Steps to reproduce
Run...
dotnet new
Add to csproj:
Add to program.cs:
Total text of csproj is (I also updated the .NET versions to Core 1.1.0):
Total text of program.cs:
Expected behavior
Omnisharp should be able to identify new packages and treat them the same as references in the old json version of the config.
Actual behavior
AspNetCore
in each using statement has a red underline with message "namespace does not exist".Once adding classes such as
IApplicationBuilder
orWebHostBuilder
to the code, they will not be recognized either. However, the syntax is correct, as demonstrated by being able to rundotnet run
The text was updated successfully, but these errors were encountered: