小编Jac*_*k M的帖子

从MVC4升级到MVC5

我已通过更新剃刀,在我引用的MVC网页从MVC4到MVC5预发布升级可怕的错误,我已经System.Web.Mvc,System.Web.Webpages,System.Web.Webpages.RazorSystem.Web.Razor作为版本v4.0.30319,当我运行我的应用程序获得

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to 
[B]System.Web.WebPages.Razor.Configuration.HostSection.

Type A originates from 
'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.

Type B originates from
'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\membership\c70f06fe\9163b1ca\assembly\dl3\291c956e\73c25daa_cf74ce01\System.Web.WebPages.Razor.dll'.
Run Code Online (Sandbox Code Playgroud)

这与http://www.asp.net/whitepapers/mvc4-release-notes相同

谢谢

添加堆栈跟踪:

[InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be      cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. 
Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc web-config upgrade asp.net-mvc-4 asp.net-mvc-5

55
推荐指数
2
解决办法
4万
查看次数

无法找到ID为"Safari1Plus"的浏览器或网关元素

我的机器上有一个陌生人错误,我在我的应用程序的app_browser中有一个.browser文件,它有以下几行:

browsers>
<!-- Disable the Menu Adapter for the Safari/Chrome browser-->
<browser refID="Safari1Plus">
    <controlAdapters>
        <adapter controlType="System.Web.UI.WebControls.Menu"
                         adapterType="" />
    </controlAdapters>
</browser>
Run Code Online (Sandbox Code Playgroud)

当我尝试加载应用程序时,我得到了主题中的错误,但我的同事(我们都使用相同的代码库)都没有得到它.

我有一种本能,即错误与IIS有关,我花了一整天的时间试图解决这个问题,但没有成功.

为了使这个工作在此期间,我已经用默认值替换了safari1plus,但是底层的问题是我的一个页面上有一个gridview,它在我的本地机器上没有显示任何东西,并且它在其他开发机器上工作.我不确定为什么或原因,但它看起来像是一个基于配置的问题,也许一两个人不得不处理这个问题.

任何有想法的人都欢迎.

显然,操作系统是Win 7 64位,VS2010 Professional和IIS7.

我也检查了Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers和Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers以及Framework64目录的内容,所有内容看起来都一样(与其他开发机器相比)

非常感谢

asp.net iis asp.net-mvc user-controls visual-studio-2010

6
推荐指数
2
解决办法
1万
查看次数

Microsoft.Internal.Assumes + InternalErrorException:发生内部错误

我在尝试加载Visual Studio 2012时遇到了这个错误,遇到了异常.这可能是由扩展引起的,并且有一个位置可以获取更多信息 C:\Users\~\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml 以及检查我有以下位置的位置错误我明显不知道不明白:

 Microsoft.Internal.Assumes+InternalErrorException: Internal error occurred. 
Additional information: ''. at    System.ComponentModel.Composition.Hosting.ImportEngine.InPrerequisiteLoop() at 
System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part) at 

System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports) at 
System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart part) at 
    System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition) at 
System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart) at 
System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore() at System.ComponentModel.Composition.Primitives.Export.get_Value() at 
System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export) at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedLazyOfTM>b__1() at System.Lazy`1.CreateValue() at 
System.Lazy`1.LazyInitValue() at System.Lazy`1.get_Value() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeMatchingFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable`1 lazyFactories, Func`2 getter,IContentType dataContentType, Object errorSource)
Run Code Online (Sandbox Code Playgroud)

有没有人遇到过这个错误?

visual-studio-2012

5
推荐指数
2
解决办法
3977
查看次数

设置跨度可见且不可见

我有一个跨度是JSON对象的一部分,并且由于某些配置选项需要将其设置为可见或不可见.

我有以下代码,但我正在努力使其工作:

function isc_getsvldata() {

        return JSON.stringify(
            {

                polygon_shading_template_hash:
                {
                    AVAILABLE_3_NONE:
                    {
                        interior: 0x<%= System.Drawing.ColorTranslator.ToHtml(Config.ColourSoldout).TrimStart('#') %>,
                        border: 0x<%= System.Drawing.ColorTranslator.ToHtml(Config.ColourSoldout).TrimStart('#') %>,
                        poly_tool_tip_template:

                             <%= Config.ISCavailability ?"<br><span class='textBlack'> [% @1:((polygon.counters[1] * 100) / polygon.counters[0]); %]%</span>":"<span class='someotherclass'>Nothing</span>"%>
                    }
                }
            }
        );
}
Run Code Online (Sandbox Code Playgroud)

.net html javascript asp.net

3
推荐指数
1
解决办法
2万
查看次数

Visual Studio 2012和Intellisense

我想这只是发生在我身上,但每次我在VS中启动我的项目时我都要做devenv.exe/resettsettings否则intellisense不起作用.有谁知道为什么有特殊原因?

c# asp.net-mvc-3 visual-studio-2012

3
推荐指数
1
解决办法
7869
查看次数

覆盖枚举

我有一套枚举

public enum enums
{
    enum1,
    enum2,
    enum3,
    enum4,
    enum5
}
Run Code Online (Sandbox Code Playgroud)

在另一个类中我想要两个对象:

var object1 = new enums();//Here I want an enum of enum1,enum2
var object2 = new enums();//Here I want an enum of enum3,enum4,enum5
Run Code Online (Sandbox Code Playgroud)

是否有人知道如何做到这一点?

c# enums

2
推荐指数
1
解决办法
130
查看次数

在角度8中使用@viewChild

我有一个使用@ViewChild的应用程序,下面是我的代码

 @ViewChild('paginator', { read: MatPaginator, static: true}) public paginator: MatPaginator;
Run Code Online (Sandbox Code Playgroud)

在前面,我正在使用, <mat-paginator [ngStyle]="{'display': orders.length > 0 ? 'flex': 'none' }" #paginator> 并且已经实现了AfterViewInit,这是我只需要检查分页器已初始化的代码:

ngAfterViewInit(): void {
    console.log('tab group', this.paginator);
}
Run Code Online (Sandbox Code Playgroud)

但是this.tabGroup是未定义的,因此我无法设置它的属性。我究竟做错了什么。

谢谢

javascript typescript angular-material angular8

2
推荐指数
1
解决办法
1282
查看次数

在C#中写一个递减数组

这是你需要在一些相当明显的事情上需要一点帮助的日子之一,我需要创建一系列递减年份,并且需要显示当前年度的五年减量现在它将是(2012,2011,2010,2009, 2008)等....

我想不出怎样在c#中做任何帮助都会受到欢迎.

问候

c# arrays c#-4.0

1
推荐指数
1
解决办法
347
查看次数