如何使用 Visual Studio 2008 开发 SharePoint 2007 解决方案..?

发布于 2024-08-20 16:31:58 字数 121 浏览 7 评论 0原文

我想在 SharePoint Server 2007 上开发一个公共网站。

但是,我想使用 Visual Studio 2008 开发一个解决方案(我不想使用 SharePoint Designer 2007)。

I want to develop a public website on SharePoint server 2007.

But, I want to develop a solution using Visual Studio 2008 (I dont want to use SharePoint designer 2007).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

∞梦里开花 2024-08-27 16:31:58

您缺少有关 SharePoint 开发和部署与 ASP.NET 有何不同的一些基础知识。您可以在 Visual Studio 中的 (.WSP) 中创建 SharePoint 解决方案包,并使用 STSADM 工具将它们部署到服务器。或者,您可以使用更传统的技术(复制文件并修改服务器上的 web.comfig)将 Web 部件部署到 BIN,但从长远来看,值得您花时间了解如何创建解决方案包。

以下是帮助您入门的文章和视频:http://msdn.microsoft .com/en-us/library/bb466225.aspx

文章作者 Ted Pattison 是《Inside Windows SharePoint Services 3.0》一书的作者。它被认为是 SharePoint 开发的顶级书籍之一,您通常可以在网上找到它,价格非常便宜,我强烈建议您购买一本。

他也是出色的部署工具 STSDev 的作者,该工具可以在 CodePlex 上找到。我建议在使用 STSDev、WSPBuilder 或 SPVisualDev 等工具之前花一些时间来了解部署过程,因为虽然这些工具很好,并且可以减轻 SP 开发中涉及的许多繁琐的工作,但它们不能处理所有场景,最终您会发现自己需要基础知识来创造工具无法提供的灵活性。

干杯,CJ

You are missing some fundamentals of how SharePoint development and deployment differs from ASP.NET. You create SharePoint Solution Packages in (.WSP) in Visual Studio and deploy them to the server using the STSADM tool. Alternately you can deploy web parts to the BIN using more traditional techniques of copying the files and modifying the web.comfig on the server but in the long run it is worth your time to understand how to create solution packages.

Here is an article and video to get you started: http://msdn.microsoft.com/en-us/library/bb466225.aspx

The author of the article Ted Pattison is the author of a book called "Inside Windows SharePoint Services 3.0". It is considered one of top books for SharePoint development and you can usually find it used online very cheap, I would highly reccomend picking up a copy.

He is also the author of the excellent deployment tool STSDev which can be found on CodePlex. I would suggest taking some time to understand the deployment process before using tools like STSDev, WSPBuilder or SPVisualDev, because while the tools are good, and relieve much of the tedious stuff involved with SP development, they do not handle all scenarios and eventually you will find yourself needing the fundamentals to create flexibility the tools don't provide.

Cheers, CJ

霓裳挽歌倾城醉 2024-08-27 16:31:58

根据您使用的环境,可以采用多种策略来设置您的计算机以进行 Sharepoint 开发。

如果您使用的是 Windows XP、Vista 或 7 等操作系统,您将无法安装 Sharepoint 2007、Windows Sharepoint Services 或 Visual Studio 2008 Extensions,因为它们都需要服务器操作系统 - Sharepoint 2010 将允许不过,您可以安装在 Vista 或 7 (x64) 上。当您安装 Sharepoint 时,Sharepoint 程序集会安装在计算机上。您可以选择以下任一选项:

  1. 使用 Virtual PC 创建虚拟 Windows 2003 实例,您将使用该实例进行开发。您将安装 Sharepoint 2007、Sharepoint Services、Visual Studio 2008 和 Visual Studio 2008 Sharepoint 扩展。在部署到测试服务器和生产环境之前,您将使用此虚拟实例进行开发和测试。

  2. 如果您不想进行虚拟化,那么您可以使用 Windows 2003 作为主操作系统,并按照上述相同的步骤进行操作。

    如果

  3. 如果您想坚持使用 XP、Vista 或 7,而不使用虚拟化,那么您可以将必要的程序集从 Sharepoint 服务器复制到本地计算机。您无法使用 Visual Studio 扩展,但您仍然可以使用程序集进行 Sharepoint 开发。不过,此解决方案将使调试变得更加困难,因为您需要将代码部署到测试 Sharepoint 服务器来执行此操作。

编辑

Visual Studio 本身无法打开 Sharepoint 网站,因为它不是为编辑 Sharepoint 网站而设计的。您将使用 Visual Studio 创建 Web 部件、工作流等...另一方面,Sharepoint Designer 是为编辑页面而设计的,我建议使用它进行网站编辑。

但是,如果您仍想使用 Visual Studio,则可以使用以下 Visual Studio 加载项在 Visual Studio 中打开您的 Sharepoint 站点:

http://spdevexplorer.codeplex.com/

我个人没有使用过它,所以我不能确定它有多好。

希望这有帮助。

Depending on the environment that you are using there are multiple strategies to setup your machine for Sharepoint Development.

