问题
This is the error I'm getting when I attempt to run this project. There is nothing more in this module than simple code enough to display "hello world" I am running the same exact version of visual studio on another macbook I have with the same exact settings and it works perfectly. Any nudge in the right direction would be greatly appreciated.
/usr/local/share/dotnet/sdk/2.2.300/Current/Microsoft.Common.props(62,3): error MSB4019: The imported project "/Users/indianacones88/Documents/C#:ASP.NET/myApp/obj/myApp.csproj.*.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. [/Users/indianacones88/Documents/C#:ASP.NET/myApp/myApp.csproj]
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
Update:
This is the code that is found inside in .csproj file
<PackageReference Include="Microsoft.AspNetCore.App"/>
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAsse$
</ItemGroup>
</Project>
Other info:
I used the terminal command dotnet new console -o "project name". I have also had the same error when creating web app projects from the command line and directly creating a project inside visual studio.
No, my apologies I wasn't clear. I didn't copy the files I just have two MacBooks and wanted to set up a working C# environment on both. I downloaded visual studio on both. Attempted to create simple projects and one worked and the other did not. I have checked and the setting are the same. I'm not sure h
回答1:
Remove the : from the folder name in the path, as this seems to confuse the Microsoft compiler, perhaps due to the meaning of colon on Microsoft operating system file systems.
来源:https://stackoverflow.com/questions/56759959/mac-os-and-visual-studio-errors