Advanced Visual Studio 2005 Tools For Office Programming And Deployment
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Advanced Visual Studio 2005 Tools For Office Programming And Deployment

on

  • 2,722 views

Session on VSTO from a Microsoft event

Session on VSTO from a Microsoft event

Statistics

Views

Total Views
2,722
Views on SlideShare
2,719
Embed Views
3

Actions

Likes
0
Downloads
46
Comments
1

1 Embed 3

http://www.slideshare.net 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Great work thanks...
    btw u should use dev \ efor -the Visual Studio plug-in that helps you monitor your development progres- http://www.devefor.com , u can download it free also
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Advanced Visual Studio 2005 Tools For Office Programming And Deployment Presentation Transcript

  • 1. Advanced Visual Studio 2005 Tools for Office Programming and Deployment David Truxall Architect NuSoft Solutions
  • 2. Agenda
    • Server programming
    • Security
    • Deployment
  • 3. Server Goals
    • Make it as simple to create Office content on the server as it is for HTML
    • Integrate with VSTO 2005 programming model
      • Client/Server Symmetry.
    • Scale, Scale, Scale
    • Integrate with ASP .NET programming model
  • 4. Server Capabilities in VSTO 2005
    • Fill the data island on the server
    • Program against the data on the server
    • Run code outside the document
    • Expose data from Office docs to ASPX
  • 5. Server Feature Read and Write Cached Data ' Load the document (does not start the Office application) Dim productsDoc As String = "C:DocumentsProducts0105.xls" Dim doc As ServerDocument = New ServerDocument(productsDoc) 1 ' Read the cached data from the dataset in the worksheet Dim cdi As CachedDataItem cdi = doc.CachedDataManifest.Views("ProductWorksheet"). _ CachedData("ProductWorksheet.ProductCache") Dim sr As System.IO.StringReader = New _ System.IO.StringReader(cdi.Xml) ProductsData.ReadXml(sr) 2 ' Write the modified dataset back to the dataset ' in the workbook. cdi.SerializeDataInstance(ProductsData) doc.Save() doc.Close() 3
  • 6. Data in Office Solutions How Does Server-Side Work? Server Code Server Client Server Side Code prepopulates elements before sending to client John is cool! $345.00 URL Request CreateExpense.aspx Databases Corporate Systems
  • 7. Data in Office Solutions How Does Server-Side Work? Server Code Server Client Document is transferred with data URL Request CreateExpense.aspx Mike is cooler! $1000.00 Databases Corporate Systems
  • 8. Filling the Data Island
    • All the data in a VSTO 2005 enabled Office document is stored in a standard data island
    • This enables the VSTO 2005 runtime to access the data without having to invoke Word or Excel
    • Benefits
      • Doesn’t require you to run Word or Excel on the server
        • Some significant scaling issues
        • Not supported by Microsoft
  • 9. Filling A Data Island on the Server
  • 10. What is Not Supported on the Server
    • Program against the view
      • Since Word & Excel aren’t running on the server there’s no way to get to the object model for each application
      • You can work around this quite easily since you can fill the data on the server and do all the databinding/view manipulation on the client
    • Integrate with other Office apps
      • Since they’re not running on the server
      • However XML/Web Services provide an ideal way to do this
  • 11. Server Summary
    • Program against the data on the server
    • Access any VSTO 2005 document from within an ASPX page
    • Built to scale from day one
  • 12. .NET Security
    • VSTO Security managed by .NET security policy
      • Evidence (location, signature, etc.)
      • Permissions (execution, UI, full, etc.)
    • Since code in VSTO documents call into the Office OM (unmanaged code), we require Full Trust permission
  • 13. VSTO 2005 Security
    • Won’t run any code by default
    • Must trust both the document and the assembly (Full Trust)
    • Evidence for assemblies is via
      • Signing: Authenticode or Strong Naming
      • Location: URL
      • Local Machine Zone is not enough
    • Evidence for documents is via Location
      • E-mail attachments must be copied to desktop (Outlook temp directory is Internet Zone)
  • 14. Code Security Scenarios
    • Alice creates a VSTO 2005 project for a Budget Spreadsheet
    • Alice hands over final code to Bob in IT
    • Bob deploys code & document to http://budget
    • Bob deploys security policy to end users machine to trust http://budget
    • Fred creates a new budget from http://budget
    • Code runs!
    • Fred sends it to Sue via email
    • Sue save the budget sheet to her desktop
    • Opens it from the desktop
    • Code runs!
  • 15. Code Security – VeryEvil.com
    • Evil Alice creates fakebudget.xls and creates a VSTO 2005 project
    • Evil Alice deploys code to http://veryevil.com/budget
    • Evil Alice sends fakebudget.xls to Bob in email
    • Bob opens the spreadsheet
    • No code runs because http://veryevil.com isn’t trusted
  • 16. Bad Trust Decision
    • ISV Alice writes some VSTO 2005 code behind ISVBudget.xls
    • Deploys code and budget to http://www.budgetsrus.com
    • Fred creates a budget from website & saves it to his machine
    • IT Bob discovers bug in the code behind ISVBudget.xls that compromises the corp security practices
    • Bob tells ISV Alice but the fix won’t be ready for weeks
    • Bob blocks access to http:// www.budgetsrus.com for the corporation
    • Budgets don’t work but the corp security is safe
    • Alice fixes bug
    • Bob reinstates access to http://www.budgetsrus.com
    • The sun shines
  • 17. Security Configuration
  • 18. Deployment & Update
    • Self updating Document
      • App Manifest is updated to point to the latest assembly
    • Manifest based deployment
      • Application level and deployment level manifests
  • 19. How Does This Work? <manifest> <deploy url= http://…/deploy.xml version=“1.0”/> <manifest> <deploy url= http://…/ deploy.xml version=“1.0.1”/> . <assembly Name=“foo.dll” updateURL= http://../1.0.1/foo.dll <manifest> <deploy url= http://…/ deploy.xml version=“1.0”/> Deploy.xml manifest.xml manifest.xml <manifest> . . curVersion-”1.0.1” Foo.xls manifest.xml Foo.dll v1.0 Foo.dll v1.0.1
  • 20. Move to Production Server <manifest> <deploy url= http://…/deploy.xml version=“1.0”/> <manifest> <deploy url= http://svr2/deploy.xml version=“1.0.1”/> . <assembly Name=“foo.dll” updateURL= http://../1.0.1/foo.dll <manifest> <deploy url= http://srv1/deploy.xml version=“1.0”/> Deploy.xml manifest.xml manifest.xml <manifest> . . curVersion-”1.0.1” <app url= “ http://srv2/ manifest.xml” Foo.xls manifest.xml Foo.dll v1.0 Foo.dll v1.0.1 Deploy.xml <manifest> . . curVersion-”1.0.1” <app url= “ http://srv2/ manifest.xml” Test Srv Production Srv
  • 21. Server Object Model to modify App Manifest
    • CustomizedDocument doc = new CustomizedDocument (“file.doc”);
    • doc.AppManifest.DeployManifestPath = “…<new path>”
    • Can change any parts of the app manifest
  • 22. Why Manifests?
    • .NET and Visual Studio moving to manifests
    • Built using the same schema as Click Once
      • New technology coming in the next version of .NET/VS
      • Built into Vista
    • Manifests provide rich information about your application
      • Not just which dll is used
      • Includes dependent assemblies
      • Location of assemblies (moving to Product server)
  • 23. Deployment Basics
    • Requirements for the target machines
      • Office 2003 Professional or Excel 2003 Standalone or Word 2003 Standalone
      • .NET Framework 2.0
      • VSTO 2005 Runtime
      • Office PIAs referenced in your assembly
        • Can be set to install on demand
      • Appropriate security policies
  • 24. Local/Local Deployment Model
    • Pros
      • Network access is not required
      • Users can modify and customize their documents
    • Cons
      • Updates to document or assembly require redistribution to each user
    Local/Local
  • 25. Local/Network Deployment Model
    • Pros
      • Eases updates to assembly
      • Users can modify and customize their documents
    • Cons
      • Updates to document require redistribution to each user
    Local / Network
  • 26. Network/Network Deployment Model
    • Pros
      • Eases updates to assembly
      • Eases updates to document
    • Cons
      • Users cannot modify or customize master documents
    Network / Network
  • 27. Conclusion
    • Server
      • Program against the data on the server
      • Access any VSTO 2005 document from within an ASPX page
    • Security
      • Must trust document and assembly
      • Doesn’t run by default
    • Deployment options
      • Document/assembly options
  • 28. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  • 29. *** BIND LIST *** If Not Me.EmpData Is Nothing Then Me.List1.DataSource = Me.EmpData.Tables(0) Else Me.List1.DataSource = nothing End If **** FILL DATA ISLAND **** Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim da As New SqlClient.SqlDataAdapter(Me.SqlDataSource1.SelectCommand, Me.SqlDataSource1.ConnectionString) Dim empData As DataSet = New DataSet() da.Fill(empData) Dim doc As ServerDocument = New ServerDocument(Server.MapPath(&quot;EmployeeServerData.xls&quot;)) Dim hostItem As CachedDataHostItem Dim dataItem As CachedDataItem hostItem = doc.CachedData.HostItems(&quot;EmployeeServerData.Sheet1&quot;) dataItem = hostItem.CachedData(&quot;EmpData&quot;) dataItem.SerializeDataInstance(empData) doc.Save() doc.Close() End Sub