我们在本地TeamCity服务器上有一些NuGet包,并在各种项目中使用它们.我刚刚从假期回来,从源代码中获取最新信息,并尝试重建,但由于缺少DLL而导致出现一堆编译错误.
似乎我们的一个软件包的DLL没有从NuGet下载.我尝试启动一个新的WPF项目,并添加了三个包.这三个都出现在packages.config文件中,但只有两个下载了DLL.第三个只下载了*.pdb文件.
团队中没有其他人有这个问题,我在我的备用机器上尝试了它,它下载得很好,所以看起来这是我的机器,Visual Studio或NuGet安装的问题.但是,因为我可以毫无问题地从同一个源获取其他包,所以看起来它不是VS或NuGet的全局问题.
我意识到没有太多可以继续下去,但我不知道还能告诉你什么.如果有人可以提出任何建议,我将非常感激.由于包源是我们自己的,不幸的是我无法分享.
我在Windows 10 Pro 64位(版本1607,版本14393.105)上使用Visual Studio Enterprise 2015 Update 3(内部版本14.0.25424.00)和NuGet包管理器版本3.4.4.1321.如果还有其他我可以添加的内容,请告诉我.
我有一个窗口,其中包含一个ItemsControl内部可以包含可变数量控件的窗口。为了考虑到超出窗口高度的情况,我将其包装在 a 中ScrollViewer,以便当项目数量超过可用高度时会显示滚动条。
现在的问题是,有时不会显示任何内容ItemsControl,有时却会显示。因此,我将网格行的高度设置为 ,Auto以允许 网格ItemsControl行在空时消失,或在需要时增长。但是,这意味着该行将占用所需的高度,即使这超出了窗口高度,并且永远不会显示垂直滚动条。
以下是演示该问题的示例窗口的一些 XAML...
<Window x:Class="DuplicateCustomerCheck.TestScrollViewerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Test Scroll Viewer Window"
Height="450"
Width="200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBox Name="N"
TextChanged="TextBoxBase_OnTextChanged"
Grid.Row="0"
Margin="3" />
<Grid Margin="3"
Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Possible duplicate of..."
Margin="3" />
<ScrollViewer VerticalScrollBarVisibility="Visible"
Grid.Row="1">
<ItemsControl Name="MatchingNames"
ItemsSource="{Binding MatchingNames, Mode=TwoWay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate> …Run Code Online (Sandbox Code Playgroud) VS2019 中的 ASP.NET ASP Core 2.2 和 EF。
\n\n我有Donation课...
public class Donation {\n public int Id { get; set; }\n // other properties...\n}\nRun Code Online (Sandbox Code Playgroud)\n\n到目前为止,所有捐款都被假定为英镑。我们想要添加对其他货币的支持,因此想要添加一个Currency类(最终会成为一个表),并有一个从到 的Currencies外键链接。我将以下代码添加到...DonationCurrencyDonation
public int CurrencyID { get; set; }\n\n [ForeignKey(nameof(CurrencyID))]\n public virtual Currency Currency { get; set; }\nRun Code Online (Sandbox Code Playgroud)\n\n...以及下面的课程...
\n\npublic class Currency {\n public int Id { get; set; }\n public string Code { get; set; }\n public string Symbol { get; …Run Code Online (Sandbox Code Playgroud) 在任何人投票关闭 this 作为this、this和许多其他类似问题的副本之前,请仔细阅读该问题,因为我认为它不是(即使它看起来非常相似)。
我有一个 Linq 查询如下...
List<int> ids = ctx
.Where(a => a.PartInformationTypeID == pitID && vals.Contains(a.PartDefinitionID))
.Select(a => a.SystemID)
.Distinct()
.ToList();
Run Code Online (Sandbox Code Playgroud)
...哪里pitID是一个int和vals是一个List<int>
这很好用,但是由于我有四个这样的查询,仅在Where子句中的 lambda 有所不同,我认为最好将代码提取到通用方法中...
private List<int> DoAdvancedSearch(Func<MyType, bool> p)
{
return ctx
.Where(a => p(a))
.Select(a => a.SystemID)
.Distinct()
.ToList();
}
Run Code Online (Sandbox Code Playgroud)
然后我可以这样称呼它......
List<int> ids = DoAdvancedSearch(systemIDs,
a => a.PartInformationTypeID == pitID && vals.Contains(a.PartDefinitionID))
Run Code Online (Sandbox Code Playgroud)
但是,此方法会产生运行时异常“ System.NotSupportedException: 'LINQ to Entities 中不支持 LINQ 表达式节点类型'Invoke'。” ”
阅读了大量具有相同异常的其他问题后,我设法通过如下更改方法来解决它...
private List<int> …Run Code Online (Sandbox Code Playgroud) c# ×2
asp.net-core ×1
entity-framework-migrations ×1
itemscontrol ×1
lambda ×1
linq ×1
nuget ×1
wpf ×1
xaml ×1