VS Code, OmniSharp: Project has these unresolved references: - asp.net

I'm trying out Asp.Net Core and MVC 6 running on Mac OS X. After I've updated and installed everything it seems to be working pretty good. I can run a website with 'dnx web' that's been generated by Yeoman.
OmniSharp starts correctly but displays this message,
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Project /Users/myname/AspNetCoreProjects/test1/project.json has these unresolved references: Microsoft.AspNet.Diagnostics, Microsoft.AspNet.IISPlatformHandler, Microsoft.AspNet.Mvc, Microsoft.AspNet.Mvc.TagHelpers, Microsoft.AspNet.Server.Kestrel, Microsoft.AspNet.StaticFiles, Microsoft.AspNet.Tooling.Razor, Microsoft.Extensions.Configuration.FileProviderExtensions, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Console, Microsoft.Extensions.Logging.Debug
I've tried to run 'dnu restore' several times. And it seems to succeed. It writes a lock file and so on. But for some reason OmniSharp / VS Code doesn't seem to find any references (except my own classes) at all.
It feels like I'm having the same problem described here,
http://tech.genericwhite.com/visual-studio-2015-net-5-rc1-dnu-restore-asp-dot-net-missing
But that didn't work for me.
Any idea is very helpful!

To start, install the runtime:
//to install coreclr
dnvm install latest -r coreclr -a coreclr-latest
//to install the clr
dnvm install latest -a mono-latest
dnvm alias default [coreclr-latest | mono-latest] //depends on what you installed
dnvm use default
Let me know the output of ls -l ~/.dnx/runtimes/dnx-{your_coreclr_version}/bin | grep dn once you've ran those commands.
This is what your runtimes folder should look like:
I'm also writing a 5 five part tutorial on how to use ASP.NET Core along with with JSPM, TypeScript, etc as the frontend. If you don't care much for that you can take a look at the backend part (part 3) here:
http://ahoycoders.com/2016/03/29/jspm-with-systemjs-es6-angularjs-typescript-and-asp-net-core-part-3-backend/
This part focuses on installing and running ASP.NET Core on MacOS.
Let me know how it goes :)
EDIT: One thing I forgot to mention, before running dnu restore again remove "dnx451": {}, from your project.json
EDIT2: Make sure you install the coreclr option. From your post it seems you want to use ASP.NET Core

Related

"dotnet" command does nothing

I'm trying to install a global package through dotnet cli but the command dotnet does nothing. I don't get an error message that says the command is not found etc. but it also doesn't run.
Between each line, cursor inside the powershell (or command prompt) turns into Working In Background ( ) mode but after just a few seconds, it just gets into the new line without doing anything. During these few seconds, if I move the cursor outside the prompt, it goes back to regular mode. So it's doing something I guess.
What is happening here, and how can I solve this issue?
What have I already tried:
1-) Since my network is behind a proxy, I've added the proxy credentials through NPM configuration commands. (as can be seen here)
(I also set the strict-ssl to false).
2-) Since it didn't do anything, I also used this method and edited the global nuget.config file. But didn't solve any problem.
3-) I tried this too, but setting the environment variable MSBuildSDKsPath seems to do nothing about my problem.
My PATH variable has these:
C:\Program Files\dotnet,
%USERPROFILE%\.dotnet\tools
I also downloaded the latest Dotnet 5.0 SDK and installed it, but nothing.
Only command that works with dotnet is the --list-sdks command which shows this result:
I uninstalled all the .NET SDKs and runtimes, I also removed all the installed modules on both VS 2019 and VS 2022 Preview using the Visual Studio Installer, then restarted my computer.
While installing the SDKs and runtimes from Microsoft's website I checked the .NET version using the command line and command dotnet --version after every installation to see when exactly it starts not working. After installing all the SDK's up to .NET 5, there was no issue. And since I did not really need the .NET 6 SDK I didn't specifically download it thinking VS 2022 Preview would automatically install it anyways.
Using Visual Studio Installer, I installed the necessary components for the dotnet development on the VS 2019 and the previously mentioned command was working on point. Then I proceeded to install the necessary components on the VS 2022 Preview but after installing it, the command started to not work. So there it was, the source of the problem. Something about VS 2022 Preview's installment process just corrupts dotnet cli, but I'm not sure if it's just me.
You also need a restart after all the installments or dotnet cli might show some errors.

How to deploy a sample GRPC [client-server] solution in raspberri pi in dotnet core

