我正在使用Visual Studio 2008中的Asp.Net 3.5开发一个网站,我们使用Crystal Reports 10(这是vs2008的结合).
去年,我们将其迁移到Visual Studio 2010,但我们仍然在我们的网站上使用.Net 3.5.Vs2010不附带Crystal Reports,因此我们从SAP业务对象下载Crystal 13(针对vs2010)并安装在我的开发机器(Sdk套件和运行时)中.
它工作正常,我们将web.config中的引用从Crystal 10更改为Crystal 13,并且它在我们的开发机器中工作.
我们仍然使用Asp.Net 3.5.
现在问题是...我在我们的服务器中托管我的网站(我也安装了运行时),我得到了一个消息:
"无法加载文件或程序集'CrystalDecisions.ReportAppServer.ClientDoc,Version = 13.0.2000.0,Culture = neutral,PublicKeyToken = 692fbea5521e1304'或其中一个依赖项.系统找不到指定的文件."
在web.config中异常:
有谁能够帮我 ?是否可以使用.Net 3.5与Crystal 13?或者Crystal的其他解决方案(版本)?
编辑
<compilation debug="false" strict="false" explicit="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, …Run Code Online (Sandbox Code Playgroud) 这是跟踪:
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>
Type 'ProjectName.Web.Api.Controllers.ContinentsController' does not have a default constructor
</ExceptionMessage>
<ExceptionType>System.ArgumentException</ExceptionType>
<StackTrace>
at System.Linq.Expressions.Expression.New(Type type)
at System.Web.Http.Internal.TypeActivator.Create[TBase](Type instanceType)
at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1& activator)
at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
</StackTrace>
</Error>
Run Code Online (Sandbox Code Playgroud)
我觉得这很奇怪,public class UsersController : ApiController { ... }工作得很好.我比较了2个控制器,所有设置和结构都相似.
我正在使用Ninject我的系统设置类似于Jamie Kurtz Asp.Net Mvc 4和Web Api:从开始到完成构建REST服务.
从堆栈跟踪,是否有人能够发现问题以及如何解决它?谢谢!
按照要求.
ContinentsController
[LoggingNHibernateSession]
public class ContinentsController : ApiController
{
private readonly ISession _session;
private readonly IContinentMapper _continentMapper;
private readonly …Run Code Online (Sandbox Code Playgroud) c# ninject inversion-of-control asp.net-mvc-4 asp.net-web-api
这是我的html:
<div id="l">l</div>
<div id="a">a</div>
<div id="i">i</div>
Run Code Online (Sandbox Code Playgroud)
如何只改变颜色l,并a归结元素?我用OR搜索了一个选择器,类似这样:
$(function(){
$('div[id=l,a]').css('color','red');
});
Run Code Online (Sandbox Code Playgroud)
它不起作用,在jQuery中有类似的东西吗?
编辑 谢谢大家现在的工作:
$('[id=l], [id=a]').css('color', 'red');
Run Code Online (Sandbox Code Playgroud)
但是,如果我想在<div>类似的内部搜索这些ID,该怎么办$('[id=l], [id=a]','div')?这不起作用,我应该怎么做?
从页面我有以下内容:
@using (Html.BeginForm("AddEntry", "Configure", FormMethod.Get, new { returnUrl = this.Request.RawUrl }))
{
@Html.TextBox("IP")
@Html.Hidden("TypeId", 1)
<input type="submit" value="@Resource.ButtonTitleAddComponent" />
}
Run Code Online (Sandbox Code Playgroud)
所以控制器被正确调用:
public ActionResult AddEntry(string ip, int TypeId, string returnUrl)
{
// Do some stuff
return Redirect(returnUrl);
}
Run Code Online (Sandbox Code Playgroud)
我的问题是returnUrl获取null并且它不会重定向到调用控制器的同一页面.想法?
使用:ASP.NET MVC 4 Razor
我在我的机器上安装了Visual Studio 2012 Professional.我没有安装Visual Studio 2010,但我想继续使用.NET Framework 4开发我的应用程序,但我的Visual Studio 2012上没有此选项.请查看图像:

我不知道如何解决这个问题,因为我点击"更多框架..."链接并尝试安装Multi-Targeting for .NET 4.0.3(安装在我的机器上),但它确实如此不行.它说这个版本的框架仍然安装.我该怎么做才能解决这个问题?
Obs:我在C++和VB.NET中使用.NET 4.0有很多项目,我需要在.NET 4.0上使用新项目保留这些项目.
我有一个用Windows Service编写的应用程序,这个应用程序需要调用用Asp.Net MVC 4 WebAPi编写的WebAPI.WebAPI中的此方法返回具有基本类型的DTO,如:
class ImportResultDTO {
public bool Success { get; set; }
public string[] Messages { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
在我的webapi
public ImportResultDTO Get(int clientId) {
// process.. and create the dto result.
return dto;
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何从Windows服务中调用webApi?我有我的URL和参数值,但我不知道如何调用以及如何将xml结果反序列化到DTO.
谢谢
我使用VS 2012年我的NuGet安装EntityFramework(6.1.1版本),并添加引用的System.Data和System.Data.Entity,但是当我在溶液中闯民宅的DbContext打开一个新的类,它说:
"无法找到类型或命名空间名称'DbContext'(您是否缺少using指令或程序集引用?)"
这很奇怪,因为DbContext是绿色的,就像每个公认的类一样,当我按F12查看DbContext类时,它会把我带到System.Data.Entity.DbContext类中.
public DbContext MyContex { get; set; }
Run Code Online (Sandbox Code Playgroud)
与DbSet一样幸福
public DbSet<TEntity> MySet { get; set; }
Run Code Online (Sandbox Code Playgroud)
我还缺少什么?
我从SQL中获取了一些有时间戳的数据,我想检查它们是否是同一天......
在循环中我试图检查前一个循环时间戳与当前循环时间戳相同......我正在尝试这样的事情......
$.each(data, function(key, value) {
if( new Date([value.startTime] * 1000) === previousdate){
console.log("*** Same day ***");
}
previousdate = new Date([value.startTime] * 1000);
}
Run Code Online (Sandbox Code Playgroud)
但是虽然它们是同一天,但它们在时间上有所不同......我只想检查它们是否在同一天......我可以在比较它们之前修剪它们以便它可以正常工作......但有没有其他有效的方法来做到这一点......
干杯...
我正在使用NHibernate开发一个ASP.NET MVC应用程序,我正在尝试使用Automapper从发送到视图的DTO对象中隐藏Domain对象:
SessionFactory在我的项目中创建和工厂的类库我下载了AutoMapper来转换DTO中的Domain对象,并添加了代码来执行此操作Application_Start.
当我在VisualStudio中运行应用程序时(通过按F5),它工作正常,我的DTO映射到视图中.
当我在IIS中发布它时,我得到一个安全性异常:
Mapper.CreateMap<Category, CategoryDto>();
Mapper.CreateMap<Product, ProductDto>();
Run Code Online (Sandbox Code Playgroud)
System.Security.SecurityException:对类型'System.Security.Permissions.ReflectionPermission,mscorlib,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的权限的请求失败.
如何在没有安全性异常的情况下使Automapper工作?
我一直在开发一个Windows表单项目,我有10个任务要做,我想在async某种程度上这样做.当用户单击按钮并且我调用async方法执行此操作时,这些任务将会出现.在我的代码中,我已经有了这些进程的参数列表.
我的问题是:
A)如何转换我的代码并行运行所有进程?(我想实现async/await)
B)如何向我的UI应用程序提供反馈?
下面的代码是我试过的:
我的按钮调用方法来启动进程
private void button1_Click(object sender, EventArgs e)
{
// almost 15 process
foreach (var process in Processes)
{
// call a async method to process
ProcessObject(process);
}
}
Run Code Online (Sandbox Code Playgroud)
模拟我的进程获取参数的方法
private async void ProcessObject(ProcessViewModel process)
{
// this is my loop scope, which I need to run in parallel
{
// my code is here
// increment the progress of this process
process.Progress++;
// feedback to UI (accessing the UI controls)
UpdateRow(process); …Run Code Online (Sandbox Code Playgroud) c# ×6
.net ×3
asp.net-mvc ×3
javascript ×2
jquery ×2
asp.net ×1
asynchronous ×1
automapper ×1
iis ×1
ninject ×1
razor ×1
security ×1
task ×1
vb.net ×1
winforms ×1