朋友们好:我机器上装有net 2.0;net 3.0; net 3.5。当我用clickOnce发布程序时:发现VS2005用的是net 3.0进行编译的。
我可以手动选择.net 的版本吗?
我可以手动选择.net 的版本吗?
解决方案 »
- C#.NET打印表单的问题
- 如何删除Sqlserver数据库中存在主外键关联的两个表的数据行
- 关于C#WINFORM的混淆工具
- 求急: 怎样才能动态添加内容呢?
- 一个异步聊天时,客户端接受服务器发送过来的的信息的显示问题……
- VS2005 的 sp1 很有必要装吗?
- 将数据写入文本文件有没有效率更高的办法
- C# 创建的一个COM+应用,但是出现 因为配置类型不正确,系统无法开始服务器进程。请检查用户名和密码。错误 Help!!!!
- 下面代码里面用SqlDateTime赋值的那两句总是出错,不知道为什么,请高手指点!!!
- 问一个简单的关于DataGrid的问题。
- SqlDtatSource 多视图
- 如何在c#中使用dll中的方法?
2.如果你的程序是1.exe,那新建一个1.exe.config的档案。贴上下面的内容:
xml version =1.0
configuration
startup
requiredRuntime version=v2.0.50727
startup
runtime
developmentMode developerInstallation=true
runtime
configuration
如果程序可以运行,就可以使用2.0发布了。上面那个配置文件的作用就是让强制程序在net 2.0的环境下运行
还用得着什么选择吗?
呵呵,楼主说错了吧VS08才可以有得选择的哈。
我也是这么认为的,可是当我的程序发布在客户机器上时:报了一个需要.net 3.0的错。。
谢谢你提供的方法,现在程序的确是用net 2.0 编译的
但是,用clickOnce发布后,在一台只装了了.net 2.0的机器上安装时,报了以下一个错:
Unable to install or run the application. The application requires that assembly WindowsBase Version 3.0.0.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator.不知道你可以解决吗?
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="WindowsBase" version="3.0.0.0" publicKeyToken="31bf3856ad364e35" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
你发布的文件中应该可以查找到上面的内容,改成下面的再试试<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="2.0.50727.0" />
</dependentAssembly>
</dependency>
你真的很厉害!
我现在的环境是这样的:
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="2.0.50727.0" />
</dependentAssembly>
..................................................
..................................................
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="WindowsBase" version="3.0.0.0" publicKeyToken="31BF3856AD364E35" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>问题应该就是<assemblyIdentity name="WindowsBase" version="3.0.0.0">在User机器上没有.
User机器系统是2003 Server,我的系统是XP,跟这个有关系吗?
User
直接替换如果有问题可以试试Bootstrapper 工具。
http://www.cnblogs.com/feishunji/archive/2009/03/24/1420758.html
http://www.microsoft.com/downloads/details.aspx?FamilyId=BF253CFD-1EFC-4FC5-BA7E-6A6F21403495&displaylang=en
Bootstrapper Manifest Generator 真的很棒!曾经我也在为怎么加入其它的组件发愁。
我现在已经将.net framework 3.0的安装包加到了Prerequisites中。。
User的那台机器是64位的操作系统,装.net framework 3.0(x64)居然败了("File is corrupt")折腾一大圈,我还是用VS2008试试吧。。
谢谢了
你提供的"1.exe.config"方式:里面是写xml吗?我的工程不是web版的,我把你写的贴过去后,有语法的错误啊。另外把"xxx.config"放到哪里呢。。
不过,总算解决了一个问题^^