我使用Visual Studio 2008的模板为ASP.NET 3.5 Web应用程序(而不是Web站点)创建了一个Web部署项目.
我编译了创建部署所需文件的项目.我将生成的文件夹(bin,静态文件和所有带有aspx占位符的文件夹等)复制到我想测试应用程序的登台服务器.
如果我没有标记选项"允许此预编译站点可更新",我在浏览器中加载的每个页面上都会收到此错误消息:
System.Web.HttpException file PAGENAME.aspx has not been pre-compiled, and cannot be requested.
堆栈跟踪中的最后一行:
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal( VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +8756366
如果我检查选项,一切都很好(我想因为实际的aspx/ascx仍然是原始形式).
知道我在这里缺少什么吗?我忘了复制一些设置或特殊文件吗?
谢谢!
笔记:
目前我VirtualPathProvider在Asp.net MVC Web应用程序中有自定义.
这将VirtualPathProvider检查路径中的Area "/{Area}/{Controller}/..."并使用该NameSpace.{Area}.Main.dll模块将该程序集中包含的视图作为Embedded Resources返回.
这个伟大的工程,我没有部署任何ascx,js,css文件.
现在我的问题是:
我想在程序集中预编译aspx和ascx文件,而不是将视图作为嵌入资源,我将使用Response.Write的视图类.
我可以使用它预编译视图,aspnet_compiler但是在ViewEngine尝试查找视图并且失败时我一直收到错误.
我的主要目标是让第一次使用某个视图/用户控件的方式更快,不要等待编译发生.
这是一项要求,因为应用程序可以分组为插件,并且此插件可以部署到Bin目录中.
有什么想法吗?
asp.net-mvc virtualpathprovider embedded-resource precompiled
我正在学习如何使用Magento电子商务系统,我正在阅读它的文档,但我不理解一些术语,一个"预编译的JavaScript库",它们是什么意思?,JavaScript代码怎么样?编译?
用于在不使用SSH的情况下升级和安装Magento的Web下载器(在第2章中介绍).•js-保存Magento安装中包含的所有JavaScript代码的核心文件夹.我们将在这里找到所有预编译的JavaScript库.
来源:http: //www.magentocommerce.com/wiki/2_-_magento_concepts_and_architecture/magento_s_base_structure
我已经在Mediatemple的Ubuntu linux box(ve)服务器上使用Apache在Passenger上运行Rails.当我尝试加载任何页面时,我的应用程序给了我500错误(Rails错误,而不是Apache错误):http://www.mvngmtns.com
我在config/environments/production.rb中看到一篇关于更改此行的文章:
config.assets.compile = true
Run Code Online (Sandbox Code Playgroud)
但这并没有解决我的问题.有人可以帮忙吗?
我的development.log:
Started GET "/" for 72.225.170.239 at 2012-06-29 15:28:43 -0700
Processing by HomeController#index as HTML
Rendered application/_logo.html.erb (0.6ms)
Rendered application/_navbar.html.erb (1.4ms)
Rendered home/index.html.erb within layouts/application (2.6ms)
Completed 500 Internal Server Error in 6ms
ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4: <title>Moving Mountains<%= get_title %></title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8:
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2841110860658336572_129641540'
app/controllers/home_controller.rb:6:in `index'
Run Code Online (Sandbox Code Playgroud)
按要求,跑了 …
我正在开发一个必须在多种环境下构建的大型项目,主要是linux/gcc和windows/msvc.为了加快构建速度,我们使用预编译头文件.
Windows实现非常高效:在我的四核超线程i7构建时间从9分钟下降到1.5分钟.但是,使用预编译的头文件似乎并没有提高性能:在这两种情况下,它在同一台计算机上的虚拟盒下构建22分钟,或者在真实服务器上构建大约40分钟.
所以我想的是显而易见的,我在某种程度上出了问题并且预编译的头文件没有被踢进去.但是我无法找到它.
我们的Makefile是由CMake生成的,所以我可以复制粘贴用于编译头的代码和使用它们的目标文件.
创建标题:
/usr/bin/c++ -O3 -DNDEBUG --no-warnings "-I/mnt/code/server a/src/game"
"-I/mnt/code/server a/src/game/vmap" "-I/mnt/code/server a/dep/include/g3dlite"
"-I/mnt/code/server a/dep/include" "-I/mnt/code/server a/src/shared"
"-I/mnt/code/server a/src/framework" "-I/mnt/code/server a/buildlinux"
"-I/mnt/code/server a/buildlinux/src/shared" -I/usr/include/mysql
"-I/mnt/code/server a/dep/acelite" -DDO_MYSQL -DHAVE_CONFIG_H
-DVERSION=\"0.6.1\" -DSYSCONFDIR=\"../etc/\" -D_RELEASE -D_NDEBUG -x c++-header
-o "/mnt/code/server a/buildlinux/src/game/pchdef.h.gch" "/mnt/code/server
a/src/game/pchdef.h"
Run Code Online (Sandbox Code Playgroud)
编译目标文件:
/usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) "-I/mnt/code/server
a/buildlinux/src/game" -include pchdef.h -Winvalid-pch -o
CMakeFiles/game.dir/AccountMgr.cpp.o -c "/mnt/code/server
a/src/game/AccountMgr.cpp"
Run Code Online (Sandbox Code Playgroud)
即使它们不是直接来自上面的片段,也可以理解见解.
我正在研究轨道并使用带轨道的发动机。在生产模式下,rails 没有加载引擎的编译资源,尽管我已经执行了:
$ RAILS_ENV=production bundle exec rake assets:clean assets:precompile
Run Code Online (Sandbox Code Playgroud)
如果有人知道这个问题请帮忙。
我的设置如下:
环境/生产.rb
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false
config.assets.compile = false
config.assets.digest = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new`
Run Code Online (Sandbox Code Playgroud)
引擎/xxx/lib/xxx/engine.rb
引擎的选项是——可安装
module Moderna
class Engine < ::Rails::Engine
isolate_namespace xxx
# parent company asset precompile
initializer "xxx.assets.precompile" do |app|
app.config.assets.paths << Rails.root.join("app", "assets", "fonts")
app.config.assets.precompile << %w(
xxx/*.css xxx/fancybox/*.css xxx/skin/*.css xxx/google-code-prettify/*.css
xxx/*.js xxx/flexslider/*.js xxx/google-code-prettify/*.js
xxx/portfolio/*.js …Run Code Online (Sandbox Code Playgroud) App.Web并且App.Views我的项目在一个解决方案中,我将我的视图放在App.Views中并使用RazorGenerator进行预编译.如果我用的话,它运作良好App.Web,
~/Views/Index.cshtml是App.View中我的视图的虚拟路径
它可以在App.Web中成功呈现此视图
public ActionResult Index() {
return View("~/Views/Index.cshtml");
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试时RenderViewToString,它会返回null.
class FakeController : ControllerBase
{
protected override void ExecuteCore() { }
public static string RenderViewToString(string controllerName, string viewName, object viewData)
{
using (var writer = new StringWriter())
{
var routeData = new RouteData();
routeData.Values.Add("controller", controllerName);
var fakeControllerContext = new ControllerContext(new HttpContextWrapper(new HttpContext(new HttpRequest(null, "http://google.com", null), new HttpResponse(null))), routeData, new FakeController());
var razorViewEngine = new RazorViewEngine();
var razorViewResult …Run Code Online (Sandbox Code Playgroud) 我试图了解const double* const用作模板的内幕。我有一些非常基本的计算想要高效执行,但是我不知道c ++编译器是如何工作的(汇编代码是什么)。
这个想法是为一个函数创建一个模板,该函数将3个常量double用作模板参数,并将double用作参数。
constexpr double p1 = 1;
constexpr double p2 = 2;
constexpr double p3 = 3;
template <const double* const a,
const double* const b,
const double* const c>
inline double func(double value)
{
constexpr double d = *a - *b;
constexpr double e = *a - *c;
constexpr double ratio = d / e;
constexpr double remain = *c - *a * ratio;
return value * ratio + remain;
}
double func2(double c) …Run Code Online (Sandbox Code Playgroud) 我有以下预编译的脚本插件,它应用了一个 Gradle 核心插件和一个外部插件(通过id(...)):
// buildSrc/main/kotlin/my-template.gradle.kts:
import org.gradle.api.JavaVersion
plugins {
java
id("com.diffplug.gradle.spotless") // commenting this line "fixes" the problem, WHY?
}
java {
sourceCompatibility = JavaVersion.VERSION_11
}
Run Code Online (Sandbox Code Playgroud)
与此build.gradle.kts在buildSrc:
// buildSrc/build.gradle.kts:
repositories {
maven("https://nexus.ergon.ch/repository/secure-public/")
}
plugins {
`kotlin-dsl`
id("com.diffplug.gradle.spotless") version "3.25.0"
}
Run Code Online (Sandbox Code Playgroud)
构建失败并显示以下消息: Expression 'java' cannot be invoked as a function. The function 'invoke()' is not found
$ ./gradlew tasks
> Task :buildSrc:compileKotlin FAILED
The `kotlin-dsl` plugin applied to project ':buildSrc' enables …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Azure Functions中扩展,如该问题所示,但无法使其正常工作。
我的代码如下所示:(预编译的消费计划)
public static class FirstFunction
{
[FunctionName("FirstFunction"),]
public static void Run([TimerTrigger("0 */5 * * * *", RunOnStartup = true)]TimerInfo myTimer, TraceWriter log)
{
log.Info($"Started = { TestExtension.Started }");
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
public class TestExtension : IExtensionConfigProvider
{
public static bool Started = false;
public void Initialize(ExtensionConfigContext context) {
Started = true;
Console.WriteLine("TestExtensionConsole");
context.Trace.Error("TestExtension");
throw new Exception("TextExtensionException");
}
}
Run Code Online (Sandbox Code Playgroud)
但是在运行时什么也没有发生。我从计时器看到日志,Started = false但没有其他。
我需要启用扩展功能吗?
precompiled ×10
asp.net ×2
asp.net-mvc ×2
apache ×1
assets ×1
c++ ×1
constexpr ×1
deployment ×1
double ×1
gcc ×1
gradle ×1
header ×1
javascript ×1
magento ×1
passenger ×1
production ×1
razor ×1
templates ×1