SBT project with different versions of dependency for plugin and itself? - sbt

I have a problem in a SBT project where there are two different versions of Apache HttpClient 4.1.3 and 4.3.1.
I made a small sbt project to reproduce the issue - https://github.com/eirslett/sbt-httpclient-problem
Does anybody know how this can be resolved? How can I have a sbt plugin that uses version 4.3.1, and still do HTTP requests from my build?

Related

Cannot find compilation library location for package 'Microsoft.NETCore.App'

I've upgraded from .NET Core 2.0 to 2.1.1 (so many elements that gets highly confusing).
I built my project and now I'm getting this error:
Cannot find compilation library location for package 'Microsoft.NETCore.App'
I don't know what other information should I provide. Please guide me in providing more info on this issue.
It's such a frustrating experience. Upgrading backward compatible version in Semantic Versioning shouldn't break things. I wish they had versioned this release as .NET Core 3.0, so that we wouldn't upgrade. Any help?
Update: I created this issue on GitHub.
I did simple fix for this issue, I selected option to remove additional files at destination before publish and then it solved my issue.
Just set MvcRazorExcludeRefAssembliesFromPublish to false in your .csproj file and that should fix the issue.
You're missing the SDK. Download and install 2.1.301 (at the time of writing), and you'll be okay. FWIW, you're not forced to upgrade. If the packages upgraded automatically, you either set a wildcard on package version or you just did something like "Upgrade all" in the NuGet Package Manager GUI. If you're concerned about things upgrading without your permission, then use explicit version numbers and pick and choose each package to upgrade manually.
Clean your hosted folder and install fresh. Re-installing the SDK/runtimes did not fully correct the issue for me.
Resolved this error by:
Re/Install SDK on IIS Server (2.1.3xx)
Re/Install SDK on Dev Machine (2.1.3xx)
Re/Install Runtime on IIS Server (2.1.2)
Clean hosted folder on IIS Server (I had old cshtml/dlls)
Republish to clean folder
Also try with an empty new project (File -> New Project -> ASP.NET Core Web Site -> 2.1)

Publishing a Self-contained Console app fails

I installed the .NET SDK 2.1.301-win-x64.exe and afterwards updated all the nuget packages to 2.1.1.
In my WebApp I have the Nuget Package Microsoft.AspNetCore.All 2.1.1 and Microsft.NETCore.App 2.1.0. In the Nuget Window I see that there's also the Version 2.1.1, but I can't select it (Blocked by Project)
Same story in my Console App: Microsft.NETCore.App 2.1.0
My first question: Is here already something wrong? Or is this expected behavior?
If I build the WebApp as self contained App, that works well.
If I biuld the Console App as self contained App (Self-contained / win-x64). I get the follwoing Error:
The project was restored using Microsoft.NETCore.App version 2.1.1,
but with current settings, version 2.1.0 would be used instead. To
resolve this issue, make sure the same settings are used for restore
and for subsequent operations such as build or publish. Typically
this issue can occur if the RuntimeIdentifier property is set during
build or publish but not during restore."
The source of this error is a referenced project.
What do I do wrong? Let me know if you need additional information, then I will add it.
This is a known issue for the moment. In your referenced project's csproj file, set the TargetLatestRuntimePatch property:
<PropertyGroup>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
This only happens when a .NET Core application references another .NET Core application and self-contained roll-forward only partially kicks in during publish.
For portable applications, it is enough to target 2.1.0 version of Microsoft.NETCore.App and when run on a target machine, the latest patch available on the machine will be used automatically. In recent tooling, a change was made so that the tooling would use the latest known patch version for self-contained applications so you automatically bundle the latest patch release with your application. However, this doesn't flow over project-to-project references.
See Self-contained deployment runtime roll forward for more information.

Spring-boot plugin for sbt

My goal is to package an executable spring-boot jar - a web app with tomcat embedded. I would like to use sbt but I don't find a straight forward way to do this. There are maven and gradle spring-boot plugins, but I don't see anything even close in sbt. My question is - is there a spring-boot sbt plugin, if not, is such functionality planned?

Ubuntu dnu restore scripts

I've got a problem with 'dnu restore' command in Ubuntu 15 trying to build an ASP.NET 5 application. If I add SignalR to dependencies in project.json, no JS scripts are added to my project directory. Visual Studio Code continues asking me to restore packages. The same situation with jQuery (yes, I know it's better to use Bower for it's installation). I've tried running command with '--no-cache' parameter and adding SignalR-Client dependency, but scripts are still not added. It seems like Server-side libs are installed successfully (project builds and runs when I inherit from SignalR Hub class, the only problem VS Code does not recognize installed namespaces and classes). Is it possible to fix it or should I manually download JS files?
I've found the reason. ASP.NET 5 packaging system is new for me so I didn't know how to use it properly. DNX doesn't know how to install client libraries at all. It places all the installed packages into a special directory shared by all projects. In order to install client packages Bower should be used (it is easy to add - just add a dependency in project.json and create a configuration file). By the way SignalR has it's own Bower package as well as jQuery (but this is obvious).

Visual Studio Tools for Apache Cordova : Update NPM and NodeJS

Hi I installed Visual Studio Tools for Apache Cordova during the winter. I have now worked on an angular project which has npm dependancies, and gulp files which use a Node server to serve pages to test out the app.
I did however like the way VS.Net installed NodeJS and other tools during the Visual Studio Tools for Apache Cordova installation, adding the correct paths to my system to get great CMD support for git, npm etc.
I want to continue to develop Cordova apps using Visual STudio, especially using the Mac remote deployment node module that was installed. However I find that the version of NodeJS and NPM that was installed is now out of date. I got a warning about version numbers when I installed the Azure-cli node package.
What is the best way to update NodeJS and NPM versions so that they stay integrated with Visual Studio Tools for Apache Cordova
There is no specific limitation for updating nodejs, but please be aware of some known issue related to newer version of nodejs. Just make sure you will not run into these scenarios, and I think you can feel free to update.
If you do encounter any issue after you update the nodejs to a specific version, I think it's good to raise the issue and let MS VS team to fix it in future release.
And make sure the nodejs is added into your PATH system environment varaibles.

Resources