I am trying to run a simple GRPC client-server code in raspberri Pi running Raspbian os.
Language that i am using -C# dotnet core (2.1)
I downloaded a sample project from here.
This is a dotnet core project . I am able to run it in Windows environment, i am also able to modify .proto file in this code and run successfully.
I published the solution as it is with command
{ dotnet publish -r linux-arm }
When tried running same on Rpi, i am getting exception. Attached screenshot has the details of it.
Any help to get through this would be of great use
tl;dr The problem is the libgrpc_csharp_ext native library which currently does not get compiled and built for the arm7 processor. I've compiled it (on a pi) for arm7 and released a nuget package to bridge the gap until they support it all the way: https://www.nuget.org/packages/libgrpc_csharp_ext.arm7/
I'll update with a link to a blog post when I finish getting the rest of the tooling and template finished I'm working on.
fuller explanation: the Grpc.Core nuget package contains the native libgrpc_csharp_ext library that the dotnet implementation of grpc loads in NativeExtensions.cs then maps with PInvoke in NativeMethods.Generated.cs. Inspecting that package, you'll see a version of that library in each /runtimes/[win, osx, linux]/native folder. Unfortunately, no linux-arm version of the library is included. However, in the code, if the platform is linux, it will try to load the static library using the name as formatted here. Dissect that a little and you'll see that as of right now, any 'linux' platform that isn't '64bit' (which despite the proc on the pi being 64 bit, the distro of linux you're using on there, including raspbian, likely isn't) will look for libgrpc_csharp_ext.x86.so. When you dotnet publish -r linux-arm, you'll see that library there in the build output, but unfortunately, it's the wrong one (I think publish just grabs 'the closest one' when it can't find a specific library in the runtimes folder).
The nuget package I created above is compiled for arm7 - I actually cloned the grpc repo onto a pi and peeled away enough of the /csharp build to just cmake the libgrpc_csharp_ext. The 'trick' the package uses is to put the library in runtimes/linux-arm/native folder within the package, which dotnet core recognizes when publishing and pulls into the build output - but the library is still named libgrpc_csharp_ext.x86.so because of the way NativeMethods.cs formats the library name.

Project ERROR: Could not find feature when running qmake on any qt module

i am following guide written in here: https://wiki.qt.io/RaspberryPi2EGLFS
everythng runs smooth (needed to add fonts) - I can run and debug an application on my device from my pc.
But if I try to install any module (qtdeclarative, qt3d, qtquickcontrols, qtquickcontrols2) it just tells me no for a lack of some feature.
For examplee:
git clone git://code.qt.io/qt/qtdeclarative.git -b 5.9.0
cd qtdeclarative
~/raspi/qt5/bin/qmake -r
Gives me lots of positive code, but ends with:
Reading /path/to/raspi/qtdeclarative/src/quick/quick.pro
Project ERROR: Could not find feature qml-network.
Similar thing applies for the rest.
Could anyone tell me what to do?
edit
to make it worse same thing happens on 5.9.2 but 5.7 isn't compatible with rpi3
Try to do
~/raspi/qt5/bin/qmake
without the -r option. It worked for me.

How to restore an ASP.NET Core project with Ubuntu

Recently, I created an asp.net core project using Visual Studio Code on Windows and pushed it to GitHub. When I cloned the repo from GitHub and attempted to do a dotnet restore on the project on Ubuntu, an error message stating there was no project.json file was returned. Can anyone point me to a resource that will show me how to properly restore a .net core project from a Linux machine? Thanks!
So it seems like on each of your machines you are running different versions of the .net core SDK.
A big caveat with what you are trying to do. Are you trying to use Project Rider from Jetbrains on Linux? This only works with project.json (As of the time of this post) so be wary of that.
Now there are two ways to do this. If you are wanting the very latest on Linux and don't care about using Rider, then you can go here : https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and download the latest release for both Linux and Windows, install on both and you should be good to go.
If you do care about using Rider or you aren't ready to be strapped in for the wild ride of the latest release. Then you can do the following.
Find what version of the SDK you have on linux by typing into a terminal the following :
dotnet --version
This will spit out what version you have on linux. Go here and download the same version for windows and install it on your windows machine (https://github.com/dotnet/core/blob/master/release-notes/download-archive.md).
Now BEFORE you create a project, create a solution folder and create a file in it called global.json. Inside that put the following :
"sdk": {
"version": "1.0.0-preview2-003131"
}
Where the SDK version matches what you got from your linux terminal. Now create a folder for your project inside the solution folder. Run "dotnet new -t web" or a similar command to create your project. It will inspect the SDK version of the global.json and create a project with the tooling that matches. You should then be able to shift this project around any machine that has the same SDK installed, even if it also has the latest SDK's also.
If you do not create the global.json, it defaults to the latest version (Atleast on Windows).
Read a bit more about it here : http://dotnetcoretutorials.com/2017/02/17/developing-two-versions-net-core-sdk-side-side/

TideSDK | Bundle packaging

I have developed a TideSDK application and am now ready to package it, but I'm having problems with the network type installer.
It always gives me code 404 on the Application first run:
Could not query info: Invalid HTTP Status Code (404)
I presume the installer is having difficulty with reaching the correct servers and downloading the needed runtime, but I have run through most solutions on this forum, and none have worked.
So I tried a bundle packaging, as it should include such runtime, but I must be doing something wrong, since it does not bundle within the MSI.
The code I'm executing is as follows:
C:\TideSDK\sdk\win32\1.2.0.RC6d\tibuild.py -p --type=BUNDLE --os=win32 "C:\path_to_app\app_dir"
I also tried:
C:\TideSDK\sdk\win32\1.2.0.RC6d\tibuild.py -p -t bundle --os=win32 "C:\path_to_app\app_dir"
And all the uppercase/lowercase combinations. Also tried version 1.2.0.4, without sucess. Am I doing something wrong?
the network type installer is not available anymore, since appcelerator has canceled their services for titanium desktop.
So you can only do bundle packaging. Try the following command:
python tibuild.py --dest=. --type=bundle --package=. "c:\path\to\your\app\dir"
This should build and package your app and create a installer for it.
Change "dest" and "package" to the directories where you want to have the built app and installation package.
You can omit the OS parameter, since the builder can only generate builds for the current OS.

Resources