gpt4 book ai didi

Assemblyinfo.cs is not generated correctly ,Newline in constant, errors(ASSEMBLYINFO.cs未正确生成,换行符为常量,错误)

转载 作者:bug小助手 更新时间:2023-10-25 12:41:05 27 4
gpt4 key购买 nike



Every time I create a new project for WPF a n AssemblyInfo.cs is generated, but there are several "CS1010 Newline in constant" Errors.
I have to go to the file and edit them manually every time. I would like to fix this permanently, but I cannot find any info on how where the data is pulled from to generate the file.

每次我为WPF创建一个新项目时,都会生成一个n Assembly Info.cs,但有几个“CS1010 Newline in Constant”错误。我每次都要去文件里手动编辑它们。我想永久解决这个问题,但我找不到任何关于如何从哪里提取数据以生成文件的信息。


The parts of the file that give me the error are the same two:

出现错误的文件部分有两个相同的部分:


[assembly: AssemblyCompany("
")]

AND


[assembly: AssemblyCopyright("Copyright © 
2023")]

This is the way they show. I single line them manually for now...

这就是他们展示的方式。我现在用手划一条线……


更多回答

Did u try repair or reinstall Visual Studio? The AssemblyInfo.cs file is typically generated by Visual Studio based on the project properties, and it should be automatically formatted correctly.

您是否尝试过修复或重新安装Visual Studio?AssemblyInfo.cs文件通常由Visual Studio根据项目属性生成,并且应该自动正确设置格式。

优秀答案推荐

AssemblyInfo.cs file: Property file containing program version, information, and copyright.
The AssemblyCompany and AssemblyCopyright you mentioned in the above file are generated by Visual Studio by reading computer information, so we need to consider this issue from two aspects.

Assembly Info.cs文件:包含程序版本、信息和版权的属性文件。您在上面文件中提到的AssemblyCompany和Assembly Copyright是由Visual Studio通过读取计算机信息生成的,所以我们需要从两个方面来考虑这个问题。


1. Issues with the computer itself.

1.计算机本身的问题。


Go to the registry to view relevant information.

到注册处查看相关信息。


32 system:

32系统:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion


64-bit systems:

64-位系统:


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\当前版本


Find and modify the values of RegisteredOrganization and RegisteredOwner in CurrentVersion (you can modify them to the values you want, try not to include special symbols or make them empty).

在CurrentVersion中查找并修改RegisteredOrganization和RegisteredOwner的值(您可以将它们修改为所需的值,尽量不包含特殊符号或将其设置为空)。


enter image description here


2. Visual Studio issue.

2.Visual Studio问题。


Please try to use the Visual Studio installation tool to fix it here. If it still doesn't work, you can try reinstalling Visual Studio.

请尝试使用Visual Studio安装工具在此处修复它。如果仍然不起作用,您可以尝试重新安装Visual Studio。


更多回答

Thanks for the suggestion! I see thise fields are already populated correctly , but not read correctly by VS. I have tried to use net 7.0 when creating more projects and that seems to have bypassed the issue. Our Site support is now looking into why VS do not read those values correctly.

谢谢你的建议!我看到这些字段已经正确填充,但VS没有正确读取。我尝试在创建更多项目时使用NET7.0,但这似乎绕过了这个问题。我们的站点支持现在正在调查为什么VS没有正确读取这些值。

@FilippoSantarelli Using .net 7.0 has better compatibility with win10 and win11. Very glad you were able to resolve this issue

@FilippoSantarelli使用.Net 7.0与Win10和Win11有更好的兼容性。很高兴你能解决这个问题

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com