There is a GUID generating utility bundled with Visual Studio. It is located in Microsoft Visual Studio 8/Common 7/Tools/Bin/guidgen.exe. Run the tool and select the format of GUID you want generated. Click on Generate a New GUID, and then click Copy to Clipboard to transfer the GUID for pasting into your application's code.
Change the extension on the file from .wsp to .cab, and the file will become a standard zip cabinet that will be recognized by any zip handling package. You will be able to view the packages contents and extract them.
Open your web.config file. Locate the compilation parameters in system.web and replace them with the block below. Note the new line referring to the SPUrl expression. Also be aware that this only works with MOSS and not WSS, as WSS does not have access to the publishing DLL. For WSS you will need to path to your image/item rather than using the dynamic SPUrl.
<compilation batch= " false " debug= " false " >
<assemblies>
<add assembly= " Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
</assemblies>
<expressionBuilders>
<remove expressionPrefix= " Resources "/>
<add expressionPrefix= " Resources " type= " Microsoft.SharePoint.SPResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPHtmlEncodedResources " type= " Microsoft.SharePoint.SPHtmlEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPSimpleFormattingEncodedResources " type= " Microsoft.SharePoint.SPSimpleFormattingEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPUrl " type= " Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder, Microsoft.SharePoint.Publishing, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
</expressionBuilders>
</compilation>
<compilation batch= " false " debug= " false " >
<assemblies>
<add assembly= " Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
</assemblies>
<expressionBuilders>
<remove expressionPrefix= " Resources "/>
<add expressionPrefix= " Resources " type= " Microsoft.SharePoint.SPResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPHtmlEncodedResources " type= " Microsoft.SharePoint.SPHtmlEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPSimpleFormattingEncodedResources " type= " Microsoft.SharePoint.SPSimpleFormattingEncodedResourceExpressionBuilder, Microsoft.SharePoint, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
<add expressionPrefix= " SPUrl " type= " Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder, Microsoft.SharePoint.Publishing, Version= 12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c "/>
</expressionBuilders>
</compilation>
If you cannot edit code you may be working in Contributor Mode (should be visible along the top menu bar). To allow Code view in Contributor Mode, go into the Site Menu, choose Contributor Settings. Modify the Content Authors (default) profile. Click the check box that says Allow user of Code View. Click OK. You should now be able to edit your code. The Design, Split, and Code option will be available at the base of your content window now.
Here's how to add your company logo so it is inherited across your sites.
Browse to the top level of your site collection in the browser.
From The Site Actions Menu, Select View All Site Content
Select the Site Collection Images Library
Upload your Company Logo (companylogo.gif) - If required, approve this image.
Open SharePoint Designer 2007 and Select File, Open Site. Type the URL of the top level of your site collection.
Locate the master page gallery in the left pane. _catalogs\masterpage
Double click the default.master (you may be prompted to check it out - if so choose yes)
Search For: <SharePoint:SiteLogoImage id=”onetidHeadbnnr0″ LogoImageUrl=”/_layouts/images/titlegraphic.gif” runat=”server”/>
Replace With: <asp:Image runat=”server” id=”logo” ImageUrl=”< %$ SPUrl: ~sitecollection/sitecollectionimages/companylogo.gif %>/>
What the above does is replace the default (site by site) mechanism for replacing the company logo with a hard coded reference to the company logo which you uploaded to the Site Collection Images library.
By doing this, all pages which inherit from the top level default.master will be updated to reflect this change. Each time you create a sub site, simply inherit from the master page of the parent site collection.
Browse to the top level of your site collection in the browser.
From The Site Actions Menu, Select View All Site Content
Select the Site Collection Images Library
Upload your Company Logo (companylogo.gif) - If required, approve this image.
Open SharePoint Designer 2007 and Select File, Open Site. Type the URL of the top level of your site collection.
Locate the master page gallery in the left pane. _catalogs\masterpage
Double click the default.master (you may be prompted to check it out - if so choose yes)
Search For: <SharePoint:SiteLogoImage id=”onetidHeadbnnr0″ LogoImageUrl=”/_layouts/images/titlegraphic.gif” runat=”server”/>
Replace With: <asp:Image runat=”server” id=”logo” ImageUrl=”< %$ SPUrl: ~sitecollection/sitecollectionimages/companylogo.gif %>/>
What the above does is replace the default (site by site) mechanism for replacing the company logo with a hard coded reference to the company logo which you uploaded to the Site Collection Images library.
By doing this, all pages which inherit from the top level default.master will be updated to reflect this change. Each time you create a sub site, simply inherit from the master page of the parent site collection.
Use stsadm.exe to create a backup of the entire site.
Open the command line and enter:
"c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o backup -url http://www-dev-19/ -filename c:\fullbackup -overwrite
The root SharePoint site at www-dev-19 is backed up in its entirety to a file on C:\ called fullbackup. The exported site generated a 411Mb file on C:\.
Now go into your SharePoint Administration tool, and create a new Site Application. Make note of the site name and port number. In this case, we created a new site application on port 2091.
Then go back into the command line and enter:
"c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o restore -url http://www-dev-19:2091/ -filename c:\fullbackup -overwrite
The data is imported from the file into the new site application database.
We have now created a duplicate of our original site on port 80 on port 2091.
Open the command line and enter:
"c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o backup -url http://www-dev-19/ -filename c:\fullbackup -overwrite
The root SharePoint site at www-dev-19 is backed up in its entirety to a file on C:\ called fullbackup. The exported site generated a 411Mb file on C:\.
Now go into your SharePoint Administration tool, and create a new Site Application. Make note of the site name and port number. In this case, we created a new site application on port 2091.
Then go back into the command line and enter:
"c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o restore -url http://www-dev-19:2091/ -filename c:\fullbackup -overwrite
The data is imported from the file into the new site application database.
We have now created a duplicate of our original site on port 80 on port 2091.
If you are getting the message “The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.", Windows SharePoint Services 3.0 prevents certain file types from being uploaded to the server. Server administrators can add or remove file types from this list, as needed. Contact your server administrator to request that the file type be unblocked.
To resolve this issue, remove the file type from the Blocked File Types page in Windows SharePoint Services 3.0. To enable a file type that is currently blocked, remove it from the global settings list and from the Web application list. To do this, follow these steps:
1. Start SharePoint 3.0 Central Administration.
2. Click Operations, and then click Blocked file types under Security Configuration.
3. On the Blocked File Types page, click Global Settings in the Web Application box.
4. Remove the file name extension from the list of blocked file types. For example, remove the .config file name extension.
5. Click OK.
If you are using MOSS there are some additional steps.
6. Under Security Configuration, click Blocked file types.
7. On the Blocked File Types page, click the Web application that you want to configure in the Web Application box.
8. Remove the file name extension from the list of blocked file types.
9. Click OK.
To resolve this issue, remove the file type from the Blocked File Types page in Windows SharePoint Services 3.0. To enable a file type that is currently blocked, remove it from the global settings list and from the Web application list. To do this, follow these steps:
1. Start SharePoint 3.0 Central Administration.
2. Click Operations, and then click Blocked file types under Security Configuration.
3. On the Blocked File Types page, click Global Settings in the Web Application box.
4. Remove the file name extension from the list of blocked file types. For example, remove the .config file name extension.
5. Click OK.
If you are using MOSS there are some additional steps.
6. Under Security Configuration, click Blocked file types.
7. On the Blocked File Types page, click the Web application that you want to configure in the Web Application box.
8. Remove the file name extension from the list of blocked file types.
9. Click OK.
Remote access into your Sharepoint server. Open command line access, and navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin.
Run stsadm -o export -url http://<server name>/<server path>/<site name> -filename <path to export file> -includeusersecurity -versions 4
Exports the site data to your output file. Creates a file with a .cmp extension.
Then create the new site in the location you want in Sharepoint. Make a note of the new site address. Delete any unwanted welcome posts, category entries, etc. Imported data is amended not replaced.
Open command line access, and navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin.
Run stsadm -o import -url http://<server name>/<server path>/<site name> -filename -filename <path to import file> -includeusersecurity
Data is imported into new site. Check that everything you require is there, and then you can delete the old site.
Run stsadm -o export -url http://<server name>/<server path>/<site name> -filename <path to export file> -includeusersecurity -versions 4
Exports the site data to your output file. Creates a file with a .cmp extension.
Then create the new site in the location you want in Sharepoint. Make a note of the new site address. Delete any unwanted welcome posts, category entries, etc. Imported data is amended not replaced.
Open command line access, and navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin.
Run stsadm -o import -url http://<server name>/<server path>/<site name> -filename -filename <path to import file> -includeusersecurity
Data is imported into new site. Check that everything you require is there, and then you can delete the old site.
To enable debugging, open the web.config file with notepad, that is located in the volume containing your Inetpub root. Eg:
c:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config
Search for the Callstack attribute. Change it from False to True.
Then locate the CustomErrors element. Disable it.
Check any web parts or controls are registered in the Safe Controls list.
Finally, add a new element to the web.config file:
<trace enabled="true" pageOutput="true" />
Now you will receive the full stack traces as output on errors instead of the cryptic non-descriptive error message you get by default.
To debug a web part, under the Debug menu select Attach to Process. Check the Ensure Show System Processes and Show Processes in all Sessions boxes. Locate the w3wp.exe process that is running when you have a browser open with the site in it. Select this process to attach the part too. Back in the browser, access your web part as normal, and when it encounters a problem or a breakpoint, you will be sent back into the Visual Studio debugger.
c:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config
Search for the Callstack attribute. Change it from False to True.
Then locate the CustomErrors element. Disable it.
Check any web parts or controls are registered in the Safe Controls list.
Finally, add a new element to the web.config file:
<trace enabled="true" pageOutput="true" />
Now you will receive the full stack traces as output on errors instead of the cryptic non-descriptive error message you get by default.
To debug a web part, under the Debug menu select Attach to Process. Check the Ensure Show System Processes and Show Processes in all Sessions boxes. Locate the w3wp.exe process that is running when you have a browser open with the site in it. Select this process to attach the part too. Back in the browser, access your web part as normal, and when it encounters a problem or a breakpoint, you will be sent back into the Visual Studio debugger.
I installed the frameworks and add-on's to Visual Studio 2005 v8.0.50.727.42 and found that all the items in my Toolbox disappeared and some items appeared more than once in other menus.
Apparently if you right click on one of the toolbox control headings, (common controls for example) and select reset toolbox
then right click again and select show all...
then they will be all displayed (with them grayed out)
then right click again and select Reset Toolbox...
should take about 30 seconds and they will all reappear
If this doesn't work you can also try clearing out the cache files for the Toolbox in C:\Documents and Settings\<username>\Local Settings\Application Data\Microsoft\VisualStudio\8.0
Apparently if you right click on one of the toolbox control headings, (common controls for example) and select reset toolbox
then right click again and select show all...
then they will be all displayed (with them grayed out)
then right click again and select Reset Toolbox...
should take about 30 seconds and they will all reappear
If this doesn't work you can also try clearing out the cache files for the Toolbox in C:\Documents and Settings\<username>\Local Settings\Application Data\Microsoft\VisualStudio\8.0
Check out the article here.
Open command line window.
Change to c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
Execute sdkvars.bat
Then execute sn -k c:\.snk
The key file will be generated for attachment to your project. Right click on your project in Visual Studio and select Add Existing Item. Select the .snk file that you just created.
Then right-click on your project again and select Properties. Navigate to the signing tab. Check Sign the Assembly checkbox, and then choose your .snk file from the Choose a strong name key file dropdown list. Close the Properties window. Rebuild the project to recreate your dll with the strong name.
Change to c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
Execute sdkvars.bat
Then execute sn -k c:\
The key file will be generated for attachment to your project. Right click on your project in Visual Studio and select Add Existing Item. Select the .snk file that you just created.
Then right-click on your project again and select Properties. Navigate to the signing tab. Check Sign the Assembly checkbox, and then choose your .snk file from the Choose a strong name key file dropdown list. Close the Properties window. Rebuild the project to recreate your dll with the strong name.
