How can I edit the ReSharper code cleanup profile without a license? - resharper

I am trying to use ReSharper's CleanupCode Command-Line Tool, which I believe can be used without a ReSharper license. That command-line tool accepts a --profile option. However, I can't figure out how to create a new profile.
The documentation says to use the ReSharper Options dialog in Visual Studio. But I can't seem to edit the profile on that window, presumably because I don't have an active Visual Studio license.
How can I create a new code cleanup profile without a ReSharper license? I assume this profile must be stored as a file somewhere. Is that file editable as text? Where are these files stored? Can anyone share a sample file?
(For context, I want to run the CleanupCode tool for a specific rule, which I think requires me to create a custom profile.)

Related

How to give entitlements to Applescript app

I have an application created in Omnis studio where I want the user to be able to press a button to open Microsoft Excel and then paste what is in the clipboard. To do that I have my application call an AppleScript app Seen here:
tell application "Microsoft Excel"
activate
make new workbook
paste special on worksheet active sheet
end tell
However whenever my application calls that script it runs into issues with apple's sandboxing saying that it can't send events to Microsoft Excel.
I read online that in order to get access to sending events in Mac OS you need to have a entitlements.plist file associated with your application. How would I add a entitlements.plist file to my Applescript app so that when it is run it is able to send events to Microsoft Excel?
If you do not sell the app and just use it for your own, best would be to deactivate sandboxing. Your app will still run by righclicking it > open.
If you already have sandboxing enabled there already must be a YOURAPPNAME.entitlements file inside your application structure (not in the compiled app, but in your source code) because sandboxing has to be enabled in that file.
I don't know Omnis studio, you may try using XCode instead which supports entitlements files from the scratch - even if you have to go with applescript objective-c instead of plain applescript.
if you manage to find that file you need to add a new key/value to it like so for addressing Excel:
key: "com.apple.security.temporary-exception.apple-events"
value (type array):
Item 0 > "com.microsoft.excel"
But watch out - if you want to stay in sandbox, from OSX 10.14 there's a new security policy called "security integrity protection" (SIP) by Apple where users also need to allow your app to automate other apps, checkout this thread: "because it is not SIP-protected" - Apple event error in OSX Mojave
To bypass this beginning from 10.14 you also have to add a new line to your info.plist file
key: NSAppleEventsUsageDescription
value: [Some description why you need to use AppleEvents]
I don't know if third party editors will follow the speed Apple provides in things of changes.
This is an older post, but why would you create an Excel file like that, if its just columns of data, just export a CSV file, that Excel can easily open...

Open custom user control in tool window using VS Package

I'm trying to create simple custom command (added in TOOLS menu option) to open the tool bar with custom control in VS 2013 using VS Package project.
I'm following https://msdn.microsoft.com/en-us/library/bb165987.aspx this guide but not sure why it's not working.
When I click on it, it opens tool window but without content under it. I want to show the MyControl.cs or custom control content under it.
I've tried a lot to find it out on Google but no relevent article found for same.
I've notice when I created new VS Package, it created "MyControl.xaml" file which loading it's data properly. I deleted that file and created new user control "MyControl.cs" which is not loading data.
Not sure if it requires VSIX project or VS Package. Is there any other way to do this?
Nothing in vsix development is simple at first. Try using this tutorial. It's from a series you can find here.
For you to show custom tool window content you have to extend the ToolWindowPane class and override the Window property returning your content as a IWin32Window. The tutorial fully explains it, and very well I might add, and the series is excellent even though it targets vs2010.

VS2012: show onle _one_ file in code review mode

I'm conducting a code review in VS2012RC using built in tool (TFS?)
There have been substantial refactoring done to the file, so diff is meaningless. I would like to see only new file (i.e. without diffs). Is there a way to configure code review view to see only one file?
The functionality you seek is implemented in alternative code review tool that is called Review Assistant.
It's an add-in for Visual Studio 2010 and 2012, and works with TFS.

Looking for a good resource for building a SP 2007 WSP package in Visual Studio 2010

