.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
安装vs.net 2003后提示"Dte.olb could not be loaded.Please re-run setup and repair your installation"而无法启动vs.net(专贴)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

安装vs.net 2003后提示"Dte.olb could not be loaded.Please re-run setup and repair your installation"而无法启动vs.net
(wellknow发表于2004-8-24 17:19:13)

          通过搜索,发现DTEv.olb位于X:\Program Files\Common Files\Microsoft Shared\MSEnv内
        使用regsvr32手动注册一下,IDE可以正常启动。查了一下MSDN,有相应文章说明

        =============================================================================
        PRB: Visual IDE Does Not Open When Started or Application Cannot Start Error Message
        http://support.microsoft.com/default.aspx?scid=kb;EN-US;306905
        那么这个文件是做什么的呢?
        查看msdn内容如下地址:
        http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebugext/html/vxlrfenvdtedebugger.asp
        它包含EnvDTE 名字空间,assembly 名称是envdte。
        Visual Studio .NET的所有对象、成员和自动化模型都是基于DTE对象. DTE对象代表 Visual Studio .NET IDE ,它位于自动化模型类的顶级.
        包含在envdte.dll中。COM 类型库名称是 "Microsoft Development Environment 7.0" 就被包含在dte.olb中.
        简单一句话,它就代表IDE,我们可以用它来扩展VS.net IDE
        因为所有自动化对象都要求DTE对象,所以如果没有正确注册,IDE肯定无法正常工作。
        顺便说说我没自己如何添加它的引用。
        选择.NET assembly 还是COM依靠工程类型。(如果你使用add_ins向导或宏,那么不需要你手动添加引用,但是如果你是在外部使用,那么你必须手动添加引用)
        引用的方法就是从”解决方案(Solution Explorer)“中通过”添加引用(Add Reference)“来加入envdte"或者 " Microsoft Development Environment 7.0"
        (以上是vb和c#的方法。)
        一个具体使用的例子:

        Programmatically Adding a UserControl to the VS.NET ToolBox
        作者:Shawn A. Van Ness
        例子演示将Microsoft Tablet PC SDK的InkPicture 和 InkEdit添加到VS.NET 的Toolbox
        private static void AddToolBoxTab(EnvDTE.DTE env)
        {
        // First, ensure Tablet SDK is installed -- get location of Microsoft.Ink.dll
        string fullpathToMicrosoftInk = LookupMicrosoftInkAssemblyFilename();

        // Prepare to munge the toolbox -- get toolbox window, object, and tabs collection
        EnvDTE.Window toolboxWindow = env.Windows.Item(EnvDTE.Constants.vsWindowKindToolbox);
        EnvDTE.ToolBox toolbox = (EnvDTE.ToolBox)toolboxWindow.Object;
        EnvDTE.ToolBoxTabs toolboxTabs = toolbox.ToolBoxTabs;

        // Careful to check if our tab already exists
        foreach (EnvDTE.ToolBoxTab tab in toolboxTabs)
        {
        if (tab.Name == TabName)
        return;
        }

        // No, so add it
        EnvDTE.ToolBoxTab newtab = toolboxTabs.Add(TabName);

        // WinBug: gotta show the Properties window, first (this cost me ~1 day of my life)
        env.ExecuteCommand("View.PropertiesWindow", "");

        // WinBug2: gotta activate the tab and select the first item (grr...)
        newtab.Activate();
        newtab.ToolBoxItems.Item(1).Select();

        // Finally: add the Microsoft Ink controls
        newtab.ToolBoxItems.Add(
        @"Unused?",
        fullpathToMicrosoftInk,
        EnvDTE.vsToolBoxItemFormat.vsToolBoxItemFormatDotNETComponent
        ;
        }

        private static string LookupMicrosoftInkAssemblyFilename()
        {
        Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine;
        rk = rk.OpenSubKey(KeyName, false);

        if (rk == null)
        throw new ArgumentException(String.Format("Could not find registry key:\n[HKLM\\{0}]",KeyName));

        string fullpathToAssembly = (string)rk.GetValue(null);
        fullpathToAssembly += @"\Microsoft.Ink.dll";

        if (!System.IO.File.Exists(fullpathToAssembly))
        throw new System.IO.FileNotFoundException("File not found", fullpathToAssembly);

        return fullpathToAssembly;
        }

        MSDN 提供的例子
        Visual Studio .NET 2003 Automation Samples

        http://www.microsoft.com/downloads/details.aspx?familyid=3FF9C915-30E5-430E-95B3-621DCCD25150&displaylang=en

注册命令:
C:\Program Files\Common Files\Microsoft Shared\MSEnv>regsvr32 dte.olb



相关文章

相关软件