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

InvalidProjectFileException #48

Closed
simax opened this issue Jun 18, 2019 · 3 comments
Closed

InvalidProjectFileException #48

simax opened this issue Jun 18, 2019 · 3 comments

Comments

@simax
Copy link

simax commented Jun 18, 2019

Firstly, thanks for creating this tool - I think it's going to be really useful for me.

Unfortunately when I try to run it I'm running into an issue when using this on a ASPNET core 2.2 app built with VS 2017

These are the steps I followed.

  1. Installed VS 2019
  2. Installed dnt via npm i -g dotnettools
  3. Created a switcher.json file
  4. Ran dnt switch-to-projects switcher.json

After which I received the followiing error:

Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files\dotnet\sdk\2.2.105\Current\Microsoft.Common.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props

Although it did add the project to the solution but didn't add a reference to the project or remove the nuget package.

So my questions are:

  1. Is there something else I need to do to stop the error?
  2. Should it have added a reference to the project and removed the nuget package?

Thanks again for your hard work.

@simax
Copy link
Author

simax commented Jun 19, 2019

I've managed to get a bit further with this after seeing issue #5

I had to change my C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\Sdk file like so:

  <!-- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />-->
  <Import Project="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Microsoft.Common.props" />

and then I could switch from projects to packages and vice versa. Yeah!

From reading issue #5 I assumed I wouldn't need to amend that file anymore - but things seem to be working correctly.

I'm using dnt version 1.2.5.0

@usego
Copy link

usego commented Jun 29, 2019

Seems installing of SDK 2.2.300 fixed an issue for me

@simax
Copy link
Author

simax commented Aug 16, 2019

Thanks, installing SDK 2.2.300 did the trick

@simax simax closed this as completed Aug 16, 2019
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