我正在努力将我们的TeamCity项目从VS2012升级到VS2015,我遇到了编译MVC应用程序的问题.
旧的MSBuild(v4.0.30319.34209)在obj目录中生成一个文件,该文件MyApplication.Web.Mvc.dll.licenses显然是构建所必需的,但我们不知道该文件实际用于什么.
新的MSBuild(v14.0.23107.0)不会创建此MyApplication.Web.Mvc.dll.licenses文件,因此生成失败,并显示以下错误:
CSC error CS1566: Error reading resource 'MyApplication.Web.Mvc.dll.licenses'
-- 'Could not find file 'C:\BuildAgent\work\58ddf5f1234d8c8a\application\MyApplication\MyApplication.Web.Mvc\obj\Release\MyApplication.Web.Mvc.dll.licenses'.'
Run Code Online (Sandbox Code Playgroud)
我一直在机器上通过cmd手动运行构建,并且dll.licenses每当使用旧的msbuild运行构建时都会创建文件,而不是新的构建.
该文件在运行VS2015的开发计算机上创建,但不在Teamcity构建服务器上创建.所以在我看来其他东西已经过时了?
我正在向使用Crystal Reports API显示和打印表单的客户端部署桌面应用程序.我正在使用InstallShield 2012构建我的安装程序.我还包括.NET 4.0 Framework以及所有Crystal程序集.我有2个(有点相关)问题:
1)每当我尝试在客户端计算机上运行应用程序时,我都会收到以下错误:
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument'
threw an exception.
Run Code Online (Sandbox Code Playgroud)
我不知道我忘记了什么.所述CrystalDecisions.CrystalReports.EngineDLL在GAC被注册正确,因为是大约10其他Crystal组件.
2)我在SAP论坛上问过这个问题,我被告知需要将.NET 2.0 Framework与.NET 4.0 Framework一起包含在内.我尝试在我的安装程序包中包含.NET 2.0可再发行组件,但安装程序不会安装它.安装程序是否看到我安装了4.0,因此它会跳过2.0安装?
出于某种原因,我FileSystemWatcher没有发动任何事件.我想知道在我的目录中创建,删除或重命名新文件的任何时间._myFolderPath正确设置,我已经检查过了.
这是我目前的代码:
public void Setup() {
var fileSystemWatcher = new FileSystemWatcher(_myFolderPath);
fileSystemWatcher.NotifyFilter = NotifyFilters.LastAccess |
NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;
fileSystemWatcher.Changed += FileSystemWatcherChanged;
fileSystemWatcher.Created += FileSystemWatcherChanged;
fileSystemWatcher.Deleted += FileSystemWatcherChanged;
fileSystemWatcher.Renamed += FileSystemWatcherChanged;
fileSystemWatcher.Filter = "*.*";
fileSystemWatcher.EnableRaisingEvents = true;
}
private void FileSystemWatcherChanged(object sender, FileSystemEventArgs e)
{
MessageBox.Show("Queue changed");
listBoxQueuedForms.Items.Clear();
foreach (var fileInfo in Directory.GetFiles(_myFolderPath, "*.*", SearchOption.TopDirectoryOnly))
{
listBoxQueuedForms.Items.Add(fileInfo));
}
}
Run Code Online (Sandbox Code Playgroud) 背景:我的页面上有4个下拉列表,它们都使用一个List来SelectListItem从中提取数据.这些下拉列表中的所有4个将始终具有相同的元素.每个下拉列表顶部都有一个空元素.
问题:如果我没有从列表中选择呈现第二个的项目,则在页面加载时,第二个列表会自动选择在第一个列表中选择的项目.这是因为(我认为)列表有一个SelectListItemwhere Selected = true,它只是在第二个列表中使用那个.
有没有办法为多个下拉列表使用一个列表源?我不想重复这个清单4次,除非我绝对要......
代码:
//this is the list source
public IEnumerable<SelectListItem> PossibleItems { get; set; }
//this is the code on my .cshtml page
@Html.DropDownListFor(x => x.SelectedItem1, Model.PossibleItems)
@Html.DropDownListFor(x => x.SelectedItem2, Model.PossibleItems)
@Html.DropDownListFor(x => x.SelectedItem3, Model.PossibleItems)
@Html.DropDownListFor(x => x.SelectedItem4, Model.PossibleItems)
Run Code Online (Sandbox Code Playgroud) 我在我的角度应用程序中使用angular-route-segment并尝试从json feed配置段.
我已经有这个问题,因为我无法弄清楚如何注入$http到app.config功能.这失败了Unknown provider: $http
myApp.config(["$http", "$routeSegmentProvider", function ($http, $routeSegmentProvider) {
/* setup navigation here calling $routeSegmentProvider.when a number of times */
}
Run Code Online (Sandbox Code Playgroud)
因此,而不是注入$ HTTP到config,我也尝试注入$routeSegmentProvider到myApp.run
myApp.run(["$http", "$routeSegment", function($http, $routeSegment) {
/* can use $http here to get data, but $routeSegment is not the same here */
/* $routeSegment does not have the when setup method */
}]);
Run Code Online (Sandbox Code Playgroud)
我也试过了
myApp.run(["$http", "$routeSegmentProvider", function($http, $routeSegmentProvider)
Run Code Online (Sandbox Code Playgroud)
但我明白了 Unknown provider: $routeSegmentProviderProvider <- $routeSegmentProvider
自从最新的Java更新以来,我的两个applet正在向我们的用户显示警告弹出窗口,即使jar我们使用的两个文件都已签名.我已经验证他们是使用jarsigner -verify MyJarFile.jar命令签名的.以下是我们看到的弹出消息......

我的applet通过JNI调用C++ DLL.C++ dll调用C#netmodule.
有谁知道我能做些什么来让这个弹出窗口消失?它说应用程序包含签名和未签名的代码,但我在我的jar文件中签署每个java文件(只有1个).我需要做更高级别的签名吗?
编辑:这是在最新的Java更新时发生的.请参阅以下摘自本页的报价.
使用Java applet或Java Web Start技术部署的应用程序的作者和供应商 - 通过Web浏览器或网络在运行时分发给最终用户的应用程序 - 应使用可信证书签署其代码,以获得最佳用户体验.具体而言,在客户端浏览器中执行的所有Java代码都将提示用户.提供的对话框消息类型取决于风险因素,如代码签名或未签名,代码请求提升权限,JRE高于或低于安全基线等.低风险方案提供非常小的对话框并包含一个不显示类似对话框的复选框将来由同一供应商提供.考虑到风险增加,更高风险的情况,例如运行未签名的罐子,将需要更多的用户交互.
我已经看到了许多自动化我的InstallShield构建的解决方案,但我遇到了每个问题.我正在使用InstallShield Professional 2013.抱歉这个冗长的问题,但我无法解决我的问题.
1)IsCmdBld.exe - 我有一个运行的脚本,将构建我的安装程序.但是,当安装程序运行时,我收到一条错误消息"The System Administrator has set policies to prevent this installation".我不确定为什么会发生这种情况,但如果我通过设计器构建安装程序,则不会收到相同的错误消息.编辑:这是我的命令(%guid%是我生成的用于设置产品代码的Guid):
for /f %%i in ('"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\uuidgen.exe"') do set guid=%%i
"C:\Program Files (x86)\InstallShield\2013 SP1 SAB\System\ISCmdBld.exe" -p "MyInstaller.ism" -r SingleImage -y "1.0.0.13" -z ProductCode=%guid%
Run Code Online (Sandbox Code Playgroud)
2)InstallShield自动化接口 - 我已经遵循了许多关于此的示例和教程,但都以相同的结果结束.当我调用以下代码时:
var project = new ISWiAuto20.ISWiProject();
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Unable to cast COM object of type 'System.__ComObject' to interface type
'ISWiAuto20.ISWiProject'. This operation failed because the QueryInterface call
on the COM component for the interface with IID '{872D23A7-C18D-468C-895D-1CF027E4FBB1}' …Run Code Online (Sandbox Code Playgroud) 如何配置ILogger写到其他位置?我想将日志写入C:\Logs\MyLogFile.log。
我正在这样设置我的习惯LoggerFactory:
app.Properties["server.LoggerFactory"] = new MyCustomLoggerFactory();
Run Code Online (Sandbox Code Playgroud)
MyCustomLoggerFactory 看起来像这样:
public class MyCustomLoggerFactory: ILoggerFactory
{
public ILogger Create(string name)
{
return new CustomLogger();
}
}
Run Code Online (Sandbox Code Playgroud)
然后,ICustomLogger接口和CustomLogger类如下所示:
public interface ICustomLogger : ILogger
{
}
public class CustomLogger : ICustomLogger
{
public bool WriteCore(TraceEventType eventType, int eventId, object state,
Exception exception, Func<object, Exception, string> formatter)
{
throw new NotImplementedException("Dont use this one dummy");
}
}
Run Code Online (Sandbox Code Playgroud)
没有办法设置写入日志文件的LogLevel或Url吗?理想情况下,我也想为此使用log4net。
我想基于其他孩子div的高度动态调整我的孩子div的宽度.这很难解释,所以我只会展示一些图片......
在第一张图片中,黑色方块是我的"父"div.它包含其他高度不同的div.蓝色div的高度是静态的,但必须浮动到右侧.红色的div是我遇到的问题.如果它们出现在蓝色div的底部下方,它们应该自动调整自己的宽度.
高度较小的第二个红色div.看看最后一个div如何适应父div的宽度.

高度较大的第二个红色div.现在底部2 div的宽度都适合父div.

还有一个例子......

我不确定我是否应该使用特殊定位,或者如何构建div.如果蓝色div下方有一点空间,那就好了,我只想在红色div之间有相同的空间.
这就是我所建立的.看到黄色div隐藏在右边的蓝色div后面:http://jsfiddle.net/MVzHS/1/
#floatRight {
width: 100px;
height:200px;
background-color:blue;
position: absolute;
right:10px;
top:10px;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用 nHibernate 处理一个小型 POC 应用程序。这是我第一次自己设置 nHibernate,但我之前已经使用过它。由于某种原因,我的查询没有返回任何数据。Product我可以确认我的数据库中有一个。
public class NHibernateHelper
{
private static String _connectionString =
@"Server=localhost\SQLEXPRESS;Database=TestProject;User ID=TestProjectMvc;Password=Pa$$word";
private static ISessionFactory _sessionFactory;
private static ISessionFactory SessionFactory
{
get
{
if (_sessionFactory == null)
InitializeSessionFactory();
return _sessionFactory;
}
}
private static void InitializeSessionFactory()
{
_sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(_connectionString).ShowSql()
).Mappings(m => m.FluentMappings.AddFromAssemblyOf<Product>())
//.ExposeConfiguration(cfg => new SchemaExport(cfg).Create(true, true))
.BuildSessionFactory();
}
public static ISession OpenSession()
{
return SessionFactory.OpenSession();
}
}
Run Code Online (Sandbox Code Playgroud)
我的映射类:
public class ProductMap : ClassMap<Product>
{
public ProductMap()
{
Id(x => x.Id); …Run Code Online (Sandbox Code Playgroud) c# ×6
asp.net-mvc ×2
msbuild ×2
.net ×1
angularjs ×1
applet ×1
css ×1
css-position ×1
deployment ×1
html ×1
jar-signing ×1
jarsigner ×1
java ×1
log4net ×1
logging ×1
nhibernate ×1
owin ×1
teamcity ×1