所以我使用Visual Studio 2017,一切正常.但后来我更新到15.6.0,突然间什么都没有了.
所有引用如Systme.*或Microsoft.*都带有黄色警告标志......
在每个项目 - 甚至是新项目 - 我(重新)建设之后我都会得到相同类型的错误:
The "ResolveAssemblyReference" task could not be initialized with its input parameters
The "ResolveAssemblyReference" task could not be initialized with its input parameters
The "FindDependenciesOfExternallyResolvedReferences" parameter is not supported by the "ResolveAssemblyReference" task. Verify the parameter exists on the task, and it is a settable public instance property
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them
Run Code Online (Sandbox Code Playgroud)
我已经尝试重新安装Visual Studio 2017,重新安装.NET Framework,但我仍然在 …
如果您有多个参数在调用命令或脚本时需要一个值,我知道您可以像这样传递它:
$parameters = @{
name = "John"
last_name = "Doe"
}
Run Code Online (Sandbox Code Playgroud)
但是,如果命令或脚本实际上只是希望-T指示诸如标志之类的东西,但参数本身不需要值。如何在变量中设置它?
$optionalT = ""
if ($itNeedsTheT) $optionalT = "-T"
command $optionalT
Run Code Online (Sandbox Code Playgroud)
如果我这样做,它会抱怨以下消息:
Unknown argument 'T' on command line.
Run Code Online (Sandbox Code Playgroud) 我创建了一个只生成随机 GUID 的控制台应用程序,但我注意到它一直4在同一个位置有一个...为什么会这样?
这是我的代码:
Sub Main()
Dim generatedGuids = New List(Of String)
Dim duplicateGenerated As Boolean = False
Dim index As ULong = 0
While Not duplicateGenerated
Dim generatedGuid As String = Guid.NewGuid.ToString
generatedGuids.Add(generatedGuid)
duplicateGenerated = generatedGuids.Count <> generatedGuids.Distinct.Count
index += 1
Console.WriteLine(index & " - " & generatedGuid)
End While
Console.WriteLine("FOUND A DUPLICATE")
End Sub
Run Code Online (Sandbox Code Playgroud)
(它在 VB.Net 中,因为我刚刚参加了一些在线课程,并且正在玩弄它。)
这是一个屏幕截图:
如您所见,每个生成的 GUID4在完全相同的位置都有一个...有谁知道为什么?
因此,在 SignalR 中,您可以使用以下命令将客户端添加到组中
Groups.Add(connectionId, roomName)
Run Code Online (Sandbox Code Playgroud)
您可以使用以下命令从组中删除客户端
Groups.Remove(connectionId, roomName);
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能清空一个组——换句话说,只删除该组中的所有客户端呢?
更新:这不是重复的,因为我问如何从一个组中删除所有客户端。我并不是要求从所有组中删除一个客户。
我们有一个在服务计划中运行的应用服务,其存储限制为 50GB。
应用服务是服务计划的唯一组成部分。
我们有一个 .NET Web 服务在D:\home\site\services>一个文件夹上运行,我们定期在其中创建.docx和.pdf文件。
几个月前,我们只是There is not enough space on the disk在该上传文件夹中存储了多个 GB 之后才收到。但过了一段时间,这个异常越来越快地被抛出——我们通过清空上传文件夹来解决这个问题。
到现在为止,当上传文件夹中的文件甚至少于 100 个时,我们都会收到此异常。虽然应用服务的总存储量只有 400MB/50GB...
这是堆栈跟踪的顶部:
System.IO.IOException: There is not enough space on the disk.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
at Xceed.Words.NET.DocX.Save()
at Xceed.Words.NET.DocX.SaveAs(String filename)
Run Code Online (Sandbox Code Playgroud)
有谁知道我们做错了什么?
编辑:应用服务和应用服务计划都有 50GB 的配额。我根本没有看到任何存储限制。
我目前使用一个类库来存储一个使用 log4net 处理日志记录的类。此类用于其他项目。
我已经阅读了很多其他问题和答案,但我还没有解决它......
我启用了 log4net 的内部调试,因为它不会写入文件,这是我得到的错误:
log4net:ERROR Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
Run Code Online (Sandbox Code Playgroud)
这些是我的文件: log4net.config
<log4net debug="true">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<param name="File" value="Logs/log4net.log" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="Header" value="[Header]\r\n" />
<param name="Footer" value="[Footer]\r\n" />
<param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="LogFileAppender" …Run Code Online (Sandbox Code Playgroud) 我目前正在使用实体框架,并且有一个有关内部联接的性能问题。
根据一般性能,以下 2 种情况中哪一种是最好的?
为了简单起见,我们假设兄弟姐妹之间存在一对一的关系。
(1)内连接:
EFContext context = new EFContext();
int myId = GetMyOwnId();
Person me = context.People
.Include(p => p.Father)
.Include(p => p.Mother)
.Include(p => p.Brother)
.Include(p => p.Sister)
.Where(p => p.ID == myId);
return me;
Run Code Online (Sandbox Code Playgroud)
(2)可选的多个查询:
EFContext context = new EFContext();
int myId = GetMyOwnId();
Person me = context.People
.Where(p => p.ID == myId);
if (me.FatherId.HasValue)
me.Father = context.People.Find(me.FatherId);
if (me.MotherId.HasValue)
me.Mother = context.People.Find(me.MotherId);
if (me.BrotherId.HasValue)
me.Brother = context.People.Find(me.BrotherId);
if (me.SisterId.HasValue)
me.Sister = context.People.Find(me.SisterId);
return …Run Code Online (Sandbox Code Playgroud)