小编Eya*_*yad的帖子

找不到路径的一部分... bin\roslyn\csc.exe

我正在尝试运行从TFS源代码控制中检索的Asp.net MVC项目.我添加了所有程序集引用,我能够成功构建和编译,没有任何错误或警告.

但是我在浏览器中收到以下错误:

找不到路径'C:\ B8akWorkspace\B8akProject\B8akSolution\B8AK.Portal\bin\roslyn\csc.exe'的一部分.

以下是错误页面的完整屏幕截图.

在此输入图像描述

经过几天的研究,我了解Roslyn是.Net编译器平台,提供高级编译功能.但是,我不明白为什么我的构建试图找到\ bin\roslyn\csc.exe,因为我没有配置任何与Roslyn相关的东西,也没打算在我的项目中使用Roslyn.

.net c# asp.net asp.net-mvc roslyn

635
推荐指数
31
解决办法
32万
查看次数

'名称空间使用类似'错误

编码器,我试图使用我在这里找到的库将XAML字符串转换为HTML ,但我在创建一个允许我使用该库的对象的新实例时遇到问题.我已经在我的Asp.net项目中添加了对库的引用,我想在WCF文件中使用它.

问题是,每当我尝试使用new关键字实例化一个新对象时,我会收到一条错误消息:

'MarkupConverter'是'命名空间',但用作'类型'.

这是我的代码,请注意我正在创建一个新对象,就像上面库链接中显示的示例一样,请帮助:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Services;
using System.Net.Mail;
using System.ServiceModel.Activation;
using System.Data.SqlClient;
using MarkupConverter;

