如何在VS2013 x64项目中使用"发布期间预编译"标志?无论我做什么,它都无法发布,因为它坚持使用x86 ASPNETCOMPILER.
我想我曾经在VS2012中使用它,但升级到VS2013之后就不再有效了.
我记得修改涉及更改与之相关的文本文件,MSBuild但老实说我不太了解它,所以它有点朦胧.
任何帮助是极大的赞赏.谢谢!
我在通过命令行发布解决方案时遇到问题。它在各种项目上间歇性地失败,但是每一次都成功。我同时收到null引用错误和“正在卸载线程正在运行的应用程序域”,这可能只是带有竞争条件的null引用。它似乎仅在具有Web服务的项目上失败(原始的.asmx和带有.svc或无文件激活的WCF)。尽管有时可能会成功,但我认为我们的代码不是问题,尽管我们可以做一些更改以减轻根本原因(无论可能是什么)。
我尝试过/检查过的内容:
tfpt scorch清理所有本地更改,包括构建输出,但均未成功,因此我知道这不是源目录的问题。C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files(我们使用的是32位)上清除了临时文件,并且看起来还可以,但是仍然有问题。再次发布后,目录仍然为空,因此可能不相关。aspnet_compiler正在写信%LocalAppData%\Temp\Temporary ASP.NET Files。清除这些文件有时似乎奏效,或者也许我很幸运,但是随后又开始失败。我没有发现其他可能相关的东西。构建输出没有提供任何好的信息,因此我将DebugDiag设置为在崩溃时输出。结果如下:
DetailID = 1
Count: 1
Type: System.NullReferenceException
Message:
Stack:
System.Web.Compilation.DiskBuildResultCache.CacheBuildResult(System.String, System.Web.Compilation.BuildResult, Int64, System.DateTime)
System.Web.Compilation.BuildManager.CacheBuildResultInternal(System.String, System.Web.Compilation.BuildResult, Int64, System.DateTime)
System.Web.Compilation.WebDirectoryBatchCompiler.CacheAssemblyResults(System.Web.Compilation.AssemblyBuilder, System.CodeDom.Compiler.CompilerResults)
System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(System.Web.Compilation.AssemblyBuilder)
System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilderParallel(System.Collections.ICollection)
System.Web.Compilation.WebDirectoryBatchCompiler.CompileNonDependentBuildProviders(System.Collections.ICollection)
System.Web.Compilation.WebDirectoryBatchCompiler.Process()
System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(System.Web.Hosting.VirtualDirectory, Boolean)
System.Web.Compilation.BuildManager.BatchCompileWebDirectory(System.Web.Hosting.VirtualDirectory, System.Web.VirtualPath, Boolean)
System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(System.Web.Hosting.VirtualDirectory, Boolean)
System.Web.Compilation.BuildManager.PrecompileAppInternal(System.Web.VirtualPath, System.Collections.Generic.IEnumerable`1<System.String>)
System.Web.Compilation.BuildManager.PrecompileApp(System.Web.VirtualPath, System.Collections.Generic.IEnumerable`1<System.String>)
System.Web.Compilation.BuildManager.PrecompileApp(System.Web.Compilation.ClientBuildManagerCallback, System.Collections.Generic.IEnumerable`1<System.String>)
System.Web.Compilation.BuildManagerHost.PrecompileApp(System.Web.Compilation.ClientBuildManagerCallback, System.Collections.Generic.List`1<System.String>)
[GCFrame]
[GCFrame]
[ContextTransitionFrame]
[GCFrame]
[GCFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[GCSafeCollectionFrame]
[TPMethodFrame]
*** …Run Code Online (Sandbox Code Playgroud) 我一直在尝试使用aspnet_compiler来预编译我的asp.net站点,以避免或最小化在应用程序池回收后运行csc.exe.但是,在运行编译器回收后,应用程序池仍然会导致一大堆csc.exe进程启动,服务器将停止运行直到编译完成.
我正在运行以编译站点的命令是:C:\ Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -p"E:\ webRoot\application"-v // localhost/application E:\ Webroot公司\应用
我已经在互联网上搜索了这个答案,但我还没有成功.如果有人有任何建议,他们将不胜感激,因为这会导致服务器上运行的所有站点出现严重的性能问题,应用程序池回收发生.
非常感谢!
这只是为了更好地理解ASP.NET框架.当您以声明方式(即Web表单标记)使用控件时,您可以使用以以下内容开头的属性通过其方法名称分配事件处理程序On:
<asp:Button runat="server" OnClick="..."/>
Run Code Online (Sandbox Code Playgroud)
但是当你查看System.Web.UI.WebControls.Button类时,它有一个名为Click委托被指定为的DelegHandler属性:
button.Click += new EventHandler(...);
Run Code Online (Sandbox Code Playgroud)
那么这是如何实现的呢?这仅仅是解析器遵循的约定吗?
我知道,这是一个奇怪的问题,答案只会满足我的好奇心.
我正在尝试这个.我已经建立了asp.net网站.当我通过VS2008发布到IIS时,它工作正常.让我说我的网站是在c:\ projects\Website1 \我想将它发布到c:\ Inetpub\wwwroot\WebsiteOne
我想模仿出版工作室的出版物.那就是发布并删除任何内容.
我试过这个:aspnet_compiler -v/WebsiteOne -fc:\ Inetpub\wwwroot\WebsiteOne
错误:错误ASPRUNTIME:预编译目标目录(c:\ Inetpub\wwwroot\WebsiteOne)不能与源应用程序目录(c:\ inetpub\wwwroot\WebsiteOne)位于同一树中.
当我尝试这个:aspnet_compiler -v/WebsiteOne
我收到错误此应用程序已经预编译.
任何能够让我了解如何编译线构建和网站发布的人
谢谢
我对 msbuild 和 aspnet_compiler 还很陌生。
我正在使用 aspnet_compiler 来编译 Web 应用程序项目。现在,我刚刚看到 MSBuild.exe,并注意到它将我的网站构建到 /mywebsite/precompiledWeb 文件夹中。现在为什么我需要使用 MSBuild.exe?我不能直接使用aspnet_compiler来看看我的网站是否可以正常构建吗?
(不确定我是否解释得很好)。
我的任务是现代化2009年开发的Web应用程序。它是用VB.NET编写并使用ASP.NET WebForms编写的。我想在VB.NET中使用最新的语言构造。
我得到了有用的提示,说“ Visual Basic 10.0不允许字符串插值”,这是我试图使用的方法,但是我没有找到提高语言水平的方法。
我在此相关问题中有技巧,如何在Visual Studio 2015中更改VB.NET语言版本,但在这种情况下没有帮助。
在ReSharper属性中,我可以将四个不同项目中的每个项目的“ VB语言级别”设置为“ Visual Basic .NET 15”。这更改了项目的.DotSetting文件中的XML行,并且此设置更改了ReSharper分析代码的方式,但是,可惜,这并没有消除编译错误。
如何在Visual Studio 2017中启用对ASP.NET网站或Web应用程序项目中最新版本的VB.NET的支持?
vb.net asp.net aspnet-compiler visual-studio visual-studio-2017
我正在使用msbuild自动构建和打包准备部署的网站.当我编译然后通过Visual Studio 2008发布我的项目时,一切正常.
但是,当我使用msbuild时,我遇到错误,因为AspNetCompiler正在尝试编译未包含在我的.csproj中的aspx和ascx文件,但仍然存在于版本控制中.
我知道我可以从版本控制中删除它们,但任何人都可以告诉我为什么这些文件正在编译?
这是我的msbuild任务.
<AspNetCompiler
TargetPath="$(PackageDir)\Web"
VirtualPath="/"
PhysicalPath="$(buildDirectory)\Web"
Force="true"
/>
Run Code Online (Sandbox Code Playgroud)
谢谢!
我们有一个非常大的产品可以很好地编译我们的32位构建控制器,主要是我们的64位构建控制器,但有一个例外.我们有一个预编译的Web表单前端.当它在64位机器上构建时,它在*C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -v/ourwebapp -p ..\ourwebapp\-u的日志文件中显示命令行 -f"........\Binaries\Mixed Platforms_PublishedWebsites\ourwebapp \"* 这会导致错误,因为我们有32位第三部分dll: ASPNETCOMPILER:错误ASPCONFIG:无法加载文件或程序集'Leadtools.编解码器或其依赖项之一.尝试加载格式不正确的程序.[C:\ Builds\5\OurApp\OurApp Build\Sources\Product\Solutions\ourwebapp_ourwebapp.metaproj]
有谁知道正确的解决方案文件语法强制32位构建无论如何.谢谢.
我有一个无法从命令行发布的Web应用程序.
这是一个VS2013 Web应用程序项目,定义了发布配置文件:
当我在IDE中发布时,一切正常.
当我从命令行发布时:
msbuild myapp.sln /property:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=myapp
Run Code Online (Sandbox Code Playgroud)
我收到错误:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(411,5):
error : Can't find the valid AspnetCompilerPath [E:\dev\korweb_ws\trunk\korweb_ws\korweb_ws.csproj]
Run Code Online (Sandbox Code Playgroud)
关于可能发生的事情的任何想法?
我是一个根本不喜欢Visual Studio的人,而且更愿意使用我高度配置的gvim编辑代码而不是围绕IDE.
因此,我的目标是为Web应用程序编译C#代码,而不需要偶尔需要使用的膨胀> 2gb怪物.
目前,我可以使用以下批处理脚本编译现有代码:http: //www.codeproject.com/Questions/495608/howplustopluspublishplussiteplususingplusaspnet_co
问题在于需要项目文件和解决方案文件.有没有办法隔离这些是如何生成的(如果我可以获得Visual Studio使用的现有脚本,我可以在自动脚本中使用远程机器的副本)或自己生成它们?
或者,有没有办法绕过它们用于较小的项目和个别表格?不幸的是,我对aspnet_compiler的了解有限.
将我的asp.net MVC 5网站发布到托管环境后,我收到以下错误消息
Compilation Error - The compiler failed with error code 1
Run Code Online (Sandbox Code Playgroud)
除了编译器调用本身之外,没有显示任何其他内容.
我们有 Asp.Net Mvc 应用程序,aspnet_compiler.exe 的运行时间超过 5 分钟。
Asp.Net Mvc 应用程序依赖于大约 100 个较小的项目,这些项目都通过从自己的项目文件夹中复制它们来为其提供不同的静态视图、Javascript 文件等。这些小项目本身不是 Web 应用程序,但它们包含 Web 内容以便在不同项目之间分发它。
最后,所有内容都整合到一个 Web 应用程序中。然后我们运行aspnet_compiler.exe,这需要5分钟多的时间。哎哟。
该代码针对 .Net Framework 4.7.2,并且 Web 应用程序不是 SDK 风格。
我们显然做错了什么。我们怎样才能减少这个时间呢?
编辑1
整个解决方案需要约 14.5 分钟才能使用 msbuild 和/m:12. msbuild节点利用率不好。根据详细的构建摘要,它是:
============================== Node Utilization (IDs represent configurations) ====================================================
Timestamp: 1 2 3 4 5 6 7 8 9 10 11 12 Duration Cumulative
...
Utilization: 22.8 11.7 17.2 7.2 52.4 16.6 12.8 13.3 13.1 29.8 34.3 14.9 Average Utilization: 20.5104451261997
Run Code Online (Sandbox Code Playgroud)
我认为利用率低下是由于 aspnet_compiler 在构建过程中被调用得相对较晚,此时所有剩余项目都依赖于主 …
aspnet-compiler ×13
asp.net ×9
msbuild ×4
c# ×3
asp.net-mvc ×1
batch-file ×1
command-line ×1
csc ×1
iis ×1
tfs ×1
vb.net ×1