发布有 Excel Word 操作的站点解决方法
2013-02-16 18:45
423 查看
配置过程:
(1)网站按 release X86 发布
(2)iis设为兼容32位
【英文的】
Enable 32-bit Server Applications on 64-bit Machines
ASP.NET applications that use TX Text Control .NET Server must be compiled for 32-bit platforms (see this article).
IIS must be configured to execute these 32-bit applications. Generally, all applications will be executed in 64-bit mode.
1. Enable IIS's 32-bit support
Open a command prompt and type in the following command:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
This command enables the 32-bit mode in IIS.
2. Install the IIS 32-bit extensions
Open a command prompt and type the following command:
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
This command installs the 32-bit web extensions for .NET Framework 2.0.
3. Activate .NET Framework 2.0 32-bit in IIS
In the IIS-Manager, select the 'ASP.NET v2.0.50727 (32bit)' in the 'Web Service Extensions' panel and check 'allow' to activate it.
4. Restart the IIS by opening a command prompt:
iisrestart
【中文的】
IIS6上的做法:
1.命令行键入:
cscript.exe %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
即设置IIS6允许32位程序运行在64位机器上
2.重新注册.net FrameWorks
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
3.完成之后,应该会看到多出一个32位的asp.net,如下图:
将其设置为允许,缺点:这样会使整个IIS上的所有站点都以32位兼容方式运行
然后再运行一下:%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
这样就可以跑32位的程序了。
(3)进入32位的组件管理
1、开始->运行->mmc -32
2、文件-添加/删除管理单元
3、从“可用的管理单元”中找到“组件服务”,添加到“所管理单元”,点击“确定”即可
4、添加完之后,即可在此看到word文档。。接下来配置,你懂的~
(4)组件设置权限(可执行文件也设了权限)
检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005。
控制面板-》管理工具-》组件服务-》计算机-》我的电脑-》DCom配置-》找到Microsoft Word文档
之后
单击属性打开此应用程序的属性对话框。
单击"安全"选项卡,分别在"启动和激活权限"和"访问权限"组中选中"自定义",然后
自定义->编辑->添加ASP.NET账户和IUSER_计算机名
(5)修改web.config(需要明文加入管理员密码)
<system.web>
<identity impersonate="true" userName="administrator" password="227"/>
</system.web>
Windows Server 2008
在VS2010 中写了一个EXCEL的导出功能的东西,但在Windows Server 2008 X64上发布后遇到个问题,EXCEL文件确实存在,但.net调用的EXCEL却不能打开这个EXCEL文件,代码执行到打开文件的时候报错,抛出异常如下:
Microsoft Office Excel 不能访问文件“XXXXX.xls”。 可能的原因有:
? 文件名称或路径不存在。
? 文件正被其他程序使用。
? 您正要保存的工作簿与当前打开的工作簿同名
此代码在2003的服务器上运行的没有问题,在给工作目录加上了相应的权限后发现问题依旧。无奈,上网去转了一圈,找到了一个解决方法,以下是其中关键的部分:
This solution is ...
?Windows 2008 Server x64
Please make this folder.
C:/Windows/SysWOW64/config/systemprofile/Desktop
?Windows 2008 Server x86
Please make this folder.
C:/Windows/System32/config/systemprofile/Desktop
...instead of dcomcnfg.exe.
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
It disappears from Windows2008, Windows2003 had the folder,
and I think it cause this error.
即在C:/Windows/System32/config/systemprofile和C:/Windows/SysWOW64/config/systemprofile目录下创建名为Desktop目录即可解决问题。
(1)网站按 release X86 发布
(2)iis设为兼容32位
【英文的】
Enable 32-bit Server Applications on 64-bit Machines
ASP.NET applications that use TX Text Control .NET Server must be compiled for 32-bit platforms (see this article).
IIS must be configured to execute these 32-bit applications. Generally, all applications will be executed in 64-bit mode.
1. Enable IIS's 32-bit support
Open a command prompt and type in the following command:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
This command enables the 32-bit mode in IIS.
2. Install the IIS 32-bit extensions
Open a command prompt and type the following command:
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
This command installs the 32-bit web extensions for .NET Framework 2.0.
3. Activate .NET Framework 2.0 32-bit in IIS
In the IIS-Manager, select the 'ASP.NET v2.0.50727 (32bit)' in the 'Web Service Extensions' panel and check 'allow' to activate it.
4. Restart the IIS by opening a command prompt:
iisrestart
【中文的】
IIS6上的做法:
1.命令行键入:
cscript.exe %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
即设置IIS6允许32位程序运行在64位机器上
2.重新注册.net FrameWorks
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
3.完成之后,应该会看到多出一个32位的asp.net,如下图:
将其设置为允许,缺点:这样会使整个IIS上的所有站点都以32位兼容方式运行
然后再运行一下:%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
这样就可以跑32位的程序了。
(3)进入32位的组件管理
1、开始->运行->mmc -32
2、文件-添加/删除管理单元
3、从“可用的管理单元”中找到“组件服务”,添加到“所管理单元”,点击“确定”即可
4、添加完之后,即可在此看到word文档。。接下来配置,你懂的~
(4)组件设置权限(可执行文件也设了权限)
检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005。
控制面板-》管理工具-》组件服务-》计算机-》我的电脑-》DCom配置-》找到Microsoft Word文档
之后
单击属性打开此应用程序的属性对话框。
单击"安全"选项卡,分别在"启动和激活权限"和"访问权限"组中选中"自定义",然后
自定义->编辑->添加ASP.NET账户和IUSER_计算机名
(5)修改web.config(需要明文加入管理员密码)
<system.web>
<identity impersonate="true" userName="administrator" password="227"/>
</system.web>
Windows Server 2008
在VS2010 中写了一个EXCEL的导出功能的东西,但在Windows Server 2008 X64上发布后遇到个问题,EXCEL文件确实存在,但.net调用的EXCEL却不能打开这个EXCEL文件,代码执行到打开文件的时候报错,抛出异常如下:
Microsoft Office Excel 不能访问文件“XXXXX.xls”。 可能的原因有:
? 文件名称或路径不存在。
? 文件正被其他程序使用。
? 您正要保存的工作簿与当前打开的工作簿同名
此代码在2003的服务器上运行的没有问题,在给工作目录加上了相应的权限后发现问题依旧。无奈,上网去转了一圈,找到了一个解决方法,以下是其中关键的部分:
This solution is ...
?Windows 2008 Server x64
Please make this folder.
C:/Windows/SysWOW64/config/systemprofile/Desktop
?Windows 2008 Server x86
Please make this folder.
C:/Windows/System32/config/systemprofile/Desktop
...instead of dcomcnfg.exe.
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
It disappears from Windows2008, Windows2003 had the folder,
and I think it cause this error.
即在C:/Windows/System32/config/systemprofile和C:/Windows/SysWOW64/config/systemprofile目录下创建名为Desktop目录即可解决问题。
相关文章推荐
- word, excel 等“由于本机的限制,该操作已被取消。请与系统管理员联系。”问题的解决方法
- 双击打开excel,word文档慢的解决方法
- asp.net 在IIS下操作Excel文件权限不足的解决方法
- JS操作Word和Excel的方法
- C#操作Word导致 “Microsoft.Office.Interop.Word.ApplicationClass”的 COM 组件错误的解决方法
- 解决每次打开Word、Excel等都要重新配置安装的方法
- 双击word,excel等office文档很慢的解决方法
- VC同时操作WORD和用ADO操作数据库时产生冲突的解决方法
- 发布到SPS站点下的ASP.NET页面上的中文不能正常显示__问题解决方法
- c#操作Excel 一些问题 字符变为null解决方法
- C#利用com操作excel释放进程的解决方法
- c#频繁读取word文件 所请求的剪切板操作失败 解决方法
- 右键新建没有Word_Excel_PowerPoint的解决方法
- JSP页面IE无法打开Internet 站点…… 已终止操作 的解决方法
- 【转】.NET引用Excel操作时无法关闭Excel.exe进程的解决方法
- 右键新建没有Word,Excel,PowerPoint的解决方法
- Word / Excel 双击启动缓慢的解决方法集锦
- Word 2010无法发布博客的解决方法
- 关于无法显示该网页,弹出对话框显示"Internet Explorer无法打开Internet站点xxx,已终止操作"问题的解决方法
- 使用企业库在某些站点会报试图执行安全策略不允许的操作异常的解决方法。