Visual Studio 参考:特定版本设置问题
我有一个内部使用的 Winform 应用程序,我通过 ClickOnce
使用 SQL Express 2005 发布该应用程序。该应用程序还引用了几个 Microsoft.SqlServer
dll。我试图弄清楚特定版本设置是如何工作的。我的机器上安装了 SQL 2008,他们安装了 2005。
如果我选择Specific Version = false
,它会关心用户是否安装了 SQL 2005,还是依赖于 dll。
具体来说,如果我不指定特定版本
,这是否意味着它只会在 GAC 中查找该 dll 的任何版本?
I have a Winform App that we uses internally that I publish through ClickOnce
with SQL Express 2005. The app also references a couple of Microsoft.SqlServer
dll's. I am trying to figure out how the Specific Version settings work. I have SQL 2008 installed on my machine they have 2005.
If I select Specific Version = false
will it care that the users have SQL 2005 or does that depend on the dll.
Specifically, If I do not specify Specific Version
does that mean it will just look in the GAC for any version of that dll?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MSFT 中与 SQLExpress 产品相关的人今天告诉我,很难确定它是否已经安装,他们有一个程序可以执行此操作,该程序是 Visual Studio 中引导程序包的一部分。 (我抱怨他安装 SQLServer 有多困难。)
在 .NET 应用程序中编写代码来连接和使用 SQLServer 数据库并不特定于版本,并且 Microsoft 致力于保持向后兼容性。
Someone at MSFT who's related to the SQLExpress product told me today that it's so hard to figure out if it's installed already, they have a program that does it that's part of the bootstrapper package in Visual Studio. (I was ragging him about how difficult it is to install SQLServer.)
Writing code in a .NET application to connect to and use a SQLServer database is not version-specific, and Microsoft is committed to maintaining backward compatibility.
“特定版本”仅在编译时相关,在运行时不起作用。当设置为 False 时,当引用程序集的 [AssemblyVersion] 发生更改时,IDE 不会发出警告。这不是一个好主意,您应该意识到由于程序集发生更改而可能需要在代码中进行的更改。
CLR 不会在 GAC 中查找程序集的任何版本。仅接受完全匹配。这是默认策略,您可以使用应用的 .config 文件中的
覆盖它。Afaik,没有特定于 SQL Server 版本号的 SQL Server 提供程序。对此不太确定。
"Specific Version" is only relevant when you compile, it has no effect at runtime. When set to False, the IDE won't complain when the [AssemblyVersion] of the reference assembly has changed. Which is not that great an idea, you ought to be aware of the changes you might have to make in your code because the assembly changed.
The CLR will not look for any version of an assembly in the GAC. Only a exact match is accepted. That's the default policy, you can override it with a
<bindingRedirect>
in the app's .config file.Afaik, there isn't a provider for SQL Server that's specific to the SQL Server version number. Not quite sure about that.