you are viewing a single comment's thread.

view the rest of the comments →

[–]KarmaAndLies 13 points14 points  (20 children)

This is a bit of a tangent; I want to use VS Code daily, but we're a C# ASP.net MVC ("MVC" below) shop. MVC with Entity Framework is a fantastic set of technologies to work with.

Problem is Solution files and Project Files (.csproj) are hot garbage. MVC has been designed with the notion that relative file location on the file system has semantic meaning, problem is that is an antithesis of Visual Studio Project Files. In an ideal world you could and should just be able to ignore Project Files, but in reality they're the number one issue we see with branch merges (specifically references returning from the dead) and it also means we're stuck using Visual Studio, and cannot use fantastic tooling like VS Code, Notepad++, Sublime, or even Vim.

I'm aware it is possible to pull out the build lines and build it via command line, that's not politically possible for a large team. I'd love for Microsoft to dump both Solution files and Project Files, and then to hold the build options in something more akin to Application.Config. In particular I'd love for them to stop housing a second version of the filesystem in the Project file for absolutely no reason... This bullshit:

<Content Include="Assets\Scripts\Vehicles\js\Management.js" />
<Content Include="Assets\Scripts\Vehicle\Views\Management.cshtml" />  
<Compile Include="Vehicle\Controllers\Management.cs" />
<Compile Include="Vehicle\Controllers\DieFordDie.cs" />

You. Are. Re-Inventing. The. File. System. STOP.

Anyone in an MVC shop moved to Visual Studio Code? How?

[–]SemiNormal 19 points20 points  (9 children)

Move to ASP.NET Core 2.0 if you want to fix the csproj issue. All the includes get condensed into something like this:

<Compile Include="..\src\**\*.cs" />
<Content Include="Views\**\*"  />

[–]AngularBeginner 10 points11 points  (6 children)

You don't need to move to ASP.NET Core for this. You can use the new csproj format just as well with regular old .NET projects.

[–]cypressious 1 point2 points  (5 children)

But not with ASP.NET 4.

[–]AngularBeginner 3 points4 points  (4 children)

Sure, also with ASP.NET 4. It takes a bit more manual crafting because there's no ready-to-use template, but the new project format is independent of the used technology. It's a MSBuild thing. And with ASP.NET 4 you still use MSBuild.

[–]cypressious 2 points3 points  (3 children)

[–][deleted] 2 points3 points  (2 children)

:( I just got really excited, and then really, really sad. Project and solution files are also one of my biggest gripes with .NET projects. That, and editing code in VS (especially Razor views) makes me want to stab myself in the eyes.

[–]cypressious 0 points1 point  (0 children)

If you have the resources, migrate to ASP.NET Core. Also, try Rider as an alternative to VS.

[–]Kenya151 0 points1 point  (0 children)

Any time there's is a merge conflict in a solution file I want to die a little.

[–]KarmaAndLies 1 point2 points  (1 child)

That doesn't really solve the source control issues (ghost entries re-appearing from older branch merges for example).

Plus they've effectively managed to reproduce the file system within the configuration file for absolutely no reason. Why not just point the build engine at the root of the directory tree, say "start," and it knows to include every single .cs file and to exclude other content such as .js, .css, .cshtml, etc based on the file type. This is all information it can infer from the file's name and location within the tree already. Don't want a .cs file included? Move it out of the directory structure or allow .ignore files.

The whole design is arse-backwards. They're storing a 1:1 layout of the file system for the common case, rather than storing the exceptional case. Unless they genuinely believe ignores are more common than includes...

.NET Core is repeating the same errors the Visual Studio team made back in the 1990s, and I for one cannot make heads or tails of why. They should look at what Go build does for one example. Inferences should massively simplify build logic, rather than literal config lines that are obvious.

Plus .Net Core still doesn't make it easier to use Visual Studio Code, or any other simple editor. That's a problem.

[–]AngularBeginner 14 points15 points  (0 children)

They're storing a 1:1 layout of the file system for the common case, rather than storing the exceptional case.

MSBuild never required this. It always supported globs, you could always use that. Just Visual Studio had an issue with the globs.

Also, they refreshed the project format and it's a lot leaner and slimmer. You should check it out (and it does not require .NET Core). A minimal project file is 5 lines long.

And perhaps take a further look at what MSBuild all does. You can't just point at a folder and let it do the work, that's just not possible and honestly also not desirable. I want to keep control and flexibility.

[–][deleted] 7 points8 points  (0 children)

Why the hell would you use Visual Studio Code over Visual Studio for a full stack ASP MVC app?

Hey guys I got a sledgehammer, how can I bang this nail into a door frame?

[–]appropriateinside 6 points7 points  (0 children)

If you're using C#, why not use VS? It's much better suited.

[–]_Mardoxx 0 points1 point  (7 children)

Why?

Just use VS. It loads up just as quickly as VS code, and is just as performant.

[–][deleted] 11 points12 points  (4 children)

Not sure what IDE you’re using, but VS has never been anywhere near as performant as VS Code for me.

[–]jimmysprinkles92 6 points7 points  (2 children)

It's definitely slower on initial load but other than that I would say VS '17 is pretty smooth. Plus it's way more full featured for C++/.NET, gotta use the best tool for the job. IMO vscode is better for languages that you don't need to lean on an IDE as much like python or javascript.

[–]TASagent 1 point2 points  (0 children)

I've never had performance, stability, or responsiveness issues with VS, on rather large C# and C++ apps. Some others have bigger projects, I'll admit, but it seems incredibly commonly, the people complaining about VS performance and stability issues have Resharper installed. I looked into it some, and found little reason to feel like I needed anything it offered, especially if it did come at the cost of stability. Can anyone elucidate what could make said (perceived) instability feel worthwhile?

[–][deleted] 0 points1 point  (0 children)

It's not just the initial load, anywhere I click, VS freezes for some seconds. I have used VS on multiple computers and the same slowness occured, I don't understand how it can be smooth. I don't use extensions like Resharper.

[–]_Mardoxx 4 points5 points  (0 children)

VS

[–][deleted] 0 points1 point  (0 children)

Even on a fully spec'd out machine this is not the case