VS 2017不会创建AssemblyInfo.cs [英] VS 2017 does not create AssemblyInfo.cs

查看:77
本文介绍了VS 2017不会创建AssemblyInfo.cs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我是C#的新手,我的目标是在Win10机器上使用VS 2017中的C#创建一个COM可见类。

I am very new to C# and I aim to create a COM visible class using C# in VS 2017 on a Win10 machine.

我的测试类工作正常,但我试图设置"注册COM互操作"属性群组。我研究过使用"装配信息"按钮打开"装配信息"对话框但该按钮不存在。 
我没有 项目属性下的AssemblyInfo.cs文件。

My test class works ok, but I am trying to set the "Register for COM interop" attribute.  I have researched using the "Assembly Information" button to open the Assembly Information dialog box but the button does not exist.  I don't have  an AssemblyInfo.cs file under the project Properties either.

我已经研究过这个问题的解决方案,但在网上找不到任何东西。 我甚至尝试手动创建AssemblyInfo.cs文件,但也失败了。请告知我的错误。

I have researched for a solution to this problem but can't find anything on the web.  I even tried to create the AssemblyInfo.cs file manually but that failed too. Please advise what I am doing wrong.

谢谢,

保罗

推荐答案

您好,为了重现您的问题,我已从项目中删除了AssemblyInfo.cs文件。如果我更改"装配信息"中的任何字段,则会自动恢复该文件。设置。复选框"注册COM互操作"在
"Build"上如果"类库",则它处于活动状态。在"应用程序"中选择输出类型。 tab。



当您尝试创建该文件时,您是否只是将其复制到"属性"中。文件夹或右键单击"属性"? - > "新物品......"并选择"装配信息文件" ?。$


最后,您可以创建一个具有相同名称的新项目,并使用其中的代码移动文件。
Hi, To reproduce your problem, I have removed the AssemblyInfo.cs file from my project. The file is automatically recovered if I change any field in the "Assembly Information" settings. Checkbox "Register for COM interop" is on the "Build" tab, it is active if the "Class Library" output type is selected in the "Application" tab.

When you tried to create the file, did you just copy it to the "Properties" folder or did you right click on "Properties" -> "New Item ..." and selected "Assembly Information File" ?.

Finally, you can create a new project with the same name and move files with the code there.


这篇关于VS 2017不会创建AssemblyInfo.cs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