If you are using an operating system such as Windows XP, Vista, or 7 you will not be able to install either Sharepoint 2007, Windows Sharepoint Services, or Visual Studio 2008 Extensions, since they all require a server operating system - Sharepoint 2010 will allow you to install on Vista or 7 (x64) though. The Sharepoint assemblies are installed on the machine when you install Sharepoint. Your options here are either:

  1. Use Virtual PC to create a virtual Windows 2003 instance, which you will use for your development. You will install Sharepoint 2007, Sharepoint Services, Visual Studio 2008, and Visual Studio 2008 Extensions for Sharepoint. You will use this virtual instance for your development and testing before deploying to your testing server then production.

  2. If you don't want to do virtualization then you can just use Windows 2003 as your main operating system and follow the same steps above.

  3. If you want to stick with XP, Vista, or 7 without virtualization then you can copy the necessary assemblies from your Sharepoint server to your local machine. You can't use the Visual Studio Extensions, but you will still be able to develop for Sharepoint with the assemblies. This solution will make it a little more difficult to debug though, because you will need to deploy your code to a test Sharepoint server to do it.

EDIT

Visual Studio on its own can't open Sharepoint sites, because it wasn't designed to edit Sharepoint sites. You would use Visual Studio to create web parts, workflows, etc... Sharepoint Designer on the other hand was designed for editing pages and I would recommend using it for site edits.

BUT, if you would still rather use Visual Studio, then you can use the following Visual Studio Add-In to open your Sharepoint site in Visual Studio:

http://spdevexplorer.codeplex.com/

I personally haven't used it, so I can't be certain of how good it is.

Hope this helps.

驱逐舰岛风号 2024-08-27 16:31:58

您并不绝对需要使用 Visual Studio 来创建 SharePoint 2007 网站。如果您的网站没有编译代码,那么您绝对可以不用使用记事本。您可能有一些需要一些自定义代码的要求。这一切都取决于您的要求。我尽量避免使用 Visual Studio 来编写功能。即使是一些基本的 Web 部件也可以在不使用任何隐藏代码并使用开箱即用的 SharePoint 控件的情况下编写。

Visual Studio 对于源代码控制(与 TFS 连接)和一般构建解决方案以满足 WSP 文件的要求非常方便。当然,您应该使用 Visual Studio 来编译程序集。 :) 一般设置是安装了 WSP Builder 扩展的 Visual Studio(查看 codeplex )。如果您在 VS 项目中创建了正确的文件夹结构,那么 WSP 的生成将变得更加容易。话虽如此,您可以使用 WSP Builder 创建 wsp 文件(这只是重命名的 cab 文件)。

创建 WSP 后,您可以通过 stsadm 命令部署它(google this)。我建议使用批处理文件作为部署脚本。

这可能有助于您的初始设置:
http://blog.zebsadiq.com/post/SharePoint- 2007-installation-in-2010.aspx

ps 绝对避免通过 SharePoint 设计器进行任何更改,在使用它更改网站上的任何文件之前,您应该了解后果。

忘记提及:SharePoint desginer 非常适合制定 Web 部件 html。如果您是新手,您可能想知道 a) 在哪里可以找到基本的开箱即用 Web 部件的语法 b) 如何调整该语法以获得我需要的结果...
最好的方法是连接到网站,创建一个虚拟页面,将 Web 部件添加到页面(拖放)并通过 SharePoint Designer UI 进行调整,然后在满意后切换到 html 视图,复制 Web 部件语法并将其粘贴到文件系统上的文件中。然后,您可以根据需要删除虚拟页面或将其用于配置其他 Web 部件。
关键是,尽管 SharePoint 设计器有其缺陷,并且您可能正确地避免将其作为主要开发方法,但它确实具有一些功能,使其在开发时可用。

You don't absolutely need to have Visual Studio to create a SharePoint 2007 site. You can definitely get away with using notepad if your web site doesn't been compiled code. You may have some requirements that require some custom code. It all comes down to your requirements. I try to avoid using Visual Studio for writing features. Even some basic webpart can be written without using any code behind and using out of the box SharePoint controls.

Visual Studio is very handy for source control (connectivity with TFS) and generally structuring your solution to match the requirements of the WSP file. Of course you should use Visual Studio to compile your assemblies. :) The general set up would be Visual Studio with WSP Builder extension installed (look on codeplex ). If then you create the correct folder structure inside your VS project, the generation of your WSP will become much easier. Having said this, you can create wsp files (which is just a renamed cab file) using WSP Builder.

Once you've created your WSP, you can deploy this via stsadm commands (google this). I would suggest having a batch file as a deployment script.

This might help with your initial setup:
http://blog.zebsadiq.com/post/SharePoint-2007-installation-in-2010.aspx

p.s. Definitely avoid making any changes through SharePoint designer, you should learn about the consequences before you change any files on your site with it.

Forgot to mention: SharePoint desginer is great for formulating web part html. If you're new, you probably wondering a) where do I find the syntax for a basic out of the box web part b) How do I tweak that syntax to get the results that I need...
Best way to do this would be to connect to the site, create a dummy page, add the web part to the page (drag and drop) and tweak it via the SharePoint Designer UI, then once you're satisfied, switch to html view, copy the web part syntax and paste it into the file on the file system. You can then delete the dummy page if you want or use it for configuring other web parts.
The point is, though SharePoint designer has its flaws and you may be right to avoid it as your main method of development, its definitely got some features that make it worth while having available while developing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文