I have a used the intranet template for a simple MVC 4 project.
I have tried to bundle separately my css and js.
All works ok until I change my web.config debug=false to make use of the minification.
When I run the project without debugging the application hangs and looking in firebug and fiddler it does not appear to make the requests for the bundles.
Have I missed sometin obvious?
make sure you are not trying to minify min versions of js and that you have the latest webgrease (1.3) from nuget.
Related
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).
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 creating an install for an MVC4 site that will be installed at customer sites. I do not want the javascript to exist on disk "not minified". Is there a way to use the existing bundling framework to bundle and minify on publish? Right now the files are served minified but are stored in their original readable format. Prior to MVC4 I was using a build script to do this, I hope to not have to go back to that. Is this possible?
I believe that this tool will do what you want; for what you're trying to do you'll probably want to use the MSBUILD-related functionality:
http://yuicompressor.codeplex.com/
I have upgraded my project from VS2010 MVC3 to VS2012 MVC4 recently and found out that new Razor URL resolution feature do not work do not work.
For example I have fav icon
and ~/ path is not automatically resolved by Razor. If I use old style(MVC3) Url.Content resolver everything works fine.
If I create new MVC4 project then paths are resolved successfully. I think that something is left not enabled when VS2012 upgraded my project but can't find what. Any ideas?
I have found teh problem by myself. It seems the project was upgraded that it still use MVC3, the project MVC version was not changed automatically.
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