为什么在Visual Studio中的“添加引用”对话框中的.NET选项卡中没有列出GAC的内容是什么?选项卡、内容、对话框中、Studio

由网友(幻蓝式解脱)分享简介:复制的:Getting组件中的添加引用.NET选项卡显示 所以,我使用Visual C#2008例preSS版和我刚上有点绕路,因为我发现我的假设,即添加引用对话框列出的.NET选项卡在GAC的内容是不正确的。 So, I'm using Visual C# 2008 Express Edition and I'...

复制的:Getting组件中的添加引用.NET选项卡显示

所以,我使用Visual C#2008例preSS版和我刚上有点绕路,因为我发现我的假设,即添加引用对话框列出的.NET选项卡在GAC的内容是不正确的。

So, I'm using Visual C# 2008 Express Edition and I've just been on a bit of a detour as I found out that my assumption that the .NET tab of the 'Add Reference' dialog lists the contents of the GAC was incorrect.

这是一个有点问题,对我来说,我想从我的项目中引用的程序集只是在GAC可用。 (这是由XNA 2.0 redistributalbe获得Microsoft.XNA.Framework v2.0和据我可以看到它只能安装到GAC)。

This was a bit of a problem for me as the assembly that I wanted to reference from my project was only available in the GAC. (It was Microsoft.XNA.Framework v2.0 obtained from the XNA 2.0 redistributalbe and as far as I could see it installed only into the GAC).

我通过在.csproj的文件中手动设置参考Microsoft.XNA.Framework,然后让该DLL的一个副本从缓存中全面合作问题。我就能够创建一个目录为DLL,将其添加到组件目录的Visual Studio的列表中的注册表,然后瞧!我可以看到它在.NET选项卡。

I worked round the problem by setting the reference to Microsoft.XNA.Framework manually in the .csproj file and then getting a copy of the dll out of the cache. I was then able to create a directory for the DLL, add it to Visual Studio's list of assembly directories in the registry and then voila! I could see it in the .NET tab.

这一切似乎有点faff给我的,我不认为我的最初的假设(即.NET选项卡显示了GAC的内容)是不合理的,或将是不常见的。可谁知道有人比我更告诉我

This all seems like a bit of a faff to me and I don't think that my initial assumption (that the .NET tab shows the contents of the GAC) was that unreasonable or would be that uncommon. Can someone who knows more than me tell me

为什么GAC的内容不会显示?该文件只是说自己不是,但有一个很好的理由? 有没有实际的方式来获得海关总署的全部内容要上市?在方框内打勾,我错过了什么地方?

任何信息太多AP preciated。

Any info much appreciated.

推荐答案

您正在做的.NET选项卡是指海关总署的假设,但事实并非如此。这意味着已安装组件,其可以是或可以不是在GAC。一些安装在走程序文件和这些组件是那么明显,在.NET选项卡。

You're making the assumption that the .NET tab means GAC but it doesn't. It means installed assemblies, which may or may not be in the GAC. Some installations go under Program Files and those assemblies are then visible in the .NET tab.

当你添加一个引用到一个项目(忽略网站的项目,因为他们是一个私生子异常,需要DIAF).NET运行时将采用级联搜索,在可执行文件的目录开始找到组装,检查PATH环境变量,并结束在GAC。我没有一个链接,但MSDN上至少有一个很好的文章,专门介绍了这一点。

When you add a reference to a project (ignore Web Site projects, as they're a bastard child anomaly and need to DIAF) the .NET runtime will locate that assembly using a cascading search that starts in the executable directory, checks the PATH environment variable and ends in the GAC. I don't have a link, but there is at least one good article on MSDN that specifically explains this.

以上看起来可能没有直接关联这里,但它在这个意义上,当你开发你可以做一个参考装配的地方在开发机器上,但是当你发布你的应用程序到另一台机器生产使用,该程序集并不一定必须是在同一个地方,因为它是在开发机器上。当你开发你可以有组装地方,或在Program Files文件,但随后在另一台机器,如果该程序集是在GAC那么你的程序应该只是工作。

The above may not seem to directly correlate here, but it does in the sense that when you're developing you can make a reference to an assembly somewhere on your development machine, but then when you distribute your application to another machine for production use, that assembly doesn't necessarily have to be in the same place as it was on your development machine. When you're developing you can have the assembly local, or in Program Files, but then on another machine if that assembly is in the GAC then your program should just work.

(通常情况下,当您安装SDK安装程序将是足够聪明的创造需要显示的DLL在.NET选项卡上的注册表项。您的XNA框架例子可以归结为在安装运行包,而不是SDK或什么的。)

(Typically when you install an SDK the installer will be smart enough to create the registry entries needed to show the dll's in the .NET tab. Your XNA framework example may come down to you installing the runtime package instead of the SDK or something.)

希望有所帮助。

阅读全文

相关推荐

最新文章