I am following the instructions for using .less to minify the css.
I have included the dll and made the Web.config changes.
However, when I refer to it in index.cshtml as Less.Parse, the Less namespace is not available and I get the exception "The name Less does not exist in the current context."
What am I missing?
I have solved it. It was just missing the parent namespace. Now conversion works like a charm.
dotless.Core.Less.Parse(css)
If you are using Visual Studio, Web Essentials has support for less.
http://vswebessentials.com/features/less
I often use it for :
.less to .css preview
View output from a .less compile
Extract variables/mixins
After build if you go to Output and select Web Essentials from the 'Show output from:' dropdown, you will see a date, time and the list of .less files that have compiled.
Related
I am using DotNetNuke 9.0.01. Here I created a module in Visual Studio and installed it in the DNN extensions. I didn't use the installation file but the one with the source code. Unfortunately now the file View.ascx.designer.cs is not below the View.ascx. It is outside the code-behind.
This also leads to the problem that intellisense doesn't know the attributes and therefore I can't use them. This in turn leads to the fact that I cannot compile. So it's not just a display problem.
I have tried to exclude the files from the project and include them again. But that doesn't work. I have also tried to modify the .csproj file. But that doesn't work either. I have also looked up at the properties but didn't find a solution.
I expected the datastructure to be like that:
>View.ascx
>>View.ascx.cs
>>View.ascx.designer.cs
But it is like that:
>View.ascx
>>View.ascx.cs
>View.ascx.designer.cs
I've solved the problem by myself. So basically I have to say that I use DotNetNuke (DNN) 9.0.01 as I already wrote in my question. For this I created a new module via Visual Studio and then installed this module in the DotNetNuke web interface. It is important to use the Install.zip and not the source.zip. Furthermore the location of the module is very important. This must be located in the folder "DesktopModules". Already when creating the module! If you want to edit the module now, you have to open in Visual Studio the solution of the module and not the whole DotNetNuke project. That was my mistake. If you open the solution of the module, all files are nested correctly. If you now make changes to the module and rebuild the module, all changes in the entire DotNetNuke project will be applied.
Thanks anyway to everyone who tried to help me.
In a Siteocre project I want to compile all cshtml files using the MvcBuildViews setting. Unfortunately this also compiles any ascx and aspx files. I get an error like :
32>/temp/Sitecore/admin/Wizard/InstallationLog.ascx(1): error
ASPPARSE: The base class includes the field 'logPanel', but its type
(System.Web.UI.HtmlControls.HtmlGenericControl) is not compatible with
the type of control (System.Web.UI.HtmlControls.HtmlIframe).
Is there a way to restrict the view compilation to cshtml only?
I will transform my comment into an answer.
Your approach to have Sitecore inside your Visual Studio folder is not correct.
You need to separate your Visual Studio and website folder where IIS is mapping your site.
On next link is explained very well how to create a Visual Studio Project for Sitecore MVC .
http://sitecore-community.github.io/docs/sitecore-mvc/creating-project/
I am using MapForce for the first time. I was able to successfully create an XML mapping. However, I am not sure how to run the generated code in Visual Studio, so that I can use it and see the output. I generated the code for the mapping in C# and did try to run the "Mapping" Project in VS.
Unfortunately, I am not able to due to few errors. There isn't a good documentation on the folders that are created in the project. If I can get a documentation link that I can refer to or if somebody can define why those folders are there and how can I use them/ how I should be running those projects.
Please correct me if I am wrong anywhere.
If you generated code to C:\MyFolder\, then you need to open in Visual Studio the solution C:\MyFolder\Mapping\Mapping.sln. Note that the "Mapping" is the default name, if you configured it to be something else from MapForce settings, then it may be different.
Solutions in other generated folders are supporting libraries, and you should never edit them (or at least do so at your own risk). The only file you can (but you don't normally need to) modify is called MappingConsole.cs. For example, you may want to change the paths of the mapping input/output files. In any case, after you build and run the solution, a Mapping.exe application is created in the Bin\Debug folder.
It would have been helpful if you indicated which errors you get. Perhaps the paths to the mapping input files cannot be resolved relative to the Mapping.exe application?
I'm having trouble understanding a behaviour of Nuget. I've created a basic package that deploys a single Test.cs file into an "HtmlHelpers" folder in a project. I'm following the "convention based working directory" method described on the Nuget site.
The issue I'm having is Resharper file analysis isn't enabled for this file (the file doesn't compile currently, I've left off a semicolon):
But, if I rename the file from "Test.cs" to "Test2.cs" then Resharper analyses the file correctly showing the syntax error:
Has anyone got any idea what's happening here? Is there a list somewhere of Nuget-supplied source files that are then excluded from Resharper analysis? The file properties are the same as for any other C# file, set to Build Action "Compile" etc.
EDIT1
To answer questions from Stephen below, this is Resharper 8, I'm not currently on 9. I've tried closing and re-opening the solution and excluding and re-including the file, neither of which help.
Interestingly, with analysis working correctly on the renamed "Test2.cs", if I then rename it back to "Test.cs" the analysis switches off again :S
EDIT2
Just to add some more info to this, if you Nuget-deploy C# files using the .pp extension, Resharper analysis works correctly on the resulting .cs files. Go figure.
ReSharper excludes source code that has been delivered as part of a NuGet package from analysis - it treats it as third party code that you did not write and do not want to maintain. E.g. it won't show any inspection results for files such as jquery.js or angular.js - you don't own these, don't intend to maintain them as part of your project, and any changes you do make are likely to get overridden the next time you update the project. So, inspections are disabled for these files, but the files are still indexed to allow navigation.
Just in case anyone else has this issue it only happens if Nuget delivers a .cs file. If you get Nuget to deliver a .cs.pp file, Resharper correctly analyses the resulting .cs file in your solution.
I was new to Nuget when I started this work and it turns out I needed to make them .cs.pp files anyway in order to use the correct project namespace when importing. So the problem has gone away.
I am building a personal website using asp.NET's webforms in visual studio 2013 express for web and am following this tutorial:
http://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/introduction-and-overview
My page is structured exactly the same as in the website, I have changed some minor stuff to make it my own but the structure in terms of the C# classes and how the interact with the HTML are exactly the same.
I got to section 5 of the tutorial "Display Data Items and Details" and everything was working fine. I've used git a lot in the past so I decided to create a repository for this project so I can access it at work if I feel like.
Suddenly now when I make changes to the C# classes it won't build. It's even stranger because I if I make a change on an HTML file the change is built. In section 3 of the tutorial we learnt how to make the 'product' classes which are displayed on the products page. If I want to change one of the product names for example, when I build the change is not there. Simultaneously I went and changed some info in the HTML for the contact page, IT CHANGES when I build. Why wont the C# changes take effect when I build any more?
I am relatively new to both asp.NET and visual studio. The HTML changes when I build and the C# does not. When I change either I can see in solution explorer that there is a red tick for pending changes. Why would only the HTML pending change be included in the build and not the C#? How do I ensure that the build is actually building the version I see in my editor window?
EDIT
I do not know if I found the original cause but I found a solution/workaround. I realized that the classes mentioned above were grabbed by the html page from the page's database. The .mdf file for the solution was not being rebuilt whenever I cleaned and built so I physically deleted it and rebuilt the solution and voilla my C# changes occurred. I am still fairly new to this whole thing, can someone explain what the .mdf file does and why it wasn't being rebuilt?
Check your .cs files properties on the properties window in visual studio to make sure their Build Action is set to "Compile", Things that are not set to "Compile" do not get compiled. How MSBuild treats project items depends entirely on their build action. CS files default to "Compile" when you make them, but if you changed them yourself that would be why it doesn't update. Also CS files placed in the App_Start folder default to "Content" and they are compiled by ASP.Net when the Application Starts, so if you changed something in App_Start you need to reset the site.
Not exactly sure what is the problem, but I would do a right mouse click on the solution in Solution Explorer->Clean Solution, then do another build and see if that helps.