Visual studio 2017 line breaks in cshtml - visual-studio

I have some annoying situation:
When I'm typing code and opening braces Visual studio insert double line break. Like this:
function a(){
}
I need:
function a(){
}
Help me please find proper setting.
Visual Studio 2017 > CSHTML > javascript block.
In .js files all works fine.

After confirmed with the ASP.NET Core web application, I can reproduced it and I have already reported this issue to the VS Product Team, please check this: VS 2017(15.3.3): in the Asp.NET Core Web application>*.cshtml>JS block and define the function, press Enter key inside the opening braces will get double new lines and you can add your own comment, let us waiting for the response comes from the VS Product Team, thanks.

Related

How to make the Visual Studio 2015 text templating security warning go away?

This problem is making me mad.
We have a set of projects that rely on T4 templates to generate code for a bunch of DSLs.
Every time I try to transform one of these T4 templates in Visual Studio 2015 I get this window, the security warning:
I have set the "Do not show this message again".
I have set the VS option "Text Templating | Show Security Message" to false.
Every time I restart Visual Studio 2015 and transform the first template the message pops up again.
This does not happen in Visual Studio 2013.
Some hints that may have something to do with this:
The actual text template that is called is published by a VS extension that is installed in the admin extensions directory ($ProgramFiles$\Microsoft Visual Studio 12.0\Common7\IDE\Extensions).
We are using our own custom code generator (that derives from TemplatedCodeGenerator).
Any ideas?
I have found the solution to this one a little by chance.
The problem was that the assembly containing the custom code generator was referencing Microsoft.VisualStudio.TextTemplating.VSHost.12.0 instead of version 14.0 as for Visual Studio 2015.
Oddly enough the transformation did not complain about the problem with the reference but completely ignored the VS option to stop showing the security dialog (may be because it was reading it from the wrong place?).
After correcting the reference, the problem never happened again.

Typescript Snippets on Visual Studio

I would like to know if any of you guys know a way to enable the following feature on Visual Studio (either a hidden setting or an extension):
I'm used to javascript development on Visual Studio where if I type:
"if" on the text editor, it shows me a popup ("code snippet for an if statement"). Pressing ENTER the following is added:
if (true) {
}
This is not available for typescript files!
These snippets are really useful and this is just a simple example
Another basic feature I'm missing is "braces auto completion".
I am not sure if there is a way to enable it or not, but really would like these basic features available.
This also applies for the newly released Visual Studio 2015. On the other hand, Visual Studio Code seems to handle it very well.
There is an issue on Github about being able to use Javascript snippets in Typescript files, and to make the Snippet Code Manager being able to recognize Typescript as a Language.
https://github.com/Microsoft/TypeScript/issues/312

VS2013 Javascript Debugging

Does any one know how to enable in page JavaScript script tag debugging?
In vs2012 i can go to the page in visual studio which is running in the debugger and create a break point however in vs2013 i get "A breakpoint could not be inserted at this location"?
Thanks
try to keep your scripts in separate files and put the breakpoints in that files. I had the same problem but when I moved java scripts from my views to script files I was able to debug. It may not be a solution but at least you should be able to work.
There was a known issue in Visual Studio 2013 that caused breakpoints to not work correctly inside script blocks. A fix was made and is included in the recently released Visual Studio 2013 Update 2 RC, which you can install from http://www.microsoft.com/en-us/download/details.aspx?id=42307.

VS2010 - Unable to view variable value when debugging

I am using Visual Studio 2010 Version 10.0.40219.1 SP1
Recently I installed VS 11 Developer preview and since when my existing VS 2010 has been giving me some problems.
I have created a small console application in C# that makes use of .NET 4.0, nothing fancy - basically it creates a string variable and writes it to the console. This has nothing to do with code, but rather Visual Studio. Because of the following that happens afterwards:
I am unable to view any information about the variable when debugging within Visual Studio. When I start the debugger (which is in debug mode), the application starts and breaks at the given break point but, when it breaks, I am unable to view any information about any variable (view the value of the string value).
Even when I drag the variable into the Watch window it states the following:
Unable to evaluate the expression.
Why is this and how can I fix this?
I managed to solve the issue by re-installing VS 2010.
Many thanks for all the feedback!

Visual studio 2010 ajax control toolkit tab container

We just upgraded to visual studio 2010 RC1 and all of a sudden our controls inside tabcontainer disappeared from the designer file.
Actually, it all seemed good in the beginning, the project compiled nicely, but as soon as we did any change in the markup of a page and build the code for the controls inside the tabcontainer disappeared and we got errormessages like so
"Error 3 The name 'ddlPeriodicityStartInMonth' does not exist in the current context "
Does anyone know if any changes are made to tabcontainer to visual studio 2010 or if this just is a bug?
Thanks in advance.
Found this one also.
Workaround: Missing Declarations for Controls in Designer File
I had the same problem.
Check out the following link:
Microsoft Connect - Bug in generating the designer.cs file in VS2010
Hope it helps.

Resources