【发布时间】:2016-07-06 15:01:06
【问题描述】:
我使用 .NET Core RC2 编写了一个库,现在我将其更新为 RTM。迁移中没有问题,除了一个。出于某种原因,Visual Studio(以及 dotnet 实用程序)在 AssemblyInfo.cs 中引发有关 Guid 的错误:
“GuidAttribute”类型存在于两者中 'System.Runtime.InteropServices.PInvoke,版本=4.0.0.0, 文化=中立,PublicKeyToken=b03f5f7f11d50a3a' 和 'System.Runtime.InteropServices,版本=4.1.0.0
我不确定这里发生了什么。
这就是我的 AssemblyInfo.cs 的样子:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("My.Library")]
[assembly: AssemblyTrademark("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f89c2fd8-91f3-4f5a-87b6-094ee19712cf")]
都是通用的,由 Visual Studio 生成。
我的 project.json 也很简单:
{
"title": "My Library",
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.0",
"AWSSDK.Core": "3.2.4.1-beta",
"AWSSDK.EC2": "3.2.4.1-beta",
"System.Net.Primitives": "4.0.11",
"System.Threading.Tasks": "4.0.11",
"System.Collections": "4.0.11"
},
"frameworks": {
"netstandard1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},
"buildOptions": {
"xmlDoc": true
}
}
我真的不确定发生了什么,并且我开始认为该错误可能具有误导性。有没有我犯的错误但看不到?我该如何调试?
【问题讨论】:
-
我看到过类似这样的奇怪错误,这些错误已通过清除
bin/obj/artifacts文件夹(摆脱任何以前的构建)并确保您只是构建源文件。这对你有用吗? -
很遗憾没有:(
标签: .net asp.net-core .net-core