New Visual Studio Solution Tutorial

From Species File Help
(Difference between revisions)
Jump to: navigation, search
 
(12 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
1. First create a new workspace. To do this correctly, Visual Studio must have been closed with no solutions open. Having a solution automatically open when Visual Studio is opened sets a default workspace. To properly set the workspace in step 2c  you must not have an existing default workspace.
 
1. First create a new workspace. To do this correctly, Visual Studio must have been closed with no solutions open. Having a solution automatically open when Visual Studio is opened sets a default workspace. To properly set the workspace in step 2c  you must not have an existing default workspace.
  
Open the “Manage workspaces” window (from the Source Control Explorer or Pending changes window).
+
* Open the “Manage workspaces” window (File->Source Control->Workspaces or from the Source Control Explorer or Pending changes window).
+
** In the Source Control Explorer or Pending changes window look for the drop down list to the right of Workspace:, go to the bottom select workspaces …
In the Source Control Explorer or Pending changes window look for the drop down list to the right of Workspace:, go to the bottom select workspaces …
+
* A window pops up showing you all the workspaces on your machine and will look similar to this image  
 
+
A window pops up showing you all the workspaces on your machine and will look similar to this image  
+
  
 
[[File:Image003.png]]
 
[[File:Image003.png]]
  
Add a new workspace. Make sure to pick different names for the the workspace and the solution. This will make it easier to debug if there is a Visual Studio problem later. I use <version> <SF name> for my workspaces and <SF name > <version> for my solutions.   
+
* Add a new workspace. Make sure to pick different names for the the workspace and the solution. This will make it easier to debug if there is a Visual Studio problem later. I use <version> <SF name> for my workspaces and <SF name > <version> for my solutions.  Note that "server" is not changeable. It is the location of the source control server, NOT the location of the web server.
  
 
[[File:Image005.png]]
 
[[File:Image005.png]]
Line 23: Line 21:
 
[[File:Image007.png]]
 
[[File:Image007.png]]
  
2. Now create a new solution. (File New Project) Under “Other Project Types” select “Visual Studio Solutions” and “Blank Solution”.  
+
2. Now create a new solution. (File &rarr; New &rarr; Project) Under “Other Project Types” select “Visual Studio Solutions” and “Blank Solution”.  
  
  
Be sure to rename the solution now
+
* Be sure to rename the solution now
  
• The new solution should appear in the Solution Explorer and be empty.  
+
[[File:Image008.png]]
  
 +
* The new solution should appear in the Solution Explorer and be empty.
  
• Add the first project. (Normally the file specific project). (File  Source control  Add project from source control. If the workspace is greyed out when you are adding your first project, there was a default workspace already set. (Most likely because there was a solution open when you last closed Visual studio). Close and delete this new solution, close and re-open Visual Studio and start over at step 2. If you have correctly created your solution, select the correct vbproj  or dbproj file. The local file path will be automatically set by the selection of the correct workspace.  
+
[[File:Image010.png]]
  
 +
* Add the first project. (Normally the file specific project). (File &rarr; Source control &rarr; Add project from source control. If the workspace is greyed out when you are adding your first project, there was a default workspace already set. (Most likely because there was a solution open when you last closed Visual studio). Close and delete this new solution, close and re-open Visual Studio and start over at step 2. If you have correctly created your solution, select the correct vbproj  or dbproj file. The local file path will be automatically set by the selection of the correct workspace.
 +
 +
[[File:Image011.png]]
  
 
• After creating the solution and adding the first project from source control. Your Solution explorer should have an expanded view of the added project with the project highlighted. Before adding your next project, be sure you have selected your SOLUTION. If you accidentally add a project while the previous project is selected. Delete the solution and create a new one. It is very difficult to detangle the solution. (To delete a solution you will need to go the directory where you have stored your Visual Studio solutions and delete it from there.)
 
• After creating the solution and adding the first project from source control. Your Solution explorer should have an expanded view of the added project with the project highlighted. Before adding your next project, be sure you have selected your SOLUTION. If you accidentally add a project while the previous project is selected. Delete the solution and create a new one. It is very difficult to detangle the solution. (To delete a solution you will need to go the directory where you have stored your Visual Studio solutions and delete it from there.)
  
 +
[[File:Image013.png]]
  
 
• Keep adding projects until all the necessary projects have been added. After the first project has been added to a solution, you will no longer be able to select a workspace. There is only one workspace associated with a solution. If you can not add a project because there is no local path found, it means you forgot to add that project to your workspace. Go back and edit the workspace adding the missing project and then return to adding projects to your solution. You do not need to start over for this error.  Be sure to select the solution again after each project is added!   
 
• Keep adding projects until all the necessary projects have been added. After the first project has been added to a solution, you will no longer be able to select a workspace. There is only one workspace associated with a solution. If you can not add a project because there is no local path found, it means you forgot to add that project to your workspace. Go back and edit the workspace adding the missing project and then return to adding projects to your solution. You do not need to start over for this error.  Be sure to select the solution again after each project is added!   
  
 +
[[File:Image015.png]]
  
 +
[[File:Image017.png]]
  
 
3. Now that your solution has been created, you must set the properties for it and each project it contains.  
 
3. Now that your solution has been created, you must set the properties for it and each project it contains.  
 
Right click on on the Solution. Go to the Bottom and select properties. The important solution properties are:
 
Right click on on the Solution. Go to the Bottom and select properties. The important solution properties are:
 
• Single startup project.  
 
• Single startup project.  
 +
 +
[[File:Image019.png]]
  
 
• Project dependancies – Files specific on common, common and SQL on nothing.  
 
• Project dependancies – Files specific on common, common and SQL on nothing.  
 +
 +
[[File:Image021.png]]
  
 
• Configuration – do not build or deploy the SQL project.  
 
• Configuration – do not build or deploy the SQL project.  
 +
 +
[[File:Image023.png]]
  
 
4. Change and select the Specific project, right click, scroll to the bottom and select Properties.
 
4. Change and select the Specific project, right click, scroll to the bottom and select Properties.
Line 56: Line 67:
 
INCLUDE generated debug symbols, and  EXCLUDE files from the App_Data folder. SAVE
 
INCLUDE generated debug symbols, and  EXCLUDE files from the App_Data folder. SAVE
  
 +
[[File:Image025.png]]
 +
 +
• On the Web tab for the common project, select "Don't open a page" and the appropriate debuggers.
 +
SAVE
 +
 +
[[File:Image027.png]]
  
  
 
• No properties need to be edited for the SQL project.
 
• No properties need to be edited for the SQL project.
 +
 +
[[Category:Developers]]

Latest revision as of 09:30, 15 August 2012


Creating a new solution in Visual Sudio

Image001.png

1. First create a new workspace. To do this correctly, Visual Studio must have been closed with no solutions open. Having a solution automatically open when Visual Studio is opened sets a default workspace. To properly set the workspace in step 2c you must not have an existing default workspace.

  • Open the “Manage workspaces” window (File->Source Control->Workspaces or from the Source Control Explorer or Pending changes window).
    • In the Source Control Explorer or Pending changes window look for the drop down list to the right of Workspace:, go to the bottom select workspaces …
  • A window pops up showing you all the workspaces on your machine and will look similar to this image

Image003.png

  • Add a new workspace. Make sure to pick different names for the the workspace and the solution. This will make it easier to debug if there is a Visual Studio problem later. I use <version> <SF name> for my workspaces and <SF name > <version> for my solutions. Note that "server" is not changeable. It is the location of the source control server, NOT the location of the web server.

Image005.png

Select the source control folder and the local folder and fill in the comment with the contents of the workspace.

Image007.png

2. Now create a new solution. (File → New → Project) Under “Other Project Types” select “Visual Studio Solutions” and “Blank Solution”.


  • Be sure to rename the solution now

Image008.png

  • The new solution should appear in the Solution Explorer and be empty.

Image010.png

  • Add the first project. (Normally the file specific project). (File → Source control → Add project from source control. If the workspace is greyed out when you are adding your first project, there was a default workspace already set. (Most likely because there was a solution open when you last closed Visual studio). Close and delete this new solution, close and re-open Visual Studio and start over at step 2. If you have correctly created your solution, select the correct vbproj or dbproj file. The local file path will be automatically set by the selection of the correct workspace.

Image011.png

• After creating the solution and adding the first project from source control. Your Solution explorer should have an expanded view of the added project with the project highlighted. Before adding your next project, be sure you have selected your SOLUTION. If you accidentally add a project while the previous project is selected. Delete the solution and create a new one. It is very difficult to detangle the solution. (To delete a solution you will need to go the directory where you have stored your Visual Studio solutions and delete it from there.)

Image013.png

• Keep adding projects until all the necessary projects have been added. After the first project has been added to a solution, you will no longer be able to select a workspace. There is only one workspace associated with a solution. If you can not add a project because there is no local path found, it means you forgot to add that project to your workspace. Go back and edit the workspace adding the missing project and then return to adding projects to your solution. You do not need to start over for this error. Be sure to select the solution again after each project is added!

Image015.png

Image017.png

3. Now that your solution has been created, you must set the properties for it and each project it contains. Right click on on the Solution. Go to the Bottom and select properties. The important solution properties are: • Single startup project.

Image019.png

• Project dependancies – Files specific on common, common and SQL on nothing.

Image021.png

• Configuration – do not build or deploy the SQL project.

Image023.png

4. Change and select the Specific project, right click, scroll to the bottom and select Properties. The important project properties are: • On the Web tab for the file specific project under Start Action select Specific Page and set on Default.aspx, NEVER apply server settings to all users (you’ll mess up other people’s solutions) and select the appropriate debuggers. You may only need ASP.NET or you may need more types. On the Package/Publish Web page the default setting should be correct but should be checked. You want to


INCLUDE generated debug symbols, and EXCLUDE files from the App_Data folder. SAVE

Image025.png

• On the Web tab for the common project, select "Don't open a page" and the appropriate debuggers. SAVE

Image027.png


• No properties need to be edited for the SQL project.

Personal tools
Namespaces

Variants
Actions
Navigation
Species Files
Wiki
Toolbox