错误:
>------ Skipped Deploy: Project: DrawShape.Android, Configuration: Debug Any CPU ------
>Project not selected to build for this solution configuration
Run Code Online (Sandbox Code Playgroud)
Configuration Manager中的配置似乎正确:
这是我正在尝试构建的项目的代码:
https://github.com/chrispellett/Xamarin-Forms-Shape
到目前为止我尝试了什么:
从任何CPU更改为x86并返回.
将Build复选框设置为false,然后再返回true.
我尝试添加到我的项目中的任何 3rd 方 Vue.js 库都会引发以下错误:
Could not find a declaration file for module 'vue-xxx'
Run Code Online (Sandbox Code Playgroud)
我试过 'vue-treeselect', 'vue-select' , 'vue-multiselect'或多或少的结果相同(*那些库不允许import Modulename from,但需要const Modulename = require)。
我"dependencies": {在package.json.
我正在使用 dotnet core 提供的 Vue.js SPA 模板。
'tree-select' 的完整示例:
import Treeselect from 'vue-treeselect';
/* ... */
value = null;
source = [
{
id: 'node-1',
label: 'Node 1',
children: [
{
id: 'node-1-a',
label: 'Node 1-A',
}
]
},
{
id: 'node-2',
label: 'Node …Run Code Online (Sandbox Code Playgroud) 我试图将我的dotnet核心项目(在Windows中)配置为"区分大小写",因此它的行为与我的生产服务器(linux)相同.
我找到了这种做法:
fsutil.exe file setCaseSensitiveInfo "C:\my folder" enable
Run Code Online (Sandbox Code Playgroud)
问题是这个函数不是递归的:
区分大小写标志仅影响应用它的特定文件夹.它不会被该文件夹的子文件夹自动继承.
因此,我尝试构建一个powershell脚本,以递归方式将其应用于所有文件夹和子文件夹.
我试过谷歌搜索类似的东西,只是修改命令行,但我似乎没有找到相关的关键字.这是我最接近这种例子的.
以下代码的目标是将任何给定的函数转换为等待函数.我们的想法是在从db中获取数据时使用它,使代码可以灵活地使用同步获取函数(强制使用当前的ORM),或者使用与async完全相同的函数.
我知道代码背后的概念可能有很多问题.到目前为止,我只是想摆脱编译器错误,所以我可以运行代码并检查行为.但是我当然愿意事先讨论这个概念,如果它背后的整个想法是错误的,那么就更有效地利用我的时间寻找另一个解决方案.
async static void Main()
{
// The following line gives a compiler error:
// Error 1 The best overloaded method match for 'CastFuncToTask<int>(System.Func<int>)' has some invalid arguments
int task = await CastFuncToTask<int>(TestFunc(2));
}
private static Task<T> CastFuncToTask<T>(Func<T> func)
{
TaskCompletionSource<T> taskCompletionSource = new TaskCompletionSource<T>();
T result = func.Invoke();
taskCompletionSource.SetResult(result);
return taskCompletionSource.Task;
}
private static int TestFunc(int testInt)
{
return testInt * 2;
}
Run Code Online (Sandbox Code Playgroud) 我找到了这个答案,但它似乎不适合我的ASP Net Core项目.
我想要了解的事情:
aspnetroles),但我不知道该用什么作为Id和ConcurrencyStamp.Startup?在Register下面AccountController?user2role或aspnetusers.role_id).所以PerformanceCounter在dotnet核心中消失了.我理解这是因为它不兼容Linux.
这里本评论:(什么是性能计数器.NET核心的故事)似乎暗示,如果我愿意只在Windows上运行它,我可以"利用Windows的特定功能",但我不知道我如何将其整合到dotnet核心中.
我愿意做这个解决方法的原因是保留dotnet核心代码库,这样一旦有跨平台解决方案,我就不必迁移PerformanceCounter.
总结一下我的问题:如何在Windows上运行时运行dotnet核心的CPU使用率?
我发现的其他相关帖子:
这个解决方案似乎表明这Process.GetCurrentProcess()已经足够了,我不太明白(PerformanceCounter提供了机器的完整CPU使用率).
循环遍历所有进程(正如其他帖子似乎暗示的那样?)是不可行的(它会抛出某些进程的异常)并且它看起来很慢,这对我的用例来说是一个问题.
我刚刚在Visual Studio 2015中更新了Xamarin(这是Visual Studio的建议更新).
更新后,当我开始使用模拟器进行调试时AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19),会发生以下错误:
"InstallPackageAssemblies"任务意外失败.
System.AggregateException:发生一个或多个错误.---> Xamarin.AndroidTools.AndroidDeploymentException:InternalError ---> Mono.AndroidTools.InsufficientSpaceException:设备上没有足够的存储空间来存储包:/data/local/tmp/Mono.Android.Platform.ApiLevel_23.apk .释放一些空间或使用SD卡再试一次.
这在更新前几分钟没有发生,并且在更新期间项目保持不变.我很确定.
Xamarin文档在此处记录了此错误,并说:
设备上没有足够的存储空间来部署程序包
当您不从Visual Studio中启动模拟器时,会发生这种情况.在Visual Studio外部启动模拟器时,需要传递-partition-size 512选项,例如
emulator -partition-size 512 -avd MonoDroid
但我确实从Visual Studio中启动了模拟器.
我正在建立一个家谱树应用程序,我需要达到这个日期.我更喜欢DateTimePicker而不是TextBox + text-date转换.
反正有没有规避这个限制?
简介:它可以作为dotnet run,但不能作为dotnet myappname.dll。
我的Linux技能是有限的,但是我想按照本书学习,所以我不会混淆(遵循Scott Hanselman的本教程):
$ cd /home/myusername/dotnettest
$ dotnet run
Run Code Online (Sandbox Code Playgroud)
然后像这样将其移动到/ var:
$ sudo cp -a /home/myusername/dotnettest/bin/Debug/netcoreapp1.1/publish /var/dotnettest
Run Code Online (Sandbox Code Playgroud)
最后,我测试它是否也可以正常工作:
$ dotnet dotnettest.dll
Run Code Online (Sandbox Code Playgroud)
然后失败:
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using '/home/myusername/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Unhandled Exception: System.AggregateException: One or more errors occurred. (Error -98 EADDRINUSE address already in use) ---> Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -98 EADDRINUSE address already in use
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.Check(Int32 statusCode)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle.GetSockIPEndPoint() …Run Code Online (Sandbox Code Playgroud) 看起来我被迫在两者之间进行选择(“监视文件更改模式”或“附加到 Visual Studio 模式”)。
这是 中的两个不同“配置文件” launchSettings.json,我必须选择其中之一:
"profiles": {
...
"Watch file changes": {
"executablePath": "dotnet.exe",
"workingDirectory": "$(ProjectDir)",
"commandLineArgs": "watch run debug",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Attach to VS": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我必须选择一个不太理想,我希望能够应用断点(“附加到 VS”模式)并观察文件更改。
顺便说一句,对于那些感兴趣的人:配置文件“监视文件更改”必须与 .csproj 文件中的以下内容相协调:
<ItemGroup>
<!-- Files that the "dotnet watch" will monitor for hot reloading: -->
<Watch Include="**\*.razor" />
<Watch Include="**\*.scss" />
<Watch Include="**\*.cshtml"/>
<Watch Include="**\*.cs" …Run Code Online (Sandbox Code Playgroud) c# ×6
.net-core ×3
asp.net ×3
asp.net-core ×2
xamarin ×2
.net ×1
android ×1
async-await ×1
blazor ×1
javascript ×1
linux ×1
mono ×1
node.js ×1
powershell ×1
typescript ×1
vue.js ×1
winforms ×1