我正在尝试在OSX上调试一个dotnet核心项目并继续得到一个它无法找到所需库的引用错误.
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/Chris/Google Drive/Repos/project/src/project.api/bin/Debug/netcoreapp1.0'.
WARNING: The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use Microsoft.NETCore.App 1.0.0 or newer. This may be expected if the target process did not run .NET code.
The program '/Users/Chris/Google Drive/Repos/project/project.api/src/project.api/bin/Debug/netcoreapp1.0/project.api.dll' has exited with code 131 (0x00000083).
Run Code Online (Sandbox Code Playgroud)
所以我查看了bin目录,注意到netcoreapp1.0下有一个名为osx.10.11-x64的附加目录.
在我的launch.json中如果我手动添加到程序路径一切正常 - 我只是想知道这是否正常,如果运行时可以动态拾取,所以我不必更改我工作的不同机器的程序路径(windows,nix,osx)
这是launch.json的副本
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET …Run Code Online (Sandbox Code Playgroud) 我们正在开发一个最新的MVC框架中的应用程序,到目前为止一切都很棒.在我们的应用程序中,我们决定在wwwroot/app下的项目中嵌入一个角度应用程序.我创建了一个app控制器并查看和禁止访问该应用程序,除非用户获得授权.当未经授权的用户尝试访问localhost/app时,这很有效 - 它将它们踢回C#应用程序登录页面.
我想更进一步,并禁止访问该文件夹中的直接文件,例如localhost/app/scripts/controllers/name.js或部分html文件/app/partials/name-partial.html.在过去,我将进入web.config并添加以下代码,但我没有找到最新框架的等效项.理想情况下,如果可能,我希望这是startup.cs或appsettings.json中的条目
<location path="app">
<system.web>
<authorization>
<allow roles="User" />
<deny roles="*" />
</authorization>
</system.web>
</location>
Run Code Online (Sandbox Code Playgroud) 我正在更新我们的dotnet核心项目,在后端而不是Microsoft SQL Server上使用PostgreSQL,并遇到了两个使用GUID作为数据类型的表的情况.
错误
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Property CommentID on type is a database-generated uuid, which requires the PostgreSQL uuid-ossp extension. Add .HasPostgresExtension("uuid-ossp") to your context's OnModelCreating.
Run Code Online (Sandbox Code Playgroud)
稍微谷歌搜索后,我意识到我必须启用uuid扩展(不确定这是否可以自动化)然后成功生成pgAdmin中的uuid.
CREATE EXTENSION "uuid-ossp";
SELECT uuid_generate_v4();
Run Code Online (Sandbox Code Playgroud)
不幸的是我的dotnet项目仍然抱怨同样的错误.我在错误中看到它将.HasPostgresExtension("uuid-ossp")添加到OnModelCreating并且我已经在几个地方尝试但似乎无法弄清楚应该添加的具体位置.
asp.net postgresql npgsql entity-framework-core asp.net-core
我正在使用实体框架 7 并创建了两个项目。一个项目作为 ASP.NET 5 Web API 项目,另一个项目是类库项目(包),我想在其中存储我所有的数据访问层逻辑。这样我就可以将此包用于未来的另一个报告项目,我可能提供的其他附加服务。
基本上,我在 web api 项目的控制器中有一个简单的帖子,它调用了我的数据库项目中的一个函数。当函数启动数据库时,它说数据库未定义,即使它在两个项目中都定义了。
错误
{"No database providers are configured. Configure a database provider by overriding OnConfiguring in your DbContext class or in the AddDbContext method when setting up services."}
Run Code Online (Sandbox Code Playgroud)
代码
数据库项目:InsertPerson
public int InsertPerson(tbl_Person person)
{
using (var db = new AppContext())
{
try
{
db.tbl_Person.Add(person);
db.SaveChanges();
return person.PersonID;
}
catch
{
return 0;
}
}
}
Run Code Online (Sandbox Code Playgroud)
配置文件
Web API 项目:Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<AppContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"])); …Run Code Online (Sandbox Code Playgroud) 我们的团队目前正在使用 DevOps,并对一切的运行情况感到非常满意。我们在每个项目中设置了仪表板来跟踪工作项和冲刺,并希望在组织级别执行相同的操作。有没有办法创建组织中多个项目的总体概述?
我今天打开了我的ASP NET 5解决方案,在项目加载时,我得到以下Microsoft Visual Studio错误.我想也许这是我的默认运行时的问题,但是当我运行DNVM List时,一切看起来都没问题.任何帮助或方向将不胜感激
尝试运行DNX设计时进程(dnx-clr-win-x86.1.0.0-rc2-16357)时发生以下错误.
无法启动该过程.
DNX设计时间过程为Visual Studio提供了智能感知,构建和参考信息,没有它,您的体验将非常有限.请尝试关闭并重新打开Visual Studio以查看是否可以解决问题.或者,检查DNX版本是否已正确安装,或尝试使用项目属性页面更改为其他已安装的DNX版本.
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-rc1-update1 clr x64 win
1.0.0-rc1-update1 clr x86 win
1.0.0-rc1-update1 coreclr x64 win
1.0.0-rc1-update1 coreclr x86 win
1.0.0-rc2-16177 coreclr x64 win
1.0.0-rc2-16177 coreclr x86 win
* 1.0.0-rc2-16357 clr x86 win default
1.0.0-rc2-16357 coreclr x86 win
Run Code Online (Sandbox Code Playgroud) 我有dotnet核心应用程序,我正在研究这是跨平台的.我想在我的项目中使用Noda作为实用程序,但是即使我在项目中将nodatime定义为依赖项,也会出现以下错误:
System.IO.FileNotFoundException: Could not load file or assembly 'NodaTimestrong text, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1'. The system cannot find the file specified.
File name: 'NodaTime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1'
at project.ef.CalendarHelper.ValidateTimeZone(String timezoneTypeName)
at project.ef.CalendarHelper.
Run Code Online (Sandbox Code Playgroud)
以下是项目配置文件:
API项目
{
"buildOptions": {
"preserveCompilationContext": true,
"emitEntryPoint": true,
"warningsAsErrors": true,
"debugType": "portable",
"copyToOutput": {
"include": [
"config.json",
"Certificate.pfx"
]
}
},
"dependencies": {
"AspNet.Security.OAuth.Introspection": "1.0.0-alpha2-final",
"AspNet.Security.OAuth.Validation": "1.0.0-alpha2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.0",
"Microsoft.AspNetCore.Mvc.Cors": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.EntityFrameworkCore.Design": …Run Code Online (Sandbox Code Playgroud) 在尝试保存ui-grid单元模板中的更改时,我无法理解从哪里开始.当我浏览Ui-Grid教程时,我发现的是当单个字段映射到列时如何保存更改:http ://ui-grid.info/docs/#/tutorial/201_editable.
我创建了一个简单的网格作为一个示例,在一列中有多个输入文本字段.您将如何处理编辑并保存对此网格的更改?使用Kendo + razor + c#我能够保存包含8-9个变量的列中的更改.我无法理解如何使用角度ui网格来做到这一点.
总而言之,我希望一旦他或她完成网格中的数据编辑,就可以单击网格外的单个保存按钮.
这是我的简单网格示例的链接:http://plnkr.co/edit/IeYWL62Oa182crRUEtX4?p = info
var app = angular.module('app', ['ngTouch', 'ui.grid']);
app.controller('MainCtrl', ['$scope', '$http',
function($scope, $http) {
$scope.gridOptions = {
rowHeight: 40,
enableHorizontalScrollbar: 0,
enableVerticalScrollbar: 0,
};
$scope.gridOptions.columnDefs =
[{ name: 'id', width: 35},
{ name: 'template',
cellTemplate: '<div><input type="text" class="form-control" ng-input="row.entity.name" ng-model="row.entity.name" /></div>' +
'<div><input type="text" class="form-control" ng-input="row.entity.age" ng-model="row.entity.age" /></div>' },
];
$http.get('https://cdn.rawgit.com/angular-ui/ui-grid.info/gh-pages/data/500_complex.json')
.success(function(data) {
$scope.gridOptions.data = data;
});
}
])
Run Code Online (Sandbox Code Playgroud) asp.net-core ×4
angularjs ×2
c# ×2
asp.net ×1
azure-devops ×1
macos ×1
nodatime ×1
npgsql ×1
omnisharp ×1
postgresql ×1