I have created a asp.net core 2.2 web app and I want to integrate TinyMCE in it. I found out that you can download it as a nuget package but when I installed it, the package did not come with the TinyMCE js template folder(It just said that the package was installed and that's it). How can I install TinyMCE properly?
NuGet does not support copying content files to your project directory any more. This was changed when PackageReference was introduced which is the new default and only supported way to include package references in .NET Core projects.
So while TinyMCE still updates the NuGet package, you will only be able to consume it properly in classic non-Core ASP.NET MVC projects on the .NET Framework.
If you want to use TinyMCE in ASP.NET Core, you should look at other mechanisms to include JavaScript dependencies in your application.
When you take a look at TinyMCE’s “Get TinyMCE” page, you will see a few options. If you already have some npm-based deployment set up, then you should probably get it from npm. Otherwise, you can also just download a static release and copy it into your wwwroot directory. This would actuallly have the same effect as using the NuGet package (if that worked).
Related
Environment: .NET Core 2.1 running on Ubuntu 18.04
When a new ASP .NET core project is created, a bunch of client-side packages are automatically generated. For example:
$ dotnet new razor
$ ls wwwrooot/lib
bootstrap jquery jquery-validation jquery-validation-unobtrusive
However, I do not see any configuration file that lists these client-side packages.
I believe bower is no longer being used. Plus, I don't see any bower.json file.
I believe libman is not even present on my machine. Plus, I don't see any libman.json file.
Using the command dotnet restore restores only the .net packages listed in .csproj file but does not restore packages under wwwroot/lib directory.
As a quick test, I deleted wwwroot/lib directory and tried various commands. However, none of my attempts was able to restore any packages under wwwroot/lib directory.
Can someone please tell me how are client-side packages managed in ASP.NET Core 2.1 and beyond? How does one upgrade these packages to the latest version?
Most of the files in projects created with the dotnet new command are simply hard-coded in the template. So if you delete them the only way to get them back would be to copy them in from somewhere else.
If you want to manage client-side libraries, then you can use any number of tools to help you such as LibMan or one of the many third-party alternatives.
Problem
I created an ASP.NET Core Web App on Ubuntu and it runs fine.
However, it seems to have included bower by default. I want my web project to handle serving the site, but to have any of the Javascript/SASS/CSS etc generation to be handled in isolation by Webpack in conjunction with a few other things.
Question
How do I cleanly remove bower from my project?
Delete bower_modules (or wwwroot\lib) folder, depending on which version of tooling you are using
Delete bower.json
I am working with .Net Core 1.0 (running under the .Net Framework 4.6.1, non-portable).
I need to include some DLLs that are from a locally-built GitHub project. When I build those projects, and then attempt to "Add Reference" to the resulting DLLs, I get a message saying I can't add them to a Core project directly.
After more research, I found a lot of information regarding "private" NuGet packages. However, those seem overly complex / overly engineered.
Is there any way I can do the following:
Without having to go through the headache of creating a private NuGet repository, can I just "add reference" to the built assemblies that are sitting in the bin folder of the NuGet projects I pulled?
I really don't want to have to build a local-only NuGet package. Mostly because I've already wasted too much time on this issue, and because I read this entire concept is about to be scrapped and turned into something else (sounds familiar by now)... such as the Roslyn-based build system on GitHub.
My current state:
Visual Studio Professional 2015
.Net Core 1.0.1
.Net Core 1.0.1 Tooling Preview 2
No, as for now you have to create a nuget package before and restore it via Nuget. You can use a simple folder as NuGet source, so if you put your compiled NuGet package in C:\packages, you can add this as a source to NuGet (while in the NuGet UI, click the settings Icon and add the folder as new source).
This may change with the next release of ASP.NET Core (1.1), as the .NET/ASP.NET Core team is working to move from *.xproj to *.csproj files.
One of the reasons why you need to use nuget is because it can contain multiple targets and project.json allows you to target multiple platforms (i.e. net452 and netcoreapp1.0).
I have a NuGet package that I developed, and that package contains web.config.transform file. When I install the package in a regular Asp.Net web project, the content from the .transform file is merged with the web.config (as expected). However, when I try to install the same package in an Asp.Net Core project, the web.config remains unchanged. Do config transforms even work with NuGet + Asp.Net Core?
For similar issue there is a community created cli command at https://github.com/nil4/dotnet-transform-xdt which allows you to transform xdt using command line.
Include above package in tools and you may trigger it post install of your package for applying xdt transform.
I'm using YUI Compressor as a MsBuild Task on my Azure project. It works well on locally but when I try to publish it I cannot insert minified packages to my azure application package. Although I have tried a lot of things about package modifying on my .csproj file I couldn't work it out. How can I do this?
Edit:
My project is not a MVC or Webforms application. Just HTML and Javascript inside of an ASP.NET project. My problem is not minification. It is just placing minified external files in Azure Package when publishing it but if there is any other method that solves this azure problem, I can change YUI Compressor with ajaxmin or google closure... doesn't matter.
I don't think modifying the service package is supported (you are also modifying the manifest). That's why I would look at it from an other perspective. I'm assuming you have such a setup:
Solution
Empty ASP.NET Project
Index.html
App.js
Now, after you compile (and the MSBuild task runs) you'll have something like this:
Solution
Empty ASP.NET Project
Index.html
App.js
App.min.js (not included in the project, but available on the file system)
Now, buy simply including the App.min.js file in the project, it will be included in the service package when packaging or publishing your application. And besides that, the MSBuild tasks runs each time you compile, meaning the file will be updated before each time the application is packaged.
As you haven't specified about about whether it is WebForms or MVC, I would like to point out the out of the box support for the bundling and minification in ASP.net MVC4. Scott Gu has explained it the MVC4 preview demo.
You can also tweek it to work a way for that in ASP.net MVC3 too. Once this is achieved, you can achieve that in Azure as well.
Additional Articles :
ASP.NET MVC4 bundling in ASP.NET MVC3
New in ASP.NET MVC4: Bundling and Minification