我有一个VS2013安装项目,它构建安装由两个C#项目生成的exes的设置.当我构建安装项目时,我得到重复的消息,好像有两个构建过程.我从安装项目的输出中删除了两个exes中的一个,但我仍然得到重复的消息.
------ Starting pre-build validation for project 'SetupWindowsService' ------
------ Starting pre-build validation for project 'SetupWindowsService' ------
------ Pre-build validation for project 'SetupWindowsService' completed ------
------ Pre-build validation for project 'SetupWindowsService' completed ------
2>------ Build started: Project: SetupWindowsService, Configuration: Release ------
2>------ Build started: Project: SetupWindowsService, Configuration: Release ------
Building file 'C:\projects\SetupTESTWindowsService\Release\SetupWindowsService.msi'...
Building file 'C:\projects\SetupTESTWindowsService\Release\SetupWindowsService.msi'...
Packaging file 'MoreLinq.dll'...
Packaging file 'MoreLinq.dll'...
Packaging file 'System.Web.Razor.dll'...
Packaging file 'System.Web.Razor.dll'...
................
Run Code Online (Sandbox Code Playgroud)
所有dll依赖项都是重复的.构建项目产生的输出是可以的(即msi文件).TargetPlatform是x86.在配置管理器中,Active解决方案平台是Any CPU,Active解决方案配置是Release.安装项目所依赖的所有项目都是Release/Any CPU.
这是正常的吗?我正在使用在Win 7 64位Ultimate上运行的VS 2013 Premium Update 3.
谢谢
只是更新:我在notepad …
所以标题基本上解释了这一切.每当我尝试导入资源时,Visual Studio都会创建一个Resources1.Designer.vb文件,而不是将新的资源属性添加到Resources.Designer.vb.
我找到了一个临时解决方案:打开Resources1.Designer.vb,搜索属性,将属性复制/粘贴到Resources.Designer.vb中,然后删除Resources1.Designer.vb.
这个解决方案非常耗时.有没有其他人经历过这个,或者有没有人知道真正的/真正的解决方案?我在这里搜索过谷歌和MSDN.MSDN有一篇来自VS 2010的文章,但没有提出真正的解决方案.
因此,为了澄清,这种情况随时通过任何导入资源的方法发生.Project,Properties,Add Existing,... SelectedControl,Properties Pane,Image,Import Project Resource,或双击My Project,Resources.resx,然后Add Existing.
使用的软件:Windows 7 64位Ultimate,.Net 4,SQL Server 2008 R2.
select @@ version返回:
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64) Apr 22 2011 19:23:43 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
Run Code Online (Sandbox Code Playgroud)
要重现,并假设您有本地sql server 2008 R2实例,请将以下代码粘贴到linqpad中并将其作为程序运行.
它爆炸了:
链接服务器'(null)'的OLE DB提供程序'STREAM'返回列'[!BulkInsert] .Value'的无效数据.
void Main()
{
SqlConnection cn = new SqlConnection("data source=localhost;Integrated Security=SSPI;initial catalog=tempdb;Connect Timeout=180;");
cn.Open();
IList<decimal> list = new List<decimal>() {-8m, 8m};
decimal result = list.Sum(x => x);
Console.WriteLine(result == 0);
string tableName …Run Code Online (Sandbox Code Playgroud) 我有这个代码我在linqpad中运行:
long x = long.MaxValue;
decimal y = x;
x.Dump();
y.Dump();
(x == y).Dump();
(y == x).Dump();
Object.Equals(x, y).Dump();
Object.Equals(y, x).Dump();
x.Equals(y).Dump();
y.Equals(x).Dump();
Run Code Online (Sandbox Code Playgroud)
它产生这个输出:
9223372036854775807
9223372036854775807
True
True
False
False
False
True
Run Code Online (Sandbox Code Playgroud)
注意最后两行:x.Equals(y)为false但y.Equals(x)为true.因此,十进制认为自身等于具有相同值的long,但long不认为自己等于具有相同值的十进制.
这种行为的解释是什么?
更新:
我接受了Lee的回答.
我对此非常好奇并写了这个小程序:
using System;
namespace TestConversion
{
class Program
{
static void Main(string[] args)
{
long x = long.MaxValue;
decimal y = x;
Console.WriteLine(x);
Console.WriteLine(y);
Console.WriteLine(x == y);
Console.WriteLine(y == x);
Console.WriteLine(Object.Equals(x, y));
Console.WriteLine(Object.Equals(y, x));
Console.WriteLine(x.Equals(y));
Console.WriteLine(y.Equals(x));
Console.ReadKey();
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我在IL中反汇编:
.method private hidebysig …Run Code Online (Sandbox Code Playgroud) 我想用out参数定义一个Lambda表达式.有可能吗?
以下是我尝试过的C#.Net 4.0控制台应用程序的代码片段.
正如您在Procedure25中看到的,我可以使用lambda表达式来定义具有输出参数的委托,但是,当我想使用linq表达式执行相同操作时,过程24中的代码将失败:
System.ArgumentException未处理Message = ParameterExpression类型'System.Boolean'不能用于'System.Boolean&'Source = System.Core类型的委托参数
我知道我可以使用带有bool成员的输入类对象并将值传递给调用者,但是如果我能以某种方式定义参数,我很好奇.
谢谢
static void Main(string[] args)
{
Procedure25();
Procedure24();
Console.WriteLine("Done!");
Console.ReadKey();
}
private delegate int Evaluate(string value, out bool usesVars);
private static void Procedure24()
{
// This fails to compile:
//Expression<Evaluate> x = (string val, out bool usesSimVals) =>
//{
// usesSimVals = true;
// Console.WriteLine(val);
// return 1;
//};
ParameterExpression valueParameter = Expression.Parameter(typeof (string));
MethodCallExpression methodCall = Expression.Call(typeof(Console).GetMethod("WriteLine", new Type[] { typeof(object) }), valueParameter);
bool usesVars;
ParameterExpression usesVarsParameter …Run Code Online (Sandbox Code Playgroud) 我有一个名为VR的Delphi项目,它生成一个名为VR.exe的可执行文件.令我沮丧的是,我发现Windows(我正在运行Window 7 64位Ultimate)添加了开始菜单和游戏下的链接:搜索和救援:越南MED + EVAC.链接的图标是默认的delphi应用程序图标.
做了一些研究,我找到了这篇文章:
如何阻止Windows执行此操作?
更新:我有另一个项目MM,它生成mm.exe.这个创建了Steam Dark Messiah Might和Magic Single Player的链接.
另一个更新:我们向Microsoft提交了支持请求.他们承认这是一个错误,然而,他们未能提供修复的时间表.
更新:这是微软的答案:
我写信通知你,这个问题在我们的最后是可以重现的,我们也在过去报道了这个问题.由于这已经被我们的代码确定为"按设计",并且到目前为止我们没有对此进行解决,因此我无法提供帮助.但是,如果您有任何想要了解的信息,例如它如何影响业务或任何其他问题,请告诉我.
我接受了雷米的回答.
我在以下媒体上看到了这篇文章:https : //medium.com/@odomontois/tagless-unions-in-scala-2-12-55ab0100c2ff。我很难理解其中的一段代码。文章的完整源代码可以在这里找到:https : //github.com/Odomontois/zio-tagless-err。
代码是这样的:
trait Capture[-F[_]] {
def continue[A](k: F[A]): A
}
object Capture {
type Constructors[F[_]] = F[Capture[F]]
type Arbitrary
def apply[F[_]] = new Apply[F]
class Apply[F[_]] {
def apply(f: F[Arbitrary] => Arbitrary): Capture[F] = new Capture[F] {
def continue[A](k: F[A]): A = f(k.asInstanceOf[F[Arbitrary]]).asInstanceOf[A]
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的问题:
谢谢!
更新:
第一个问题:
根据规格,如果缺少上限,则假定为“任意”。因此,任意处理被视为任意,但是,它似乎无法与任意互换。
这样编译:
object Test {
type Arbitrary
def test(x: Any): Arbitrary = x.asInstanceOf[Arbitrary] …Run Code Online (Sandbox Code Playgroud) 我需要启用或禁用按钮,具体取决于列表中是否至少选择了一行.
以下是重现此问题的代码.使用OnData事件填充列表,它允许选择多行.
我以为我可以使用OnSelectItem来检测用户何时更改选择,然后使用TListView SelCount函数来检测所选行的数量.
问题是当用户选择多行时,SelCount返回0.如果手动填充列表(即不通过OnData事件),这可以正常工作.
有任何想法吗?
谢谢
更新:使用OnChange事件似乎可以解决问题.仍然有趣的是,当选择多行时(从SelectItem事件中),SelCount为什么返回0.
另一个更新:我发布了一个测试项目:https://dl.dropboxusercontent.com/u/35370420/TestListView2.zip以及截图:
要重现此问题,请运行应用程序,选择Item1,然后按SHIFT +单击Item2.该按钮被禁用.我的目的是只要在列表中选择了至少一个项目,就动态启用按钮.如果没有选定项目,则禁用该按钮.
PAS文件:
unit MainUnit;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls;
type
TForm3 = class(TForm)
ListView1: TListView;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure ListView1Data(Sender: TObject; Item: TListItem);
procedure ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
begin
ListView1.Items.Count := 5;
end;
procedure …Run Code Online (Sandbox Code Playgroud) 我有一个控制台应用程序c#项目依赖于NHibernate 3.3.2和ShapArch.NHibernate 2.0.4.628,它已经用NHibernate 3.3.1编译(据我所知 - 我可能错了,但是当我创建了一个2.0.4时SharpArch项目它通过Nuget下载了NH 3.3.1.
当引用的dll为3.3.2.4000时,为什么Visual Studio将NHibernate显示为版本3.3.1.4000?对于所有引用,"特定版本"属性都设置为false.SharpArch的版本出现在VS 2.0.0.0而不是2.0.4,这是文件/产品版本.
在app配置中我有:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.2.4000" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Run Code Online (Sandbox Code Playgroud)
该应用无法加载:
System.IO.FileLoadException was unhandled
Message=Could not load file or assembly 'NHibernate, Version=3.3.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=MyApp.ResourcesGenerator
FileName=NHibernate, Version=3.3.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
FusionLog=""
StackTrace:
at MyApp.ResourcesGenerator.Program.InitializeNHibernateSession()
at SharpArch.NHibernate.NHibernateInitializer.InitializeNHibernateOnce(Action initMethod) in d:\Builds\SharpArch2\Solutions\SharpArch.NHibernate\NHibernateInitializer.cs:line 54
at MyApp.ResourcesGenerator.Program.Initialize() in C:\projects\tc\Trunk\Source_LibsUpgrade\Applications\PerformanceManagement\MyApp.ResourcesGenerator\Program.cs:line …Run Code Online (Sandbox Code Playgroud) 目前的文件说:
定义是否必须在结束时或直接在文档中关闭非闭合节点.将此设置为true实际上可以更改浏览器呈现页面的方式.默认值为false.
对不起,我不得不承认我不明白这一段.具体"到底"是什么?"文档中"的含义究竟是什么意思?在最后一个之前的短语听起来不祥.如果该选项设置为true并且html格式正确,这仍然会影响文档吗?
我查看了源代码,但我不明白发生了什么 - 代码对该属性的反应没有设置为true.请参阅HtmlNode.cs,并搜索OptionAutoCloseOnEnd - 第1707行.我还在第1113行和第1154行的HtmlWeb.cs中找到了一些时髦的代码.太糟糕了,源代码浏览器不显示行号,而是在页面中搜索OptionAutoCloseOnEnd.
您能否举例说明这个选项的作用?
我正在使用HtmlAgilityPack来修复一些糟糕的HTML并将页面内容导出到xml.
我遇到了一些格式错误的html - 重叠标签.这是片段:
<p>Blah bah
<P><STRONG>Some Text</STRONG><STRONG></p>
<UL>
<LI></STRONG>Item 1.</LI>
<LI>Item 2</LI>
<LI>Item 3</LI></UL>
Run Code Online (Sandbox Code Playgroud)
请注意,第一个p标记未关闭,请注意重叠的STRONG标记.
如果我设置OptionAutoCloseOnEnd,这将得到某种程度的修复.我试图了解在文档结构中将此属性设置为true的确切效果是什么.
这是我正在使用的C#代码:
HtmlDocument doc = new HtmlDocument();
doc.OptionOutputAsXml = true;
doc.OptionFixNestedTags = true;
// doc.OptionAutoCloseOnEnd = true;
doc.LoadHtml(htmlText);
Run Code Online (Sandbox Code Playgroud)
谢谢!
c# ×3
c#-4.0 ×3
.net ×2
delphi ×2
delphi-xe5 ×2
.net-4.0 ×1
linq ×1
nhibernate ×1
scala ×1
sqlbulkcopy ×1
tlistview ×1
vcl ×1
zio ×1