CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.94k stars 554 forks source link

Major issues making new solution #758

Closed dsdude123 closed 7 years ago

dsdude123 commented 7 years ago

I am unable to build or even save a new solution on the newest userkit. I had to reinstall everything (VS 2017, Windows, etc.) on my computer a few days back due to an unrelated issue and I haven't been able to get Cosmos working since. I have applied the fix to Cosmos.targets from #744.

When building a new solution I get the following output:

Solution is not saved. Please save your solution before managing NuGet packages.
NuGet package restore failed.
1>------ Build started: Project: CosmosKernel1, Configuration: Debug Any CPU ------
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(4,20,4,26): error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(14,12,14,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(15,12,15,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(16,12,16,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(17,12,17,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(18,12,18,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(19,12,19,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(20,12,20,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(21,12,21,18): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(4,71,4,98): error CS0518: Predefined type 'System.String' is not defined or imported
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(4,100,4,120): error CS0246: The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(4,123,4,125): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(14,55,14,70): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(15,61,15,68): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(16,59,16,80): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(17,59,17,68): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(18,68,18,75): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(19,55,19,70): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(20,53,20,68): error CS0518: Predefined type 'System.String' is not defined or imported
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(21,55,21,64): error CS0518: Predefined type 'System.String' is not defined or imported
1>Kernel.cs(4,13,4,19): error CS0246: The type or namespace name 'Cosmos' could not be found (are you missing a using directive or an assembly reference?)
1>Kernel.cs(1,7,1,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>Kernel.cs(2,7,2,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>Kernel.cs(3,7,3,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(2,7,2,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\dsdud\AppData\Local\Temp\.NETStandard,Version=v1.5.AssemblyAttributes.cs(3,7,3,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(11,7,11,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>obj\Debug\netstandard1.5\CosmosKernel1.AssemblyInfo.cs(12,7,12,13): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
1>Kernel.cs(10,28,10,32): error CS0518: Predefined type 'System.Void' is not defined or imported
1>Kernel.cs(15,28,15,32): error CS0518: Predefined type 'System.Void' is not defined or imported
1>Kernel.cs(10,33,10,42): error CS0115: 'Kernel.BeforeRun()': no suitable method found to override
1>Kernel.cs(15,33,15,36): error CS0115: 'Kernel.Run()': no suitable method found to override
1>C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.Net.Sdk\build\Microsoft.NET.Sdk.targets(92,5): error : Assets file 'C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>Done building project "CosmosKernel1.csproj" -- FAILED.
2>------ Build started: Project: CosmosKernel1Boot, Configuration: Debug Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>  Invoking il2cpu.exe "DebugEnabled:True" "StackCorruptionDetectionEnabled:False" "StackCorruptionDetectionLevel:" "DebugMode:Source" "TraceAssemblies:" "DebugCom:1" "UseNAsm:True" "OutputFilename:C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\bin\Debug\net462\CosmosKernel1Boot.asm" "EnableLogging:True" "EmitDebugSymbols:True" "IgnoreDebugStubAttribute:False" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.Asm.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Debug.Kernel.Plugs.Asm.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.System.Plugs.dll" "References:C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\bin\Debug\netstandard1.5\CosmosKernel1.dll" 
2>C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Build\VSIP\Cosmos.targets(39,5): error : Error occurred while invoking IL2CPU.
2>  Executing command line "C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\IL2CPU.exe" "DebugEnabled:True" "StackCorruptionDetectionEnabled:False" "StackCorruptionDetectionLevel:" "DebugMode:Source" "TraceAssemblies:" "DebugCom:1" "UseNAsm:True" "OutputFilename:C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\bin\Debug\net462\CosmosKernel1Boot.asm" "EnableLogging:True" "EmitDebugSymbols:True" "IgnoreDebugStubAttribute:False" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.Asm.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Debug.Kernel.Plugs.Asm.dll" "References:C:\Users\dsdud\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.System.Plugs.dll" "References:C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\bin\Debug\netstandard1.5\CosmosKernel1.dll" 
2>  Working directory = 'C:\Users\dsdud\AppData\Local\Temporary Projects\CosmosKernel1\bin\Debug\net462\'
2>  Loaded : DebugEnabled
2>  Loaded : StackCorruptionDetectionEnabled
2>  Loaded : DebugMode
2>  Loaded : StackCorruptionDetectionLevel
2>  Loaded : TraceAssemblies
2>  Loaded : DebugCom
2>  Loaded : UseNAsm
2>  Loaded : OutputFilename
2>  Loaded : EnableLogging
2>  Loaded : EmitDebugSymbols
2>  Loaded : IgnoreDebugStubAttribute
2>  Loaded : References
2>  Loaded : AdditionalSearchDirs
2>  Loaded : AdditionalReferences
2>  Executing IL2CPU on assembly
2>  Error: No Kernel found!
2>  Errorred
2>  IL2CPU invoked with DebugMode='Source', DebugEnabled='True',StackCorruptionDetectionLevel='{NULL}', TraceAssemblies='{NULL}', IgnoreDebugStub='False'
2>  IL2CPU task took 00:00:02.7742373
2>Done building project "CosmosKernel1Boot.Cosmos" -- FAILED.
2>
2>Build FAILED.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Additionally, upon trying to save the new solution, Visual Studio displays an error that reads: "The operation could not be completed. No such interface supported."

jp2masa commented 7 years ago

The project wasn't restored for some reason. Try restoring it manually.

dsdude123 commented 7 years ago

Can't do that on a new solution because I can't even save the project. Package manager console says "Solution is not opened or not saved. Please ensure you have an open and saved solution." and it just stops there, can't run any commands.

I tried running the restore on an older solution that I had saved and it ran successfully but the errors still remain.

jp2masa commented 7 years ago

Try reinstalling the User Kit.

dsdude123 commented 7 years ago

Still doesn't work, one thing I noticed however is that my older solution has none of the errors with the System namespace. Only has errors with the Cosmos namespace.

UPDATE: If a manually reference the Cosmos DLLs, I can get my older solution to build successfully. Still no dice on making a new solution yet.

dsdude123 commented 7 years ago

Found a workaround for this issue, it turns out that "Save new projects when created" located in Options>Projects and Solutions>General was disabled and as a result the Cosmos project was being created as a temporary project and the restore failed as a result. Enabling this option fixes the issue.

Alternatively, adding <PromptForSaveOnCreation>true</PromptForSaveOnCreation> to the Visual Studio Templates for Cosmos should also fix the issue according to the MSDN although I have not tested this.

Arawn-Davies commented 7 years ago

Thanks for the tip! I added it to the project templates in the commit so if you either built the devkit or installed those templates it will sort it out for you :)

segg21 commented 7 years ago

This issue hasn't been yet resolved for me. I've talked to almost about every contributor and nothing in their power resolved it.

I couldn't save my project, as this weird error appears. It doesn't even show the project files in cache.

System, and Cosmos assembly could not be found. Restoring resulting into nothing. I've uninstalled/installed vs, user kit & dev kit.

This issue is weird. Idk why Cosmos went to 2017 that fast. Please support back 2015. .Net core sucks cause it doesn't work for me.

segg21 commented 7 years ago

Not only as of me, 70% of others are having constant issues.

ohsayan commented 7 years ago

The same for me. But on the contrary - I'm getting errors with the System and cosmos namespaces.

Arawn-Davies commented 7 years ago

We're depending on issues being fixed for a couple of other things not in our control, e.g. .NET Core 2.0 hasn't included the latest stable of Microsoft.Data.SQLite, which has fixes for the missing e_sqlite3.dll issue. These issues are also unrelated, as @dsdude123 said his issue was with the Cosmos project not saving, which was fixed by setting newly made projects to save automatically in the latest devkit (https://github.com/CosmosOS/Cosmos/commit/3dbb8678c49e14934ec9525d53b716ca4231534a at the time of this post)

These issues are unrelated, please open a new one exactly detailing what errors you are having. Also, the latest devkit is having issues regarding SQLite whereas the Userkit (20170928) isn't due to being built on .NET Core 1, so use that for the time being whilst we try and fix this.

jp2masa commented 7 years ago

I assume that "System and cosmos namespaces" means that the packages weren't restored, so it's still the package restore issue.

segg21 commented 7 years ago

@Arawn-Davies I'm sorry, but this issue combines. He's not here just because he couldn't "Save". He came because of missing references/namespaces (System/Cosmos), and my issue and the one comment issued above is related.

Using the fix, as of updating the template to manually save does not work/save at all. The same exact thing occurs.

@jp2masa No, ? Maybe. We've discussed this in chat. I did everything on earth that was possible. Upcoming 2nd week of bringing Cosmos to life.

dsdude123 commented 7 years ago

@LegitSoulja My issue of missing assemblies was being caused by the save issue because NuGet cannot perform a restore unless the project was saved. This is now fixed in the devkit (https://github.com/CosmosOS/Cosmos/commit/3dbb8678c49e14934ec9525d53b716ca4231534a), please open a new issue as for it is unrelated to this one. Either that or you have applied the fix for userkit incorrectly. Issue closed.