我正在学习ASP.NET Core 1.0(vNext).考虑到这一点,我有一个结构如下的解决方案:
MySolution
src
MyLibrary
MyClass.cs
project.json
MyWebSite
Startup.cs
project.json
Run Code Online (Sandbox Code Playgroud)
我正在MyLibrary使用命令行成功编译dnu build.我跑了dnu pack哪个生成了MyLibrary.1.0.0.nupkg.也有两个文件夹:dnx451与dnxcore50这两者都含有MyLibrary.1.0.0.dll.我想用MyLibrary的MyWebSite,但是,我很困惑.
MyLibrary进MyWebSite?我手动复制.dll文件吗?如果是这样,哪一个?我应该使用该nupkg文件吗?这是一个私有程序集,我不想通过NuGet全局发布它.MyWebSite/project.json才能参考这个MyLibrary装配?我们在服务器2003上运行了一个旧的5.1 Mysql服务器.最近我们转向使用Mysql 5.6和server 2008的新环境.现在在新服务器上,当插入像'Ã'这样的特殊字符时,我们不断出错.
现在我检查了源编码,它是UTF-8.但旧的Mysql服务器配置为latin1(服务器/表/冒号)与排序规则latin_swedish_ci,我们没有在旧环境中收到任何错误.
现在我做了一些测试,因为我们没有在新环境中生活.我已经尝试将所有表设置为表/冒号以及latin1.在这两种情况下,我都会遇到这些错误.
我注意到在旧服务器上,服务器默认的字符集是latin1,在新服务器上是utf-8.这可能是问题吗?我发现这很奇怪,因为源是utf-8.
是否有一些选项可以处理这个可以在旧环境中打开?我不确定是否存在类似的东西.我确实比较了mysql管理工具中的设置,除了默认的字符集外,它看起来是一样的.
编辑:
SHOW VARIABLES喜欢'char%';
旧服务器:
+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | utf8 | *
| character_set_connection | utf8 | *
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 | *
| character_set_server | latin1 |
| character_set_system | utf8 |
Run Code Online (Sandbox Code Playgroud)
新服务器:
+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | utf8mb4 | *
| character_set_connection | utf8mb4 | *
| character_set_database | …Run Code Online (Sandbox Code Playgroud) ASP.NET Core 1.0网站中的SynchronizationContext是否为null?此代码在我的系统上抛出异常:
app.Use(async (context, next) =>
{
var sc = System.Threading.SynchronizationContext.Current;
if (sc == null)
{
throw new Exception("SynchronizationContext is null");
}
Run Code Online (Sandbox Code Playgroud) 您好:我的解决方案中有 2 个项目。项目A和项目B。B引用了A。因此A使用B的类和函数。B没有任何资源文件,因为它只包含所有业务功能。A包含所有资源文件。我需要使用从 An 到 B 的资源文件。我不能在 B 中引用 A。我部署了我的主项目,它引用了 B。但是我如何将(A 项目的)资源文件引用到 B 项目中没有引用 B 中的 A 库。提前致谢
所以我试图将其实现到我当前的项目中:
https://github.com/mobitar/MBAlertView
Wenn我试着在我的应用程序中使用这个我收到此错误:
Ld /Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos/Janssenapp.app/Janssenapp normal armv7s cd/Users/florianschaal/Developer/Janssenapp setenv IPHONEOS_DEPLOYMENT_TARGET 6.1 setenv PATH"/ Applications /Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/ sbin"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ iPhoneOS6.1.sdk -L/Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos -L/Users/florianschaal/Developer/Janssenapp/Janssenapp/ZBarSDK -F/Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos -filelist/Users/florian schaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Intermediates/Janssenapp.build/Debug-iphoneos/Janssenapp.build/Objects-normal/armv7s/Janssenapp.LinkFileList -dead_strip -fobjc-arc -fobjc-link- runtime -miphoneos-version-min = 6.1 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos/Janssenapp.app/Janssenapp
对于建筑armv7s未定义的符号:
"_OBJC_CLASS _ $ _ CABasicAnimation",从引用:objc级-REF在MBSpinningCircle.o "_kCAMediaTimingFunctionEaseOut",从引用: - [MBAlertView animationWithValues:时间:持续时间:在MBAlertView.o "_kCATransitionFade",引用自: - [UIView的(动画)addFadingAnimationWithDuration:]在UIView的+ Animations.o "_kCAMediaTimingFunctionEaseInEaseOut",从参考: - [UIView的(动画)animationPop]中的UIView + Animations.o - [UIView的(动画)addPulsingAnimation]中的UIView +动画的.o - [UIView的(动画)addFadingAnimationWithDuration:]在UIView的+ Animations.o "_kCATransitionFromBottom",从参考: - [UIView的(动画)addFadingAnimationWithDuration:]:objc-中的UIView + Animations.o "_OBJC_CLASS _ $ _ CATransition",从参考UIView + Animations.o中的class-ref"_kCAMediaTimingFunctionEaseIn",引用自: - MBAlertView.o中的[MBAlertView …
我刚刚更新了Xamarin Studio的最新版本(Xamarin.Android版本:4.6.4(商业版)),我在更新后收到了很多警告..:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:警告:引用'mscorlib,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = xxxxx'未解析(TrackandTrace. Droid的)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:警告:参考'Mono.Android,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = xxxx'未解决( TrackandTrace.Droid)
我已经尝试删除引用并重新添加它没有任何影响.
更新: 即使我创建一个新项目,我从一开始就收到2个错误..这些错误使得无法构建android项目.
因此,在我的应用程序开始时,用户必须能够扫描QR码.在应用程序设置中,用户可以扫描另一个条形码以更改设置中的某些数据.
在我的应用程序开始扫描仪工作正常,但当我尝试扫描settingsVC中的条形码时,我得到以下警告:
Warning: Attempt to present ZXing.Mobile.ZXingScannerViewController: 0x18036dc0 on UINavigationController: 0x16d8afe0 whose view is not in the window hierarchy!
Run Code Online (Sandbox Code Playgroud)
我已经尝试调用扫描viewDidAppear但是我得到了相同的警告.
button_ScanAPI.TouchUpInside += async (sender, e) => {
var scanner = new ZXing.Mobile.MobileBarcodeScanner ();
var result = await scanner.Scan ();
if (result != null) {
textField_APIKey.Text = result.Text;
}
};
Run Code Online (Sandbox Code Playgroud)
编辑:
试图使用没有异步的条形码扫描仪,但我仍然得到相同的消息.
var scanner = new ZXing.Mobile.MobileBarcodeScanner ();
scanner.Scan (true).ContinueWith (t => {
if (t.Result != null) {
InvokeOnMainThread (() => {
textField_APIKey.Text = t.Result.Text;
});
}
});
Run Code Online (Sandbox Code Playgroud)
我也尝试使用AVFoundation导致同样的错误: …
我试图在webview中加载网址.该URL链接到网站上的pdf文件.我想在webview中显示这个pdf文件.出于某种原因,我只看到一个白色的屏幕,并且pdf没有加载.
这是代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Webkit;
namespace TrackandTrace.Droid
{
[Activity (Label = "PodActivity")]
public class PodActivity : Activity
{
public string PodUrl { get; set; }
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.PodLayout);
var PodWebView = FindViewById<WebView> (Resource.Id.webViewPod);
PodUrl = Intent.GetStringExtra ("PodUrlString" ?? "No Pod Data available");
PodWebView.Settings.AllowFileAccess = true;
PodWebView.Settings.JavaScriptEnabled = true;
PodWebView.Settings.BuiltInZoomControls = true;
PodWebView.LoadData (PodUrl); …Run Code Online (Sandbox Code Playgroud) 所以我正在开发应用程序,但我现在有点卡住了.我现在有2个文本字段,用户必须输入:
Ordernr:xxxxxxxx
Referencenr:xxxxxxx
Run Code Online (Sandbox Code Playgroud)
这两个值必须添加到此链接:http://www.artis-web.de/cgi-bin/WebObjects/Artis.woa/wa/detailedTrack?referencenr = xxxxxxx& derdernr = xxxxxxxxxxx
现在我想要safari打开这个链接.理想的情况是用户输入2个文本字段值,然后按下一个名为"在safari中打开"的按钮
实现这个的最佳方法是什么?
我见过多个网站都有相同的功能,包括SO。我也在努力实现这个目标。这是到目前为止的代码。
<script>
var myEvent = window.attachEvent || window.addEventListener;
var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload';
myEvent(chkevent, function(e) { // For >=IE7, Chrome, Firefox
var confirmationMessage = ' ';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
});
</script>
Run Code Online (Sandbox Code Playgroud)
问题是上面的代码在 chrome 和 IE 中运行良好,但当我尝试在 Firefox 上测试时它不起作用。我检查了firebug,但没有错误。我更新了firefox,版本是47.0.1。
但问题没有解决。
任何意见将是有益的。
伙计们,如果您有比这更好的代码,那么它也会很有帮助。
c# ×4
ios ×3
android ×2
asp.net-core ×2
objective-c ×2
xamarin ×2
.net ×1
cocoa-touch ×1
coreclr ×1
iphone ×1
javascript ×1
jquery ×1
mysql ×1
resources ×1
uitextfield ×1
xamarin.ios ×1
zxing ×1