在构建我的VS2012 C#项目期间,我不断收到此错误
Error 41 Could not copy "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe".
Exceeded retry count of 10. Failed.
Error 42 Unable to copy file "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe". The process cannot access the file
'bin\Debug\WeinGartner.WeinCad.exe' because it is being used by another
process.
Run Code Online (Sandbox Code Playgroud)
现在我已经发现杀死这个过程了
Weingartner.WeinCad.vhost.exe
Run Code Online (Sandbox Code Playgroud)
工作(有时),但这让我很紧张.有什么方法可以阻止这种情况发生吗?
我的调试器设置是
我正在使用Entity Framework 4.1中引入的DbContext和Code First API.
该数据模型使用的基本数据类型,如string
和DateTime
.我在某些情况下使用的唯一数据注释是[Required]
,但这不是任何DateTime
属性.例:
public virtual DateTime Start { get; set; }
Run Code Online (Sandbox Code Playgroud)
该的DbContext子类也很简单,看起来像:
public class EventsContext : DbContext
{
public DbSet<Event> Events { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Event>().ToTable("Events");
}
}
Run Code Online (Sandbox Code Playgroud)
在初始化设置日期在模型中有意义的值在今年或明年.
但是,当我运行初始化程序时,我收到此错误context.SaveChanges()
:
将datetime2数据类型转换为日期时间数据类型会导致超出范围的值.该语句已终止.
我不明白为什么会发生这种情况,因为一切都很简单.我也不确定如何解决它,因为没有edmx文件可以编辑.
有任何想法吗?
我刚下载了最新版本的SQL Express 2012但我无法连接到localhost.我尝试了localhost\SQLExpress和Windows身份验证,但它给出了一条错误消息,指出无法连接.我在这里错过了什么吗?我之前使用过SQL Server 2008,并且从未遇到过连接到localhost的问题.它似乎甚至找不到它.同样在服务中我只看到一个SQL Server VSS编写器.它应该是这样的吗?或者我错过了什么?谢谢
我安装了Visual Studio 2015专业版,我的电脑规格是Intel i7-3770 CPU 3.40 GHz,8 GB RAM和Windows 7 Enterprise 64位.
我想将我的项目升级到.NET 4.6,它是用Visual Studio 2005 .NET 2.0编写的,但我对速度有严重的问题.在Visual Studio 2015中打开我的项目(巨大的项目)后,它变得疯狂.构建,调试,打开菜单太慢了.有时我得到"没有回应"的消息.它是关于Windows 7还是你可以给我任何关于我的速度问题的建议?
Visual Studio Enterprise 16.3.7
在两台单独的机器上使用时,一台机器构建良好,另一台机器抛出错误:
功能“使用声明”在 C# 7.3 中不可用。请使用 8.0 或更高版本的语言。
这可以通过按照此处的建议设置LangVersion
在非工作机器上轻松解决/sf/answers/3365990281/或让 Visual Studio 像上面的打印屏幕一样自动修复它。.csproj
<LangVersion>8.0</LangVersion>
Run Code Online (Sandbox Code Playgroud)
我不明白的是为什么一台机器在没有这条线的情况下可以很好地构建而.csproj
另一台机器需要它?
我已经安装了ASP.NET Core 2.1
,但即使我已经创建了一个新的ASP.NET Core Web Application
使用ASP.NET Core 2.1
与Individual User Accounts
→ Store user accounts in-app
我无法找到的AccountController或意见.
我仍然可以注册和登录没有问题,但我找不到它的代码,它存在于2.0.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
var data = [{
"Id": "SWE",
"Country": "Sweden",
"Population": 9592552
}, {
"Id": "NOR",
"Country": "Norway",
"Population": 5084190
}];
function display(e) {
alert("E" + e);
var countryData = data.find(function (element, index, array) {
return element.Id === e;
});
alert(countryData.Population);
}
display('SWE');
});
</script>
</head>
</html>
Run Code Online (Sandbox Code Playgroud)
上面发布的代码在Firefox和Chrome上正常运行,但我在Internet Explorer中收到错误.错误信息:
Object doesn't support property or method 'find'
有没有办法找出侦听器的数量(连接到集线器的客户端?)
如果至少连接了一个客户端,我正在尝试运行/启动任务,否则不启动它:
[HubName("taskActionStatus")]
public class TaskActionStatus : Hub, IDisconnect
{
static CancellationTokenSource tokenSource;
public void GetTasksStatus(int? siteId)
{
tokenSource = new CancellationTokenSource();
CancellationToken ct = tokenSource.Token;
ITaskRepository taskRepository = UnityContainerSetup.Container.Resolve<ITaskRepository>();
// init task for checking task statuses
var tasksItem = new DownloadTaskItem();
taskRepository.GetTasksStatusAsync(siteId, tasksItem, ct);
// subscribe to event [ listener ]
tasksItem.Changed += new EventHandler<TaskEventArgs>(UpdateTasksStatus);
}
public void UpdateTasksStatus(object sender, TaskEventArgs e)
{
Clients.updateMessages(e.Tasks);
}
// when browsing away from page
public Task Disconnect()
{
try
{
tokenSource.Cancel();
} …
Run Code Online (Sandbox Code Playgroud) 我正在使用ADO.NET实体框架创建一个应用程序.
我可以在调试时逐行浏览我的代码,并为每个执行的查询观察SQL Server Profiler,但我无法弄清楚所有这些SQL命令的来源!
有时当我执行时SaveChanges()
,实体框架执行意外的,奇怪的INSERTS.他们有时会破坏申请.我无法弄清楚我正在做些什么来引起他们.
如何监视排队等待SaveChanges()
呼叫的挂起更改?
我只有一个快速的问题。有没有办法热重载 blazor 应用程序?至少,.razor 文件?现在我将我的应用程序托管在本地 IIS(不是 IIS express)上。
我正在浏览互联网,但没有发现任何有用的东西。
谢谢大家的回答:)
c# blazor blazor-server-side blazor-client-side blazor-webassembly
c# ×10
.net ×2
asp.net ×2
.net-4.6 ×1
asp.net-core ×1
blazor ×1
build ×1
dbcontext ×1
javascript ×1
process ×1
signalr ×1
signalr-hub ×1