【发布时间】:2019-01-03 09:48:01
【问题描述】:
我是 ASP.Net 的初级开发人员,但我遇到了错误: “引用未声明的实体‘nbsp’。第 69 行,第 41 位。”
我有两个几乎相同的功能:
public async Task<IEnumerable<ContactEcocert>> GetContactsEcocertAsync(Guid entityId)
{
RestRequest request = new RestRequest { Resource = "Entity/{entityId}/MyContactsEcocert" };
request.AddParameter("entityId", entityId, ParameterType.UrlSegment);
return await RestHelper.ExecuteAsync<List<ContactEcocert>>(request);
}
public async Task<IEnumerable<ContactEcocertSubsidiary>> GetContactSubsidiariesByEntityAsync(Guid entityId)
{
RestRequest request = new RestRequest { Resource = "Entity/{entityId}/contactSubsidiary" };
request.AddParameter("entityId", entityId, ParameterType.UrlSegment);
try
{
return await RestHelper.ExecuteAsync<List<ContactEcocertSubsidiary>>(request);
}
catch (Exception ex)
{
Trace.TraceError($"Erreur lors de la récupèration des filiales lié a l'entitée courante {entityId} : {ex.Message}");
throw;
}
}
第二个犯了这个错误:
“Reference to undeclared entity 'nbsp'. Line 69, position 41.”
我不知道在哪里可以找到第 69 行第 41 行,当我使用 Ctrl+F 查找“nbsp”时,我在代码中的任何地方都找不到它。
错误出现在该行:
return await RestHelper.ExecuteAsync<List<ContactEcocertSubsidiary>>(request);
我想检查我的文件 xml 但我不知道怎么做? 有什么可以搜索的想法吗?
【问题讨论】:
-
nbsp 通常是一个 非中断空间的符号。看看用 UTF8 编码字符串
-
Fuzzybear : 请问如何/在哪里可以找到这种编码?
标签: c# asp.net-mvc rest