Can ReSharper properly parse SharePoint layouts? - visual-studio-2010

I am creating a SharePoint 2010 feature in Visual Studio 2010.
While ReSharper is a valuable tool for writing code, it reports lots of errors (all server-relative image references, master page reference, ContentPlaceHolderID's referring to the master page and so on) in .aspx layout definitions. I had to exclude the master page from ReSharper completely, as it was hanging the VS process - however, the errors were reported before as well.
Is there a 'clever' way of configuring it to correctly parse those files?

As mentioned earlier, R# has offers no support for SharePoint Application- and MasterPages. The issue is because SharePoint is using an other approach to reference assembies and because of the SharePoint specific implementation of the ASP.NET virtual path provider. So R# isn't able to locate all the required dependencies which are required to render an entire SharePoint site.
JetBrains will have to reproduce the SharePoint Designer behavior.
Thorsten

ReSharper 7 (still in beta) supports SharePoint now. ReSharper 7 understands SharePoint-specific master pages, resources, style sheets and JavaScript files.

Related

How do I view GitHub issues from within Visual Studio 2022?

How do I view and integrate with GitHub issues using Visual Studio 2022?
When connected to an Azure Repo, the VS Team Explorer window includes a "Work Items" view that shows open issues from Azure Boards. I can easily create a branch from one, link it automatically, and submit pull requests. The integration is great.
When I connect to a GitHub repository, that integration is lost. The Team Explorer window no longer contains a "Work Items" view. Since I can't view the issues, I can no longer automatically create branches that are linked to the issue. I have to now manually type in the issue number if I want to link a commit to the issue. And the "Create Pull Request" menu items simply launches the browser to the GitHub page; there's no integration there, either.
I have found a VS Code blog post that enables a lot of this functionality (and more) into VS Code, but I've yet to find anything for Visual Studio 2022. From that post, I am most interested in the "Working on issues" bit. As described above, this was functionality that worked with Azure Repos but is lost with GitHub integration. How might I regain that functionality with GitHub and Visual Studio 2022?
The "old" team explorer did a number of really nice things, but it was also very hard to integrate into for other tool vendors. With the new Git experience the Visual Studio team opted for a more agnostic approach.
The old Team Explorer was written in .NET 4 and was very much geared towards integrating with Azure DevOps. It stems from 2005 when Team Foundation Server first got released. Over time other vendors snuck their way into Team Explorer, but mostly through undocumented and unsupported ways. This has caused many interesting issues in the past. The concept of the Team Explorer window also wasn't ideal for hosting GitHub, Azure DevOps, BitBucket and every other tool-vendor that wanted to be listed and there was very little in the way of control for users to set the order of elements or hide certain tiles. As such it's a breeding ground for bugs and it needed to be ported to .NET Core and x64 and to support out-of-process extensibility to properly support Visual Studio 2022 anyway.
So Team Explorer and its old undocumented extensibility points were dropped and the new Git Window was born. This window is a pure git client and it's vendor agnostic. Vendors may add menu items to the top level menu, but they currently can't extend the new git window.
At the same time, Visual Studio 2022 dropped support for the built-in browser window, which was a memory hog, loads IE11 and also needed full retooling to support the x64 out-of-process loading that Visual Studio 2022 now demands.
All of this work now allows Visual Studio to use more memory, it's faster and by moving extensions out-of-process, it has greatly improved the performance and stability of the visual studio platform. Unfortunately this all happened at the expense of some features.
The new git experience is no longer constrained by the Team Explorer window, is a top-level citizen in Visual Studio and can finally use easier to remember keyboard shortcut keys. It's much faster too and the new architecture allowed the team to build interactive rebase, multi-repo support, submodule support and more. But their priorities have been in advanced git scenarios for a long while, not in building support for vendor specific issue integration. It looks like that may be changing though. Auto-completion of #... is now in Visual Studio 17.5 preview:
Some tool vendors may invest in native integration into Visual Studio in the future. Many old extensions are no longer available in VS2022 or the authors are still working on a new version that conforms to the new requirements.
On the other hand you have VS Code, which is used by GitHub itself internally, runs in a browser, powers github.dev and github codespaces and doesn't carry the legacy if Visual Studio 2022. It's not Microsoft, but GitHub who has extended vscode and they added the support for their platform through extensions and open source contribution to the editor directly. GitHub has a different stake in vscode, they have the engineering staff that knows how to extend atom-based applications (they basically built that technology) thus, their features have been added to vscode.
Is it fair? Do we want it in big VS as well? Sure, but unfortunately, that's currently not where the money is being spent.
There are a few ways to accomplish what you want. But none are exactly what you desire.
The web
The main way is to start working from the browser. On every issue there is a Development section from which you can create a branch or initiate a pull request from the associated branch:
You can then immediately check it out locally
Or navigate to the code panel for the branch and click the open in visual studio link. This will launch visual studio in the correct context using the repo you selected and will check out the branch locally for you to start working.
Any commits you make to this branch are automatically associated to the issue, so there's no need to pass in the #issuenumber every time.
The cli
An alternative to working from the browser is to use the CLI. If you have the GitHub CLI installed it will pick up the context of your repo from the list of remotes and you can perform quick commands straight from visual studio's built-in terminal.
gh pr create
to create a new PR.
gh issue list
to quickly list your open issues
gh issue develop #issuenumber
to create a branch on the remote, associate it to your issue and check out the branch locally.
It takes a bit of getting used to the commands, but if you like the CLI it's a quick way to work.
In Visual Studio
You can create pull requests from your current state, which will then bring you to the browser with most of the data pre-filled. Issue auto-completion also works in the browser from that point forward.
To get the other features you want, you must install extensions. Unfortunately, GitHub has stopped development on the old GitHub for Visual Studio extension since most of its features have now moved into visual studio. It's not easy to build and maintain an extension for multiple versions of Visual Studio, so I don't expect this will be brought back to life.
I rely on the Git Web links extension to quickly switch between web and visual studio from the context of my working files:
In the settings you can set the default behavior to not copy, but to open in browser.
Other functionality you're after is currently not available through a publicly listed extension. Most of there features have also been removed or deprecated for Azure DevOps itself, so I don't expect the Visual Studio team to be in a hurry to add first-class support for Issue tracking back in.
Unfortunately, the "Work Items" view and the related issue integration for GitHub Repos is not currently available in Visual Studio 2022 out of the box.
You might be able to find a Visual Studio extension that provides this functionality, but I'm not aware of any off the top of my head.
An alternative option would be to use the GitHub API to retrieve the issues, and create a custom extension to display the issues in Visual Studio 2022. However, this would require custom development work on your part.
It seems like the VS2022 will have this feature in future (it's in Preview now).
https://youtu.be/0NiHvdoMBO8?t=95 [VS2022 Preview Feature]

Visual Studio extensions keep disappearing

I am by no means a visual studio expert. However I have done some searching on this topic and cannot find anything to help me.
I'm working on a VS 2010 web application. We are using TFS 2012 for source control. I wouldn't be suprised if this is causing my issue so I make a special mention of it.
The issue I'm having is every morning after I open the project I have to go into Tools / Extension Manager and search online and add JScript Editor Extensions. When I open the project the next day it's gone and I have to add it again. (I think sometimes it does this right in the middle of coding - my Javascript window changes size and loses formatting)
An extension that stays every day regardless is NuGet package manager, so it's not removing every extension.
I suspect that when I get latest from TFS it's overwriting the solution or project which contains the reference to the extension but I haven't been able to verify this.
Can anyone tell me why extensions would be removed? Are these a local user setting or are they contained in the project file?
Taking a step back, my real problem is complete lack of integration between C# and Javascript in the web programming world. I need all the help I can get on the Javascript side.
There were a number of issues with buggy extension addins. To clarify are you using visual studio 2010 with tfs 2012 plugin?
The recommended process for identifying the buggy extension is to disable the extensions one at a time until the buggy one is isolated.
the source control shell for tfs2012 can be installed as a separate shell if needed.
I suspect the script editor extensions however.

What can WebMatrix do that Visual Studio 2010 Ultimate SP1 beta as an IDE can't?

I am seeing a lot of blog posts lately about WebMatrix. I don't read them because I tell myself "I have Visual Studio 2010 Ultimate with SP1 beta". The king of IDE's.
Just in case I am not missing on something important, as an IDE, is there anything that WebMatrix can do that VS 2010 can't do or does better?
Presently:
Access to the Application Gallery which I think is quite a nice feature. I like the way I can grab dasBlog or WordPress, do some edits and miscellaneous fiddling around, test then squirt the app up to the server. I think that's a killer feature for both beginners and experienced devs.
There's also task orientated site starter templates that Visual Studio 2010 lacks
Simplicity - with Visual Studio 2010 there's a lot going on in the UI, all sorts of "technical looking" project types. WebMatrix has one project type which is web projects.
If you have been using VS 2010 or even VWD 2010 and haven't been confused by them so far, you are not missing out on anything. WebMatrix is not intended for you. It has been designed to attract beginner developers, or those who know a little PHP or perhaps classic ASP and would like to try out ASP.NET.
It is primarily designed to make developing Razor Web Pages sites easy, with no clutter. No code complete, no Intellisense (well... except for the wrong kind of HTML Intellisense), no debugging, no compilation required (or possible), no wizards. Bare bones. Knuckle deep in HTML tags and inline code...
Actually, if you are anything like me, you are missing out on a lot of fun ;o)
I am not 100% sure that this is not in VS.net, but one thing I use in Webmatrix is the Reports feature that lets you run an analysis against your site to find common issues with the site like SEO and accessibility. I know this can be done using an IIS7 plugin, but not sure if it can be done directly in VS.net.
The other thing Webmatrix has is a nice interface to IIS Express that allows you to set settings and see requests to your development site in Webmatrix. VS.net 2010 sp 1 has IIS Express support but I haven't seen as nice an interface there.
Also, not too sure if this is not in vs.net, but when you create an SQL CE 4 database in Webmatrix it has a tool to migrate that database to normal sql server.
Finally, something subjective, Webmatrix has a simplicity to it that vs.net does not. VS.net is built for a developer to do anything and everything. It has a gazillion menus and options plus extentions, dockable windows and at least 4 distinct versions. Webmatrix is built just to create web sites. That simplicity lets you go from point A to Z very fast even if you don't know much about setting up web sites, databases or asp.net. It's one IDE where you know that every feature in it is expressly meant for you to create a web site.

Finding unneeded library references in Visual Studio

I seem to have gotten a bit carried away with the number of libraries I'm referencing in a ASP.Net MVC web application I'm working on. Is there any tools or features already built into Visual Studio 2008/2010 which indicates to me which references I don't need?
See this older SO question and answer.
Resharper will do this for you, with its clean code context menu.

Is it possible to add HTML5 validation to Visual Studio?

I'm working on a page using <canvas>, which is a HTML5 tag, in Visual Web Developer Express Edition 2008, and the validator in the HTML editor is telling me it's an invalid tag. That's because it's set to validate against XHTML 1.0 Transitional. I'd prefer for it to not do that and tell me what's valid or invalid based on the HTML5 doctype, but I can't find anywhere in the preferences that suggests this would be possible.
Is there a way to tell Visual Studio to validate against HTML5, or add a new spec reference manually? I'd prefer not to have to go in and add tags manually, which appears to be the only option at the moment.
It looks like the Visual Web Developer team solved the problem by adding HTML5 support themselves:
http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and-validation-schema-for-visual-studio-2008-and-visual-web-developer.aspx
You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements.
For Visual Studio 2010 you'll want to install the Web Standards Update for Visual Studio 2010 SP1:
It updates the HTML5 intellisense and validation to reflect the latest
W3C specifications and fixes some bugs bugs in the current SP1 support
for HTML5. Also JavaScript intellisense it updated to reflect many of
the new browser capabilities such as Geolocation and DOM storage.
Finally, this update adds comprehensive CSS3 intellisense and
validation based on the latest specifications from W3C.
For Visual Studio 2008, Microsoft has provided an updated version of the HTML 5 validation schema and intellisense in the Visual Studio Gallery.
HTML 5 Intellisense
The updated schema was posted by Mikhail Arkhipov, the same Microsoft employee who wrote the blog post linked in Rahul's answer.
I created a validation schema that you're free to use:
http://johndyer.name/post/2009/07/21/HTML5-XHTML5-Validation-Schema-for-Visual-Studio-2008.aspx
This is now included in Visual Studio 2010 SP1
You can define your own validation standards.
You need to add the file to the folder in VS install, and add to the registry.
This is the description I used (HTML and CSS have a very similar approach): http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/how-to-create-custom-css-intellisense-schema-in-visual-studio-2005-and-2008.aspx

Resources