B. *_*non 11 versioning silverlight csproj importerror
根据这里的答案:我应该卸载哪些(如果有的话)最近的Windows更新来重新启动Silverlight或纠正其他问题?,我卸载/重新安装Silverlight并重新启动.但是,现在,我收到了一个编译错误,即:
"未找到导入的项目"C:\ Program Files(x86)\ MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets".确认声明中的路径是否正确,以及该文件存在于磁盘上."
它指向*.csproj文件中的这一行:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)
我完全不明白这是做什么的; 如果这是远方可以理解的东西,我需要做些什么才能解决这个难题?
当我尝试安装Silverlight 4工具时(因为有人表示是/解决方案,例如在Silverlight 4:解析Microsoft.Silverlight.CSharp.targets时未找到?),我得到"安装要求:
必须先安装与Silverlight Tools 4的语言版本匹配的Visual Studio 2010或Visual Web Developer Express 2010或Visual Phone Developer Express 2010,然后才能继续安装Silverlight Tools.Silverlight Tools提供其他语言版本http://go.microsoft.com/fwlink/?LinkId=177432."
我确实安装了VS 2010(SP1).我甚至安装了VS Express(2012)用于Web!
基于另一个提示,我还安装了Silverlight 4 SDK,但是在尝试现在只打开项目时,我得到了"你需要在打开Silverlight项目'Bla'之前安装最新的Silverlight Developer运行时." 它让我安装了Silverlight 5(再次).
我这样做了,但我重新启动了,并且......仍然得到同样的错误消息...
根据我在这里得到的线索:http://connect.microsoft.com/VisualStudio/feedback/details/573750/the-imported-project-path-microsoft-webapplication-targets-was-not-found
我在csproj文件中替换了这一行:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)
......这一个:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)
......而且我比以前更进一步,但我不知道最后一次改变是否是必要的改动,或者如果上面列举的所有步骤都是必要的.除了影子,很可能没有人知道.
实际上,简单地添加该行(无需替换另一行),项目编译,但似乎失去了对Razor或其他东西的了解,因为它失败了这个YSOD:
Server Error in '/TLDReporter' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Helprs' does not exist in the current context
Source Error:
Line 493: <div class="inner" style="width: 300px;">
Line 494: <p id="portal_breadcrumbs" class="breadcrumb">
Line 495: @Helprs.Sitemap(ConfigurationManager.AppSettings["ApplicationHome"])
Line 496: </p>
Line 497: </div>
Source File: c:\Project\. . .\Shared\_Layout.cshtml Line: 495
Run Code Online (Sandbox Code Playgroud)
好吧,无论出于什么原因,在地平线上恍然大悟的短暂瞥见只是一个短暂的海市蜃楼 - 同样的错误在发布之前的更新后立即返回.
但是,一旦我更换了这个:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)
...有了这个:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" />
Run Code Online (Sandbox Code Playgroud)
...基于此:http://msdn.microsoft.com/en-us/library/ff921165(v = PandP.20).aspx
...我进一步,但再次回到这个编译点:
@Helprs.Sitemap(ConfigurationManager.AppSettings["ApplicationHome"])
Run Code Online (Sandbox Code Playgroud)
所有这一切都很奇怪的是解决方案编译,但是当我运行它时,它会抛出一个声称是编译错误结果的YSOD.为什么编译器会成功编译,但是当我去运行应用程序时,出现了尖锐的停顿,以一种不自然的刺耳的语气尖叫出"编译错误"?
安装"Microsoft®Silverlight®5SDK"和x64运行时对我有用.
SDK https://www.microsoft.com/en-us/download/details.aspx?id=28359
x64 https://www.microsoft.com/en-my/download/details.aspx?id=28358
| 归档时间: |
|
| 查看次数: |
7902 次 |
| 最近记录: |