我在IIS 10上运行的ASP.NET Core Web应用程序有问题.我正在使用AngularJS开发单页应用程序.
index.html完全加载,但后端请求在IIS 10上失败,并显示404错误代码.从带有IIS Express的Visual Studio中,它完美地运行.
任何人都可以发现我如何修复后端请求?
这是我的Program.cs
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
Run Code Online (Sandbox Code Playgroud)
这是Startup.cs中的配置方法
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseIdentity();
// Custom middleware for Angular UI-Router
app.Use(async (context, next) =>
{
if (!Path.HasExtension(context.Request.Path.Value)
&& context.Request.HttpContext.Request.Headers["X-Requested-With"] != "XMLHttpRequest"
&& context.Request.Method.ToUpper() != "POST"
&& context.Request.Method.ToUpper() != "PUT"
&& context.Request.Method.ToUpper() != "DELETE")
{
await context.Response.WriteAsync(File.ReadAllText(env.WebRootPath + "/index.html"));
}
await next();
});
app.UseMvc(routes …Run Code Online (Sandbox Code Playgroud) 当我想构建一个支持 CUDA 的版本时,我在构建 TF r2.3 时遇到了问题。当我在没有 CUDA 的情况下为 CPU 配置构建时,一切都很好。打开 CUDA 支持后,我收到了类似这样的 bash 命令的错误地址(退出 126)错误。我使用 Windows 10 和 MSVC 2019 v16.6.5。我也使用 python 3.6.8 和 Bazel 3.3.1。我在 CUDA v10.2、cudnn-10.2-windows10-x64-v7.6.5.32 和 CUDA 10.1 和 cuDNN 7.4 中都遇到过这个问题。配置项目后,我尝试使用以下命令进行构建。
bazel build --config=opt --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so
Run Code Online (Sandbox Code Playgroud)
我把 command.log 文件的内容放到这个pastebin 链接中。
我已经在 tensorflow repo 上针对这个错误打开了一个github 问题,但到目前为止他们还没有为这个问题提供任何解决方案。我希望这里有人指出我正确的方向。
我想创建一个Android应用程序,处理针对所有类别和所有数据类型发现的所有NFC事件,例如NDEF,TECH和TAG。
这些意图过滤器位于我的Android Manifest文件中:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<action android:name="android.nfc.action.TAG_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
当事件为TAG_DISCOVERED时,此代码有效。NDEF_DISCOVERED不要调用我的应用程序。
谁能发现我在做什么错?
我创建了这个 html 文件,其中使用 ajax 请求加载数据,但有一个尴尬的问题。它没有在任何浏览器中向我显示垂直滚动。
html
<div id="register1">
<h2><center>Live Conversation</center></h2>
<div id="showall">
//data is loaded here using ajax request
</div>
<div id="white">
<center>
<textarea rows="5" cols="97" id="writebody"></textarea>
</center>
<br> // $msg is already set in my file
<input type="button" name="enterbody" value="send" id="enterbody<?php echo $msg; ?>">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#register1 {
background: #f0f0f0;
color: black;
margin-left: auto;
margin-right: auto;
width: 800px;
margin-top: 100px
}
#white {
background: white;
height: auto
}
Run Code Online (Sandbox Code Playgroud)
可能是什么问题。
android ×1
asp.net ×1
asp.net-core ×1
build ×1
c# ×1
css ×1
html ×1
iis ×1
intentfilter ×1
ndef ×1
nfc ×1
nvidia ×1
tensorflow ×1
windows ×1