21

I have the problem that Visual Studio (or maybe Resharper?) removes line breaks when I try to start my application. This happens in a way that when I press F5 or click on the run button with the mouse that a line break at the line where the cursor was the last time will be removed which is extremely annoying.

I have not tried so many things yet because I really don't know where to start. I never experienced this problem before and was always working with the same setup:

  • Visual Studio 2010
  • Resharper 6.1.1

Other plugins I use but which were installed after the problem (so I think they should not be related to the problem):

  • AnkhSvn
  • TeamCity

Example:

Before:

public void test(){
  int x = 5;
}

After running the solution:

public void test(){
  int x = 5;}

Edit: This issue seems to be related to Resharper - so hopefully they will be able to fix this issue as I never had this with any previous versions. (http://devnet.jetbrains.net/message/5456038#5456038).

Eggi
  • 1,684
  • 4
  • 20
  • 31
  • In what type of file are the line breaks being removed? Can you give a piece of sample code that demonstrates the problem? – JaredPar Mar 25 '12 at 15:02
  • 1
    I have not experienced it in any other files than the normal C# code files and it also seems not to happen everytime. – Eggi Mar 25 '12 at 16:39
  • has anyone solved this problem, I have VS 2013 and resharper 8. i still has this problem . – Beka Tomashvili May 20 '14 at 10:19

8 Answers8

11

This is a problem with Dexexpress Dim@ster patch. If you delete licenses.licx and compile in the source code. Not happend. The problem is when you open a form and licenses.licx is created again. Is you uninstall the patch this dissapear. But I dont understand why deactivating Resharper the problem gone too. But without patch and resharper + devexpress trial working fine.

The problem is the patch.

Yuri Morales
  • 2,351
  • 4
  • 25
  • 52
  • 4
    Just add this command into "Pre-build event command line" of your project: `echo. 2>"$(ProjectDir)\Properties\licenses.licx"` – Nickun Feb 13 '15 at 11:46
  • using echo.2>"$(ProjectDir)\Properties\licenses.licx" in VS 2015 with DevExpress v16.1.5 when compiling I get the following error Unable to resolve type '2' in file licenses.licx. Any idea about how to fix this? – vcRobe Aug 31 '16 at 16:17
  • You can just delete all entries from licenses.licx file leaving it be empty and add this file to ignore list if you use source version control. – Alexander Smirnov Mar 27 '17 at 13:34
4

I'd do this before reinstalling:

  1. Uninstall All plugins
  2. Type devenv.exe /resetsettings

Now try and use your code as described without plugins. Slowly add back your plugins if its ok and check after each is installed if the problem manifests itself. if not it was some setting in one and its now gone, if it comes back after one is installed you have a good thing to look at.

Just blatting the environment means you'll never find out whats causing it, which would annoy me :)

krystan honour
  • 6,523
  • 3
  • 36
  • 63
1

Have a look at ReSharper's Braces-settings: http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing (1st screenshot). Try changing those settings according to your needs.
If you're a member of a team, maybe someone else enabled sharing of "code style settings". See the previous link for that, 2nd screenshot. Does it also occur when you just build the project?

Martin
  • 1,149
  • 7
  • 13
  • Following settings are used: http://i.imgur.com/2Df9r.png. The project is not shared with anyone yet so the sharing options should not be the issue. I also don't think that these options above should produce an output like mentioned above. – Eggi Mar 29 '12 at 05:57
  • 1
    I have the same problem. Visual Studio 2013 and Resharper 8. Just with one project. Other projects works fine. Any file in the project. How you solve this issue? – Yuri Morales Nov 12 '13 at 16:13
0

In the build options try doing clean project, then open close the program. After this do a rebuild project. Also make sure the project is in debug mode for testing =)!

Chris Condy
  • 626
  • 2
  • 9
  • 25
0

Delete the settings resharper in solution. Helped me.

Dimon
  • 1
  • 1
0

I know that this question is a little bit old. But this may help anyone who encountered the same error with resharper and devexpress controls. I've tried all the above instructions, but the nothing works. BTW I'm using visual studio 2017 with resharper 2017.2.2 and devexpress 17.2.3

This what works for me.

Open build&run window in resharper. Click Resharper>Windows>Build&Run to open the the window then select "Enable 'Resharper Build'. Open any file in text editor and move the cursor at the end of any line of codes or on any empty line and try to build the project to see if it works.

Hope this will help.

akira1208
  • 11
  • 3
-1

At this point I would suggest uninstalling and reinstalling VS. Then add ReSharper and any of your extensions one at a time.

What Would Be Cool
  • 6,204
  • 5
  • 45
  • 42
-2

I had the same problem. I use this prebuilt-event script

break>$(ProjectDir)\Properties\licenses.licx

I have ReSharper 10.0.2, VS2013, DevExpress Components and VisualSVN.

Community
  • 1
  • 1
Turker Tunali
  • 377
  • 2
  • 11