问题:

有很多帖子,我现在尝试了很多东西。 但无济于事。 我自己基本上是一个Winforms开发人员,几天前我的公司正在开展网络计划,开始研究这个网络。

我有一个ASP.Net项目,我想在本地IIS上托管它。 Project properties -> Web设置中,我选择了Use Local IIS Server并将URL作为localhost/MyApp 我尝试在我的firefox浏览器上访问它并收到错误,因为HTTP Error 503. The service is unavailable.

以前我还有很多其他错误,我一个接一个地修复它们。 但是对这一点感到震惊。 这些是我项目中的设置

  1. 应用程序池设置为ASP.Net v4.0 Classic
  2. 应用程序池Enable 32 bit Application属性为true
  3. 应用程序池已启动
  4. 项目构建属性设置为Any CPU for Target框架

但我想提一个奇怪的行为。 以下是我所面临的问题

  1. 应用程序池已启动
  2. 我尝试访问我的本地网站(通过将url作为localhost/MyApp )
  3. 我收到错误为HTTP Error 503. The service is unavailable
  4. 应用程序池已停止

我看过以下链接 ,我已经尝试过了。 对于上述行为,我到达了这里 根据这个链接,计算机名称不应该有. 在里面。 我没有. 在我的计算机名称中,但确实有-在其中。 我的域名也包含. 在里面。 此外,我无法更改这些设置,因为我的办公室笔记本电脑和我们的TFS设置绑定到我们的域名和计算机名称。

任何人都可以帮我理解发生的事情吗? 请指导我。 谢谢。

编辑

我在Global.asax有以下代码。 Application_BeginRequest方法在同一文件中为空。

protected override void Application_Start(object sender, EventArgs e)
{
    base.Application_Start(sender, e);
    String _path = String.Concat(System.AppDomain.CurrentDomain.RelativeSearchPath, ";",
                                         System.Environment.GetEnvironmentVariable("PATH"));
    System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process);
    MyAppLog.Initialize();
    MyAppLog.WriteMessage("Application Started");
}

更新

根据评论中的建议,我可以从Cassini运行该网站。

There are number of posts on this and I have tried many a things by now.But to no avail.Myself a Winforms Developer basically, started working on this Web stuff few days back as my company is taking Web initiatives.I have a ASP.Net project and I want to host it on local IIS.In Project properties -> Web settings I chose Use Local IIS Server and gave a url as localhost/MyApp .I tried accessing it on my firefox browser and received error as HTTP Error 503. The service is unavailable.Previously I got many other errors and I one by one fixed them all.But struck with this one.These are the settings I have in my projectApplication Pool set to ASP.Net v4.0 ClassicApp Pool Enable 32 bit Application property is trueApp Pool is startedProject build property set to Any CPU for Target frameworkBut I would like to mention a weird behavior.Following is something that I am facingApplication Pool is StartedI try to access my local website (by giving url as localhost/MyApp )I receive the error as HTTP Error 503. The service is unavailableApplication Pool is StoppedI have seen following link and I have already tried it.For the above behavior I reached here .According to this link, Computer name should not have .in it.I don’t have any .in my Computer name but do have - in it.Also my domain name contains .in it.Moreover I can’t change these settings as its my office laptop and our TFS settings are bound to our Domain and Computer Names.Can anyone help me to understand whats happening?Please guide me.Thanks.EditI have following code in Global.asax .Application_BeginRequest method is empty in same file.UpdateAs per the suggestions in Comment, I am able to run the website from Cassini.

问题:

我有一个使用C#在VS2010中编写的Windows窗体应用程序,并在app.config文件中获得以下错误:

Message 4   Could not find schema information for the attribute 'name'
Message 8   Could not find schema information for the attribute 'name'
Message 12  Could not find schema information for the attribute 'name'
Message 5   Could not find schema information for the attribute 'serializeAs'
Message 15  Could not find schema information for the element 'CCP_Utility.Settings1'
Message 2   Could not find schema information for the element 'CCP_Utility.Properties.Settings'
Message 3   Could not find schema information for the element 'setting'
Message 1   Could not find schema information for the element 'userSettings'
Message 6   Could not find schema information for the element 'value'

我需要更改代码才能解决此问题? 我在哪里可以编辑CCP_Utility.Settings1CCP_Utility.Properties.Settings ?

这是app.config代码:

<configuration>
<configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
        <section name="CCP_Utility.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        <section name="CCP_Utility.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
