Browserlink CSS autosync not working ASP.NET Core 2.0 - asp.net

I cannot get the CSS to sync in ASP.NET Core 2.0.
Here's what I do:
Create brand new application using MS template
Launch the generated template (app.UseBrowserLink() is present)
Try to modify site.css by setting the background-color to yellow
Nothing happens
I have the CSS autosync enabled, in the browserlink dashboard I can see the connected browser and I can also use the Refresh button on the dashboard
.
Funny enough, when I create a new project using the classic old ASP.NET MVC template, CSS autosync does indeed work, however I cannot make it run on ASP.NET Core template
I've also tried installing the BrowserLink.Loader assembly and referencing thatone but to no avail...
Any help greatly appreciated

It looks like this is an open issue with Visual studio, and as of October "CSS Auto-Sync isn't supported on ASP.NET Core yet".
Something you could try is to use Chrome's "add folder to workspace" feature as suggested here and you can also try enabling browser link for static files which has helped some people to make it work.
You can also vote on this to encourage Microsoft to implement CSS autosync for ASP.NET Core.

Related

Visual Studio 2022 Enable Web Live Preview

I wanted to try developing a website in VS but I'd really like a visual (WYSIWYG) editor. Apparently, this is available in VS. In that video, and lots of other videos and websites, it shows 'Design' and 'Split' buttons on the window, which should show a live view of the web page that's open. It seems this is supposed to work with both .aspx and .cshtml files.
However, nowhere can I find how to enable this, and I've done a lot of searching. I've even uninstalled and reinstalled VS. There are no options, settings or menu options to enable it. I'm using VS 2022 Community, fully up to date, in an ASP.NET Core Web App project using .NET 7.0.
Does anyone know what's wrong? I wondered if it was only available in VS Professional/Enterprise, but seemed silly to me.
that feature in the brand new vs2022 is for ONLY .net framework, and ONLY for web forms.
So, if you using MVC, then you don't have a forms designer.
And if you using .net core, then you can't use this feature either.
So, when you create a project, it MUST be .net framework (not .net core), and it MUST be a webforms project, and NOT MVC projects.
So, that would be say this (for c#).
And (best choice) would of course be this template:
And if using vb.net, then again, same thing:
So, web projects, and .net framework - NOT .net core projects.
thus:
So, out of those templates, then again, of course a asp.net web application would be the preferred choice.
so, for example, here is a gridview in "live" preview, and yes you can edit or drag + drop controls into that live preview.
it looks like this (split screen for example).
but, if I run the page, same in a chrome based browser (Edge, or chrome).
Then I see this:
Since the new designer is based on the chrome engine then as above shows, yes, it is rather cool.
Here is that web page, not split view in the designer:
(so I have NOT yet hit f5 to run, but only am in design mode)
so, in old legacy designer, I would see/get this:
So, note how do you DO NOT see say for example the bootstrap menu bar.
But, if I turn on live preview, and now I see/get this:
Note how we now even see the bootstrap menu bar in the preview - I have not yet hit f5 to run in browser. And on the bottom, you see a "bread-crumb hierarchy" as to what element you clicked on (very much like f12 debug tools in a browser, and then using "elements" selection).
You can find it by creating an asp.net web (.Net Framework) and selecting Web Form in it.
I use vs2022 17.4.2 community version
You can also view its settings in the tool.

F12 Go To Definition not working for CSS in CSHTML files - VS2017

I am working on my first Asp.net Core 2.0 Mvc web site.
Normally I use web forms, but I'm trying something new.
In my .cshtml files I cannot F12 or right click and "go to definition" on CSS classes. I thought something may be wrong with my install but I was able to open up a web forms application and it works just fine from an ASPX page.
I have seen topics from 2013 about this issue, but no solutions.
I have installed web essentials, but that didn't work either.
This is something I use regularly and it is hard to do it manually especially when you are looking at a minified CSS file.
I'm using Visual Studio 2017 Pro.
The ReSharper extension for Visual Studio adds this feature.
https://www.jetbrains.com/help/resharper/ReSharper_by_Language__CSS__Navigation.html#navigation-within-css-file

ASP.net 5 Website Preview template missing

I am following an ASP.net Tutorial
Under ASP.net5 preview templates the tutorial video has website template
while my Visual studio shows Web application template
is there any solution to this issue
thanks in advance
The video is using older versions. So find an updated video, or muddle through and expect things to not work because namespaces have changed.

How to Hide ASP.Net Website Source Code after Deployment

Am using Visual studio 2012 i cant hide ASP.NET Website source code .
Please support me.
Am try to see some tutorials those tutorials are for Project not for website.
If you are referring to the HTML or JavaScript code in your site, you can't hide that because it is required by the users browser to render the website.
If you are referring to the C# code files those should be compiled into binaries and only the binaries should be published out to the website folder. If the C# files are being included you probably need to set the Build Action on these files from "Content" to "Compile" via the Property window.
That being said the DLL binaries can be de-compiled in most cases. You can buy tools that will try to obfuscate your code which will make it harder but not impossible to de-compile.

ASP.NET Browser Caps update

I'm trying to update the browser caps using the ".browser" files (browserCaps section of the web.config is deprecated in .NET framework 2.0). So far, I found this project on CodePlex that provides updated files:
http://aspnet.codeplex.com/releases/view/41420
From the Visual Studio 2008 command promt, I ran the command "aspnet_regbrowsers -i" wich creates an assembly (ASP.BrowserCapsFactory.dll) and installs it in the GAC.
So far so good, the updated definitions take effect in my asp.net application.
The question is, is it possible tu use that assembly outside the GAC, like add it as reference in a Web application (I tried it and unless I'm doing something wrong, it doesn't work)?
I'm aware of the "App_Browser" folder solution, but I'm looking for a solution that will ensure the same browsers definitions for several web application without having to put an assembly in the GAC.
Thanks in advance for your answers!
ASP.NET 4 White paper
According to ASP.NET 4 whitepaper, you can manage browser capabilities within your code by extending the ASP.NET Browser capabilities or totally replace it. So far, it's the best you could do instead of using the aspnet_regbrowsers

Resources