Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Sunday, October 2, 2016

create solution from project files in Visual studio 2015




Wednesday, April 6, 2016

visual studio column select editing

hold down SHIFT + ALT while dragging the mouse pointer over a block of text you wont select the entire rows of text that you have dragge

http://joelabrahamsson.com/select-columns-of-text-in-visual-studio/

Wednesday, March 23, 2016

Visual studio editor collapse code ctrl-m + M, H, O, A, X, L



http://stackoverflow.com/questions/982677/visual-studio-command-to-collapse-all-sections-of-code

CTRL + M + M ------> Collapse / Expand current preset area (e.g. method)
CTRL + M + H ------> Collapse / Hide (Expand) current selection
CTRL + M + O ------> Collapse all(Collapse declaration bodies)
CTRL + M + A ------> Collapse all
CTRL + M + X ------> Expand all
CTRL + M + L ------> Expand all.

CTRL + M , P will expand all and disable outlining.

Monday, December 14, 2015

configuration transform extension for app config file

https://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5

https://visualstudiogallery.msdn.microsoft.com/579d3a78-3bdd-497c-bc21-aa6e6abbc859/view/Reviews/0?showReviewForm=True

Wednesday, November 18, 2015

How do you auto format code in visual studio?

http://stackoverflow.com/questions/5755942/how-do-you-auto-format-code-in-visual-studio

For Visual Studio 2010 or newer
To format a selection: CTRL + K + F
To format a document: CTRL + K + D
See more in edit -> advanced menu
Source/more information see here...

Monday, July 27, 2015

Show visual studio output window

The Output window does not appear on the View menu in Visual Studio Express editions. To bring it up, use the hotkey CTRL + ALT + O.

Saturday, July 18, 2015

change actionlink color

<td>
                @Html.ActionLink("Details", "Details", new { _id = item._id }, new { style = "color: #000"}) |
                @Html.ActionLink("Register", "Register", new { _id = item._id }, new { style = "color: #000" })
            </td>
        </tr>

Thursday, July 9, 2015

.webinfo file needed when Can't open my VS2003 project: The project you are trying to open is a Web project. You need...

Re: Can't open my VS2003 project: The project you are trying to open is a Web project. You need...

Mar 05, 2007 12:44 PM|LINK

    <Web URLPath = "http://localhost/Folder/fred.csproj" />
Folder is the application name of the  in the IIS manager website properties
ex. xyzService is the application name


VB.net

<VisualStudioUNCWeb>
    <Web URLPath = "http://localhost/xyzService/xyzServices.vbproj" />
</VisualStudioUNCWeb>




To fix this error all you need to do is add a webinfo file.  If your using VSS for source control, it's probably a good idea to add the webinfo file to SourceSafe as well as this is not done for you automatically.
If you have a project file c:\Inetpub\wwwroot\Folder\fred.csproj then you need a corresponding webinfo file fred.csproj.webinfo.  The contents of the webinfo file looks like this:
<VisualStudioUNCWeb>
    <Web URLPath = "http://localhost/Folder/fred.csproj" />
</VisualStudioUNCWeb>
When you go to add this web project to your solution file you actually don't specify “Add Existing Project From Web”, but simply “Add Existing Project”, then browse to c:\Inetpub\wwwroot\Folder\fred.csproj

SetSite failed for package [JavaScriptWebExtensionsPackage]

Depends on which version of visual studio

C:\Users\[user]\AppData\Roaming\Microsoft\VisualStudio\1x.0\ActivityLog.xml

In order to fix the issue one needs to clear the VS cache under:
%LOCALAPPDATA%\Microsoft\VisualStudio\1x.0\ComponentModelCache

Wednesday, July 8, 2015

Replace code one line with multiple lines

https://visualstudiogallery.msdn.microsoft.com/699ce302-b0d4-4083-be0e-1682e873cebf

Thursday, June 25, 2015

ERROR: Failed to backup website http://localhost

ERROR: Failed to backup website http://localhost/....

just delete that project from solution and added it back from the correct file folder.


Thursday, May 28, 2015

unit test private methods by creating private accessor

http://stackoverflow.com/questions/250692/how-do-you-unit-test-private-methods
It might not be usefull to test private methods. However, I also sometimes like to call private methods from test methods. Most of the time in order to prevent code duplication for test data generation...
Microsoft provides two mechanisms for this:
Accessors
  • Goto the class definition's source code
  • Right-click on the name of the class
  • Choose "Create Private Accessor"
  • Choose the project in which the accessor should be created => You will end up with a new class with the name foo_accessor. This class will be dynamically generated during compilation and privides all members public available.
However, the mechanism is sometimes a bit intractable when it comes to changes of the interface of the original class. So, most of the times I avoid using this.
PrivateObject class The other way is to use Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
// Wrap an already existing instance
PrivateObject accessor = new PrivateObject( objectInstanceToBeWrapped );

// Retrieve a private field
MyReturnType accessiblePrivateField = (MyReturnType) accessor.GetField( "privateFieldName" );

// Call a private method
accessor.Invoke( "PrivateMethodName", new Object[] {/* ... */} );

Wednesday, May 6, 2015

DataBinding: does not contain a property with the name

DataBinding: 'Microsoft.SharePoint.SPListItem' does not contain a property with the name


http://jatindersingh.blogspot.com/2009/09/databinding-microsoftsharepointsplistit.html

Tuesday, May 5, 2015

visual studio on Mac

https://code.visualstudio.com/

run visual studio on mac

http://stackoverflow.com/questions/413820/visual-studio-on-a-mac


http://www.parallels.com/products/desktop/

Lots of people are talking about Parallels and VMWare Fusion, but I didn't see any mention of the other methods I've used to good effect.
  1. Visual Studio via Remote Desktop - I have a laptop running Windows/Visual Studio with a static IP and use the Microsoft Remote Desktop client to connect from my Mac. This has the advantage of minimal overhead on the Mac, so is more responsive than a VM. However, it has the obvious disadvantage of requiring a second machine running Windows and Visual Studio. If you're running Windows Server 2008, as a bonus you can run RemoteApp to share just Visual Studio to your mac - very convenient.
  2. Virtual machine using VirtualBox - All the major features of a VM, except VirtualBox is free. I've used VMs with VMWare Fusion, Parallels and VirtualBox and I have to say I find performance to be pretty much even across all three. Parallels tended to drive my CPU harder than the other two but the actual VM responsiveness was fine. VirtualBox also has Seamless mode, essentially similar to Parallel's Coherence mode, but less integrated into the Desktop. I use this every day to run a Windows-only application on my Mac and it works great, sharing only the window for that application instead of running a full Windows desktop.
  3. Boot Camp - depending on your needs, running Boot Camp with Windows installed as a dual-boot OS will of course offer the best performance but with the downside of running Windows ;)

Thursday, April 23, 2015

In Visual studio text editor to switch text to upper case or lower

To switch text to upper case

  1. Select the text you want to convert.
  2. On the Edit menu, select Advanced.
  3. To convert text to all upper case, choose Make Uppercase, or press CTRL+SHIFT+U.
    — or —
    To convert text to all lower case, choose Make Lowercase, or press CTRL+U.

Sunday, April 19, 2015

.js file could not have @url.action




Not sure why, if I put the function in a js file, then VS 2013 does not like it. But you see on the left side if I put in a view file, then it is OK.