namespace AspPersonalWebsite
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class Service1 //: IService1
    {
        private string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
        private IMarkupConverter markupConverter;        

        [OperationContract]
        public string convertXAMLToHTML(string XAMLtext)
        {
            string htmlText = "";
            markupConverter = new MarkupConverter(); /*PROBLEM IS HERE*/
            htmlText = markupConverter.ConvertXamlToHtml(XAMLtext);
            return htmlText;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

.net c# compiler-errors

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

使用<services>标记配置WCF

我正在尝试解决上一个问题中发现的WCF错误.基本上,错误是:

读取XML数据时已超出最大字符串内容长度配额(8192).

有人建议在我的web.config中使用服务标签来解决我的问题.

现在,我面临着一个不同的问题.我无法弄清楚我如何配置web.config中的服务标签以在我的服务器上正常工作.当我尝试使用services标记时,我总是收到以下错误:

服务器没有提供有意义的回复; 这可能是由于合同不匹配,过早的会话关闭或内部服务器错误造成的.

这是我添加了services标签的web.config :

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding
      name="BasicHttpBinding_Service1"
      closeTimeout="00:01:00"
      openTimeout="00:01:00"
      receiveTimeout="00:10:00"
      sendTimeout="00:01:00"
      allowCookies="false"
      bypassProxyOnLocal="false"
      hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536"
      maxBufferPoolSize="524288"
      maxReceivedMessageSize="65536"
      messageEncoding="Text"
      textEncoding="utf-8"
      transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas
        maxDepth="32"
        maxStringContentLength="10000"
        maxArrayLength="16384"
        maxBytesPerRead="4096"
        maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint
    address="http://localhost:53931/WCF/Service1.svc"
    binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_Service1"
    contract="ServiceReference.Service1"
    name="BasicHttpBinding_Service1" />
</client>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors> …
Run Code Online (Sandbox Code Playgroud)

wcf web-config

7
推荐指数
1
解决办法
4万
查看次数

Azure功能执行速度极慢且不一致

我正在编写一些Azure函数脚本,它可以从内部数据库读取和写入内容,并将相关信息显示在网页中.

在加载调用Azure Function脚本的网页时,我注意到Web UI中的极端缓慢甚至超时.经过进一步调查,我意识到以下几点:

  1. Azure函数脚本有时需要10秒到1分钟以上才能连接到SQL数据库.
  2. 有时脚本将在几毫秒内运行,有时完全运行脚本需要3分钟以上.

这是我的Azure功能脚本:

module.exports = function(context, req) {

context.log("Function Started: " + new Date());

// Import package
const sql = require('mssql');
var _ = require('underscore-node');
var moment = require('moment');
var Promise = require('promise');
// Create a configuration object for our Azure SQL connection parameters
var config = {
    server: "***", // Use your SQL server name
    database: "***", // Database to connect to
    user: "***", // Use your username
    password: "***", // Use your password
    port: …
Run Code Online (Sandbox Code Playgroud)

javascript azure azure-sql-database azure-functions

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

C#中的DateTime间隔限制

问题: 我正在为我的顾问在学校实施调度程序.调度程序假设在星期一到星期五的上午8:00到下午5:00之间设置15分钟的间隔时间段.此外,顾问程序必须指定调度程序的开始和结束日期.调度程序还将提供一个选项,以指定15分钟时隙是否未打开.这意味着我的顾问将能够将特定时间段标记为不可用.

到目前为止 我所拥有的:我创建了一个简单的类:

public class TimeSlot  
    {
        public DateTime dateTime
        {
            get;
            set;
        }

        public bool isAvailable
        {
            get;
            set;
        }

        TimeSlot(DateTime dt, bool Avalible)
        {
            dateTime = dt;
            isAvailable = Avalible;
        } 
    }
Run Code Online (Sandbox Code Playgroud)

该类基本上表示调度程序中一个时隙的对象.我还有一个时间列表,用于保存有效时隙列表:

List<TimeSlot> TSList = new List<TimeSlot>();
Run Code Online (Sandbox Code Playgroud)

请注意,有效时间段表示以下内容:

  1. 日期在:周一至周五.
  2. 时间在:上午8:00至下午5:00
  3. 时间段在15分钟内.

另外,我有一个方法填写TSList如下:

 private void button_Next_Click(object sender, RoutedEventArgs e)
    {
        /* Getting the values of fromDate and toDate from the GUI controls*/
        DateTime fromDate = datePicker1.SelectedDate.Value;
        DateTime toDate = datePicker2.SelectedDate.Value;

        while (fromDate <= …
Run Code Online (Sandbox Code Playgroud)

c# datetime

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

LINQ-to-SQL更新问题

我正在尝试更新Tag表中的标签列表,如下所示:

List<Tag> tagList = GetUnitTagList(unitId);

        foreach (Tag tag in tagList)
        {
            tag.count = tag.count - 1;
        }

        db.SubmitChanges();
Run Code Online (Sandbox Code Playgroud)

这是GetUnitTagList()方法:

public static List<Tag> GetUnitTagList(int unitId)
{
    DataClassesDataContext db = new DataClassesDataContext();

    var tags = from x in db.UnitTags where x.UnitID == unitId select x.Tag;

    return tags.ToList();
}
Run Code Online (Sandbox Code Playgroud)

但我试图更新的价值没有得到更新.

但是,以下代码可以正常工作:

var tags = from x in db.UnitTags where x.UnitID == unitId select x.Tag;

        foreach (Tag tag in tags)
        {
            tag.count = tag.count - 1;
        }

        db.SubmitChanges();
Run Code Online (Sandbox Code Playgroud)

看起来如果我得到一个Tag对象的集合我们一个方法返回然后我无法更新记录.我尝试调试,没有异常!

那么,为什么更新记录的第一种方式不起作用,而第二种方式它没有问题呢?

.net c# linq linq-to-sql

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

科尔多瓦应用程序 - 不幸的是[应用程序名称]已经停止

我有一个Cordova应用程序,可以在ripple模拟器和Android设备上正常工作.由于一些奇怪的原因,该应用程序决定不在Android设备上工作,而它仍然在纹波模拟器上正常运行.每当我尝试在任何Android设备上部署应用程序时,我都会在设备上"不幸[应用程序名称已停止"警报.

经过几天的研究,我仍然无法确定这个问题的原因,虽然我怀疑它可能与插件有关.我试图删除一些不必要的插件,但我仍然无法在Android设备上运行.

任何建议或方向表示赞赏.

config.xml中

    <?xml version="1.0" encoding="utf-8"?>
<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" id="com.b8ak.b8akapp" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" defaultlocale="en-US">
  <name>B8ak ????</name>
  <description>A blank project that uses Apache Cordova to help you build an app that targets multiple mobile platforms: Android, iOS, Windows, and Windows Phone.</description>
  <author href="http://cordova.io" email="dev@cordova.apache.org">Eyad Alshabaan</author>
  <content src="index.html" />
  <access origin="*" />
  <!--To Grand Access to some href tags SEE: http://stackoverflow.com/questions/26271313/tel-sms-and-mailto-no-longer-working-in-android-after-upgrading-to-cordo-->
  <!--<access origin="tel:*" launch-external="yes"/>
  <access origin="geo:*" launch-external="yes"/>
  <access origin="mailto:*" launch-external="yes"/>
  <access origin="sms:*" launch-external="yes"/>
  <access origin="market:*" launch-external="yes"/>-->
  <vs:features />
  <preference name="SplashScreen" value="screen" /> …
Run Code Online (Sandbox Code Playgroud)

android cordova cordova-plugins visual-studio-cordova

0
推荐指数
2
解决办法
5986
查看次数