I have an event handler feature that I've built for sharepoint 2007 and have deployed by moving the DLL to the GAC and creating Feature.xml and Elements.xml in the necessary folder and then installing them using the stsadm commands. I'm looking to avoid doing all this and instead have a WSP file that I can run to install the feature automatically in a production environment.
Thanks
Here's how I would proceed to convert your unmanaged items into a managed solution package in Visual Studio 2010:
Create an "Empty SharePoint Project".
Set the deployment target. In Solution Explorer, click the project node and look at the Properties pane. Set the Assembly Deployment Target property between GlobalAssemblyCache and WebApplication. In this case, we'd leave it as the default GlobalAssemblyCache.
Note also there's a handy property called Include Assembly In Package. This is used to exclude your default project assembly from the output package. Why do you need this? If your project contains no code: for example, you're just bundling up some third-party DLLs for deployment.
Replace your SharePoint DLL references. Follow the steps in Adam Macaulay's article to remove the v14 DLLs and add back the v12 DLLs.
Add an Event Receiver item. Right-click your project and point to Add > New Item... and select "Event Receiver". Give the event receiver a proper name and click Add.
Configure the Event Receiver. Visual Studio will connect to your (2010) SharePoint instance, then prompt you with a wizard to walk you through what events you want to handle and for which item types. The end result is an Event Receiver item in your solution with a stubbed-out class that overrides the proper methods, as well as an Elements.xml file that is configured appropriately. If you have both of these files already, you don't really need to complete the wizard "truthfully"... just select the first option, click Finish and let Visual Studio create the Event Receiver and corresponding Feature.
Add your code logic. In Solution Explorer, expand your Event Receiver node to reveal the .CS class and the corresponding Elements.xml. Copy the contents of your existing files into those locations.
Configure the package feature. In Solution Explorer, expand the "Features" node and locate the default feature (Feature1.feature). This was created when you added the Event Receiver item. For clarity's sake, rename the feature to something logical, then double-click it to open the feature in design mode. You should see your Event Receiver has already been added to the right-most pane ("Items in the Feature"). Were there others, you could selectively add/remove items from the feature. Here is the place you set the feature scope between Farm/Site/Web/WebApplication.
Also importantly, while in the Feature designer, notice the Properties pane has a wealth of additional options to set on the Feature. These can't be accessed any other place, so keep in the back of your mind that is where to find them.
Lastly, if you click the Manifest tab at the bottom of the designer, you can preview what the feature manifest will look like. The manifest can be manually edited if need be (effectively disabling the designer), but I have yet to find something I need to do that I can't configure via properties.
Configure the overall package. In Solution Explorer, expand the "Package" node and locate the default package (Package.package). Just as for features, double-click the package to open it in design mode. This is the same UI that features use, allowing you to pick which features will be part of this package. Your event receiver feature should already be added to the right-most pane ("Items in the Package").
Again, same as features, while you're in Package design mode, the Properties pane will make available certain properties that can't be edited elsewhere. Most notably, it is here you should clear the value out of SharePoint Product Version.
Also, we have the same manifest preview available to us via the Manifest tab at the bottom of the screen. This is handy for checking things like SafeControl entries (if you need them) and the like. The Assembly entry should reflect the correct deployment target (in this case GlobalAssemblyCache) that was set on the project.
Finally, the Advanced tab allows you to specify additional assemblies/SafeControl entries to the package, which is helpful if you're bundling up additional DLLs to the default project DLL.
Build your project. Obviously we want to make sure it compiles!
Test the deployment. When I test, I deploy to my 2010 instance first (because it's handy) and double-check that everything has been installed as I expected: DLL in the correct place (BIN/GAC), appropriate Web.config entries created, feature installed at the right scope, feature activates properly, etc.
Package the solution. Point to your Build > Package menu item. The WSP will be placed in the appropriate output folder for the active configuration. Test deploy to your SharePoint 2007 instance.
Check out "Build a SharePoint 2007 Web Part with a Visual Studio 2010 Visual Web Part Project" written by Adam Macaulay. I used this as a reference when I wanted to do the same, and the methodology works great. I've successfully converted a lot of our Visual Studio 2008 projects to 2010 projects, while maintaining compatibility with SharePoint 2007 environments.
I will make one suggestion: if you don't absolutely need the Visual Designer for your web part (i.e. your web part's output is made programmatically), then using the Visual Web Part template adds extra "junk" to your solution which I dislike.
Rather, in step 1 create instead an "Empty SharePoint Project", then right-click on your Project in the Solution Explorer and point to Add > New Item... and select "Web Part" (not "Visual Web Part"). You don't end up with the ASCX control and you can ignore the parts of Adam's tutorial that deal with updating the Register declarations.
This also has the added benefit of capturing the correct name for the web part files up front, so you don't have to rename a bunch of "VisualWebPart1xxx" files.

how do I mark a file as a data file in a visual studio 2010 vsto clickonce application?

I'm making a Word 2007 add-in with C# 4.0 in Visual Studio 2010. I need an Access 2007 database (a .accdb file) to be placed in the data directory by the clickonce installer. Unfortunately, the file is getting put elsewhere, so the application can't find it at runtime. I've seen various articles refer to using the Application Files dialog on the Publish tab of the project properties to mark the file as a data file, but I have no Application Files button for some reason.
Any idea how to make the Application Files dialog appear, or some other way to manually mark my .accdb file as a data file?
In the Solution Explorer, if you set the file's property to be Copy to Output Directory = Copy Always. Then when you go to Application Files they should default as a Data File.
However, since this is your database I would consider looking at make it safe across updates so you might consider this post.
See http://msdn.microsoft.com/en-us/library/dd465298.aspx
By the way, "Application Files" button should be on the project properties' Publish tab.
VSTO Applications do not have the Application Files button available, and you can't set the file types specifically. If your file is not being deployed to the data directory and you want it to be, rename it with a file extension that is marked by ClickOnce as data. This includes .xml, .mdb, and .mdf. Otherwise, the file is deployed with the VSTO application and will be in the same location as the rest of the files.
The location of the deployment files for a VSTO application can be discovered programmatically this way:
System.Reflection.Assembly.GetExecutingAssembly.CodeBase
You might want to move the database, though, because unless you deploy it as data, it will be lost when an update is performed. Or you can check out this article about where to put your data to keep it safe from ClickOnce updates.
I was able to get things to work by using the Mage tool as described here:
http://msdn.microsoft.com/en-us/library/6fehc36e.aspx
The trick with MageUI is it's open file dialog assumes you want to open a manifest associated with a .exe; a vsto project has a .dll, so the manifest doesn't appear in the files list by default, which was really tripping me up.
Basically, this process is a pain because you have to remember to do it manually. I don't know if there's a way to make this part of the build (maybe a post-build step? But this is really a post-publish step).

Resources