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

vscode not recognizing .csproj file #1250

Closed
AAndharia opened this issue Feb 17, 2017 · 17 comments
Closed

vscode not recognizing .csproj file #1250

AAndharia opened this issue Feb 17, 2017 · 17 comments

Comments

@AAndharia
Copy link

  • VSCode Version: 1.9.1
  • OS Version: win

Steps to Reproduce:

  1. have installed web api start project using this command
    yo aspnet webapi MyFirstASPNetCoreWebAPI

I've followed these links to create web api project template
https://docs.microsoft.com/en-us/aspnet/core/client-side/yeoman?#building-projects-with-yeoman
https://github.com/OmniSharp/generator-aspnet

  1. open the project in vscode

  2. It shows there are unresolved dependancies from .csproj. Please execute the restore command to continue. clicking restore shows this error in "Output"

error: Invalid input 'd:\Projects\vs-code-web\WebAPI1\WebAPI1.csproj'. The file type was not recognized.
Done: 1.

@DustinCampbell
Copy link
Member

Hi! What version of C# for VS Code do you have installed?

@AAndharia
Copy link
Author

I have not installed any c# version specifically, i just installed omnisharp plugin.

@DustinCampbell
Copy link
Member

DustinCampbell commented Feb 17, 2017

I'm not sure what you mean by the "omnisharp plugin". The extension produced by this repo is "C# for Visual Studio Code". You should have this installed:

image

In addition, could you run dotnet --info at a command prompt and copy-and-paste the output here.

@KarimGeiger
Copy link

KarimGeiger commented Feb 24, 2017

Hi,

I did the same and got the same error message, although I'm using Linux.

Running the --info command provided:

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     elementary
 OS Version:  0.4
 OS Platform: Linux
 RID:         ubuntu.16.04-x64

I guess this has to do with the following notice: NOTE: The content has been updated for .NET Core 1.0 SDK – RC4 (.csproj based) both LTS (1.0) and Current (1.1) versions - Looks like something doesn't support these csproj files. A workaround would be to install [email protected] instead of the current version.

Hope I could help. If not, I'm sorry. It's my first C# project.

@DustinCampbell
Copy link
Member

Note that the .NET Core SDK that you have installed only supports older project.json-based projects.

@DustinCampbell
Copy link
Member

@AAndharia: Without more information here, I'm unable to help. Could you take a moment to reply to my most recent response to you?

@AAndharia
Copy link
Author

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576

@vonbloom
Copy link

vonbloom commented Feb 28, 2017

Hi,

I'm stuck with a similar issue.

I have a unity project, generated using Unity VSCode plugin.

My .NET core specs are:

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64

When I open the project, OmniSharp complains that can't process .csproj files:

...
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to process project file '/path/to/project/Assembly-CSharp.csproj'.
...
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to process project file '/path/to/project/Assembly-CSharp-Editor-firstpass.csproj'.
...
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/path/to/project'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Startup
        Configuration finished.

@DustinCampbell
Copy link
Member

@vonbloom: That's likely a different issue since it's a Unity project. Could you file a separate issue?

@DustinCampbell
Copy link
Member

DustinCampbell commented Mar 1, 2017

@AAndharia: The problem you're experiencing is "by design" but it's because some bits that you're using are the latest and others aren't. The problem is that you have an older .NET Core SDK which only supports project.json .NET Core projects. However, it sounds like the 'yo aspnet' templates have been updated to create the csproj-based .NET Core projects. So, dotnet restore is failing because it doesn't understand your project file. I recommend installing a newer version of the .NET Core SDK from here which should work with csproj-based .NET Code projects.

@DustinCampbell
Copy link
Member

@KarimGeiger: I suspect my comment above describes the problem you're experiencing as well.

@KarimGeiger
Copy link

Yes, thank you very much. I think you can close this issue (at least from my point of view).

@DustinCampbell
Copy link
Member

OK. I'm going to go ahead and close this issue.

@AAndharia, please let me know if this doesn't solve the issue you're experiencing.
@vonbloom, please file a separate issue. As you're targeting a Unity project, there's almost certainly a different underlying problem.

Thanks all!

@FourOnes
Copy link

FourOnes commented Mar 6, 2017

@DustinCampbell I had as same as question, now resolved, thanks.

@iluqmansharif
Copy link

I'm having this issue on Visual Studio Code while running a Unity project.

Failed to load project file 'f:\Unity Projects\Pehli Paheli\Assembly-CSharp.csproj'.
f:\Unity Projects\Pehli Paheli\Assembly-CSharp.csproj

Detecting CSX files in 'f:\Unity Projects\Pehli Paheli'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files

@iluqmansharif
Copy link

@DustinCampbell Any help?

@DustinCampbell
Copy link
Member

@iluqmansharif : I recommend filing a separate issue rather than reporting a new problem on an issue that's been closed for nine months. Given the amount of time, the problem you're seeing is almost certainly different.

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

No branches or pull requests

6 participants