So, you have that “no exports were found that match the constraint” message in Visual Studio, eh?
The first thing I would try doing on the affected version of visual studio is to go to programs and features, select the version and pick change:
When that loads let it repair. Once it does see if that resolves the issue.
If it does not a more manual method that is to delete all of the contents of the ComponentModelCache folder from the following area (of which VS version is affected):
Put your username in the path:
It should look something like:
If that fails there is also a patch that they released in response: https://www.microsoft.com/en-in/download/confirmation.aspx?id=36020#
At some point in your early Sitecore career you will likely encounter the following error:
Perhaps you tried uninstalling and reinstalling Sitecore Rocks but still had the issue? Here’s what happened in my battle with troubleshooting.
So I finally went and found the Sitecore.Rocks.TemplateWizard.dll and copied it to:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies
If you have trouble finding where those assemblies are then look where the extension was installed. For me it was starting here
Once there I browsed the directories until I found it.
(Others I know have had to copy to Visual Studio 10 and 11 as well)
These steps did fix the issue and allowed the template wizard to run when creating a layout.
If you are still receiving other errors after this you may need to also bring in some other files. What was missing was a good number of other dlls:
- (and of course Sitecore.Rocks.TemplateWizard.dll)
After copying these out to the folder mentioned above and restarting Visual Studio, my issue was resolved. Hope that helps.
So I have been enjoying the benefit of Mike Smith’s article for a while now (http://techtrainingnotes.blogspot.com/2010/12/sharepoint-convert-links-list-to.html). A client I did a project for was wanting to carry this functionality forward to 2013. The problem: this method didn’t work in 2013.
- Created a links list and populated some URLs and Descriptions (!!! You need both for below to work, otherwise remove the description dependency in my code !!!)
- Create a SharePoint 2013 Visual Web Part project
- Add the dropdownlist control to the control
In the .ascx control I have:
<asp:DropDownList ID="linkDropDown" runat="server" Font-Names="Arial" Font-Size="10pt"
Width="300px" OnSelectedIndexChanged="linkDropDown_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true">
<asp:ListItem Text="Link to ..." Value="#"></asp:ListItem>
- Add the code to the code behind of the control
Now the code behind, here’s my using statements:
and here is what I have in the Page_Load and the SelectedIndexChanged event
protected void linkDropDown_SelectedIndexChanged(object sender, EventArgs e)
protected void Page_Load(object sender, EventArgs e)
SortedList sortedLists = new SortedList();
using (SPSite siteCol = new SPSite("http://mysharepoint2013site/"))
using (SPWeb web = siteCol.RootWeb)
SPList list = web.GetList("/Lists/NameOfLinksList");
SPListItemCollection items = list.GetItems();
foreach (SPListItem it in items)
SPFieldUrlValue fieldValue = new SPFieldUrlValue(it["URL"].ToString());
string description = fieldValue.Description;
string url = fieldValue.Url;
IDictionaryEnumerator enumerator = sortedLists.GetEnumerator();
ListItem listitem = new ListItem();
listitem.Text = enumerator.Key.ToString();
listitem.Value = enumerator.Value.ToString();
linkDropDown.Items.Add(new ListItem(listitem.Text.ToString(), listitem.Value.ToString()));
Deploy and enjoy!