<userSettings>
  <CCP_Utility.Properties.Settings>
    <setting name="SourceDir" serializeAs="String">
      <value />
    </setting>
    <setting name="TargetDir" serializeAs="String">
      <value />
    </setting>
    <setting name="CorpID" serializeAs="String">
      <value />
    </setting>
  </CCP_Utility.Properties.Settings>
    <CCP_Utility.Settings1>
        <setting name="sourceDir" serializeAs="String">
            <value />
        </setting>
        <setting name="targetDir" serializeAs="String">
            <value />
        </setting>
    </CCP_Utility.Settings1>

   </userSettings>
</configuration>

I have a windows forms application written in VS2010 with C# and get the following errors in the app.config file:What do I have to change in the code to fix this issue?Where can I edit what’s in CCP_Utility.Settings1 and CCP_Utility.Properties.Settings ?Here’s the app.config code:

问题:

我已经在Google上搜索了很多东西,但找不到适合我的情况,更不用说解决了。 尝试导航到我网站中的哪个地址都没有关系(即使不存在的地址也会出现此错误而不是404),但我得到的消息却完全相同(路径始终为“ /”)。 有任何想法吗?

Server Error in '/' Application.

Failed to map the path '/'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Failed to map the path '/'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[InvalidOperationException: Failed to map the path '/'.]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +336

[HttpException (0x80004005): Failed to map the path '/'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11556592
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4813333

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

更新:发布此消息后几分钟,我回到了网站-未更改代码或配置-错误消失了。 我真的很困惑,但这不再是问题。 不知道该怎么办。

I’ve searched and searched on Google, and I can’t find anything that even seems applicable to my situation, let alone solves the problem.It doesn’t matter which address in my website I try to navigate to (even addresses that don’t exist give this error instead of a 404), I get the exact same message (the path is always ‘/’).Any ideas?UPDATE: I went back to the site a few minutes after posting this–made no changes to code or configuration–and the error went away.I’m really baffled, but it is no longer a problem.Not sure what should be done with this question.

问题:

我有一个测试班,下面我发布了一个测试班的样本测试

namespace AdminPortal.Tests.Controller_Test.Customer
{
    [TestClass]
    public class BusinessUnitControllerTests
    {
        private IBusinessUnitRepository _mockBusinessUnitRepository;
        private BusinessUnitController _controller;

        [TestInitialize]
        public void TestInitialize()
        {
            _mockBusinessUnitRepository = MockRepository.GenerateMock<IBusinessUnitRepository>();
            _controller = new BusinessUnitController(_mockBusinessUnitRepository);
        }

        [TestCleanup]
        public void TestCleanup()
        {
            _mockBusinessUnitRepository = null;

            _controller.Dispose();
            _controller = null;

        }

        #region Index Action Tests
        [TestMethod]
        public void Index_Action_Calls_GetAllBusinessUnit()
        {
            _mockBusinessUnitRepository.Stub(x => x.GetAllBusinessUnit());

            _controller.Index();

            _mockBusinessUnitRepository.AssertWasCalled(x=>x.GetAllBusinessUnit());
        }
    }
}

当我运行项目时,出现以下屏幕 在此处输入图片说明

我检查了引用,并且测试项目具有对主项目的引用。 知道为什么测试未运行或说测试没有定论吗?

编辑1:

我在这里看到了一篇文章,并将测试设置的默认处理器体系结构更改为X64,但仍然无法使用。

I have a test class and below I have posted a sample test from the test classWhen I run the project I get following screenI checked the references and the test project has the reference to main project.Any idea why the test are not running or saying that they were inconclusive?Edit 1:I saw a post here and changed my test’s setting’s default processor architecture to X64 but it still doesn’t work.

问题:

我安装了Visual Studio 2012和DevExpress 13.1。 在Visual Studio启动时,它产生了此附件图像显示的错误,

‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’程序包未正确加载。

该问题可能是由于配置更改或安装其他扩展程序引起的。 您可以通过检查文件’C:\\ Users \\ must \\ AppData \\ Roaming \\ Microsoft \\ VisualStudio \\ 11.0 \\ ActivityLog.xml’获得更多信息。

继续显示此错误消息?

Microsoft Visual Studio-'Microsoft.VisualStudio.Editor.Implementation.EditorPackage'程序包未正确加载。

此错误也会出现在Visual Studio 2017中。

I installed Visual Studio 2012 and DevExpress 13.1.As Visual Studio started, it generated an error shown by this attached image,The ‘Microsoft.VisualStudio.Editor.Implementation.EditorPackage’ package did not load correctly.The problem may have been caused by a configuration change or by the installation of another extension.You can get more information by examining the file ‘C:\\Users\\must\\AppData\\Roaming\\Microsoft\\VisualStudio\\11.0\\ActivityLog.xml’.Continue to show this error message?This error also appears in Visual Studio 2017.