How to enforce style rules in a messy code base? [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've inherited a team who uses TFS 2012, with no checkin-rules whatsoever.
Our code base is often polluted by poor quality code, modifications to files that should be read-only, almost no-unit test coverage.
What can we use that will block poor-quality checkins? We currently all have resharper licenses.

Because you are using Resharper, I would recommend the Code Cleanup feature. It allows you to create a set of formatting rules that can be applied to a file when your run Code Cleanup. My team has a common Resharper settings file for code formatting that is checked into TFS.
After creating the rules, getting it checked in, getting buy in from your team, and setting up the file on everyone ones machine, I would recommend the following pattern:
Open / Check out file from TFS
If the code needs to be cleaned up, run code clean up
Check In the code that has been cleaned up
Check out the code again
Make edits
If you don't check in the code in until after you have cleaned it up and made your edit, the diff is very hard to tell what was changed.
You will have to get the buy in from your team to start running code cleanup. Either that or Code Cleanup is supported on a folder, project, and solution level, so you could just open all of the solutions and clean the up yourself.

Related

How to create a free tfs server easily [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
So, I want to share my DLL pack code and be able to collaborate in real time with a friend :) but I don't know how to upload my .sln file to the free tfs server. can can anyone help? Did some research, and couldn't find how :(
I am a bit unsure about if you already have a TFS server or not. So I included a link right below here where to get one if you don't.
Go to https://www.visualstudio.com/team-services/ if you wanna use free TFS.
This is a very easy way to do this, as I assume you never done this before. But if you done some research you should know the Team Explorer in Visual studio
Create a project in your TFS and Go into your Visual Studio and connect
to your TFS
"Map and Get" to a location on your computer. It will
created a folder where you can decide what you want to add to your
TFS Project(It should ask you when you connected, but if not you can
find it Source Control Explorer)
Add your solution into that folder
If you go into Pending changes you should now have some "Detected
add(s)" in the bottom at exclude changes. You wanna click on that
and include all the files you want to share.
Now your friend can do the first 2 steps and also have the same solution and stuff as you.
If you decide to use Git by any chance, is kinda the same process, just different names.
If you need more details on this, feel free to throw a comment. However if you done some basic research into this and already been playing around. There should be no issues at all. There are hundred of videos on youtube about TFS, How to set it up and much more.

Dynamic Development in ASP.NET 5 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
ASP.NET 5 is available as a preview release with Visual Studio 2015.There is a new feature called Dynamic Development, that mean we don't have to compile our code whenever we make changes. Now my question are,
1)What are the other benefits of dynamic compilation.
2)Beside ASP.NET What other framework use Dynamic compilation.
3)Do we still need Build and Rebuild option?
Thanks
There is a new feature called Dynamic Development, that mean we don't
have to compile our code whenever we make changes.
It's important not to misunderstand that we don't have to compile our code at all when we make changes. Dynamic compilation only comes into play when debugging, making development more efficient as we can make code changes without recompiling first.
As for your questions:
1) That's whole the feature, I don't think there's more to it.
2) You can do something similar WPF and Win Forms (not sure about any others), but only while stepping through code with the debugger.
3) Build and Rebuild aren't going anywhere and are needed. They're used when compiling code at compile time. Dynamic Compilation is for compilation during runtime (2 different things)
Have a look at this article from Scott Guthrie under Dynamic Development, can't say it simpler than that.

My computer lost power while working on a project, how can I recover my data? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I was working on a c# project on my computer when I accidentally removed the power cord.
When I started my computer back up I tried to load my project, but I got a error:
There is no editor available for 'c\user\documents\visualstudio 2013\projects\project_name\from1.cs
make sure the application for the file type(.cs) is installed
On the same project I have different forms and those still work, only from1 is not working. The data set only contains 0's.
What can I do to fix this?
Either something got corrupted in your Visual Studio installation, or (more likely) the file you were working on before your computer was shut down (which I assume was from1.cs).
Are you able to open from1.cs and from1.Designer.cs in something like Notepad? You may want to look for NULL terminators in your file as suggested by this answer on this (possibly duplicate) question.
If that doesn't work, either try copying the existing code from from1.cs and from1.Designer.cs into new files in your project, or repairing/reinstalling Visual Studio. Just make sure to make a backup of your project first, just in case! ;)

soft stoppped working [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
this is might be really weird, but I have no idea what kinda wizardry of this. Basically, my Visual Studio stopped responding to my changes, it stopped building solution. I can comment code, which would completely ruin the logic of program, and Visual Studio will still run program that I guess it has in memory. It's really annoying, and I have no idea what it is. I keep restarting software, but it's still does the same. It's a licensed software. I was wondering If someone knew what was going on. Thanks!
I've seen this a few times, and usually one of or a combination of the following will work:
Clean the solution, then build it.
Change the from "Release" to Debug (or vice-cversa) then clean and build, then revert back.
Close visual studio and manually delete everything in the \bin directory
For an asp.net website, close visual studio and delete the files in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files (Path will vary depending on your machine setup This is where my ASP.NET versino 4 files are compiled to.)

What is the best way to learn a new library written in C# using Visual Studio 2010 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I recently found the need to learn a new library that didn't come with extensive documentation for a change. The code is written in C# and I am using Visual Studio 2010 as my editor. The library that I am trying to learn did come with a sample driver, but it is fairly large and complex as well. I was wondering if there are any facilities in VS that would allow me to watch the code as it is executing so that I learn as it runs.
Is anyone aware of any tools that I should be looking at in VS and additionally, in general can you specify any other methods that I might use to quickly learn how to use new libraries.
Thanks
Write learning tests.
Red Gate's Reflector is a must have for looking into 3rd party library's and there are a couple plugins for it (FileDisassembler is one) that allow you to save your dissasembled files so that you can step through the code.
You can set a BreakPoint at any line you you want the program to stop at, and when you run it in debug mode, you will then be able to execute a single line of code at a time, by pressing F11 or F10 (F10 does not go deeper into inner function calls).

Categories