小编Stu*_*rla的帖子

在TFS在线构建后如何访问工件文件夹?

PreInfo:我有.net核心web api(vs2015)与普通项目混合.

我现在花了差不多2天的时间才开始工作,搜索并尝试了我能想到的一切,但我只是想让我的生活得到TFS在线的构建和发布才能一起玩.

构建(发布工件步骤)说" 目录'D:\ a\1\a'是空的.没有任何东西可以添加到构建工件'drop'. "

但"跑点网"一步说

"发布到D:\ a\1\s\Operator\MobileService\root\MobileService\src\AMP.Operator.MobileService\bin\release \net452\win7-x64\publish"

...所以它必须在某个地方,释放可以拿起它,但无论我尝试什么,我都无法得到它.

这是我的构建设置 我的构建

dotnet运行 dotnet运行

出版 发布

和$(System.DefaultWorkingDirectory)/ MobileService-Dev的现实请注意,我已经尝试了构建中的$(build.artifactstagingdirectory)的每个组合,但没有运气但是我确定这应该指向构建的发布文件夹 realse

我希望有人能指出我的解决方案.我真的不明白这项工作有多难.

msbuild .net-core azure-devops

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

在.net Core中调用SOAP服务

我正在将一个.net 4.6.2代码移植到一个调用SOAP服务的.net Core项目中.在新代码中我使用C#(由于一些配置原因,我现在还不记得为什么).

但我得到以下例外.

收到对https://someurl.com/ws/Thing.pub.ws:Something的HTTP响应时发生错误.这可能是由于服务端点绑定不使用HTTP协议.这也可能是由于服务器中止HTTP请求上下文(可能是由于服务关闭).请参阅服务器日志以获取更多详

投掷它的代码是

try
{
    var binding = new BasicHttpsBinding(BasicHttpsSecurityMode.Transport);
    binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;

    var endpoint = new EndpointAddress(new Uri("https://someurl.com/ws/TheEndpoint.pub.ws:AService"));

    var thing= new TheEndpoint.AService_PortTypeClient(binding, endpoint);
    thing.ClientCredentials.UserName.UserName = "usrn";
    thing.ClientCredentials.UserName.Password = "passw";

    var response = await thing.getSomethingAsync("id").ConfigureAwait(false);

}
finally
{
    await thing.CloseAsync().ConfigureAwait(false);
}
Run Code Online (Sandbox Code Playgroud)

基于旧的配置工作调用服务是这样的,我错过了什么?

<bindings>
  <basicHttpsBinding>
    <binding name="TheEndpoint_pub_ws_AService_Binder" closeTimeout="00:02:00"
        openTimeout="00:02:00" receiveTimeout="00:03:00" sendTimeout="00:03:00">
      <security mode="Transport">
        <transport clientCredentialType="Basic" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpsBinding>
</bindings>
<client>
  <endpoint address="https://someurl.com/ws/Thing.pub.ws:AService"
      binding="basicHttpsBinding" bindingConfiguration="TheEndpoint_pub_ws_AService_Binder"
      contract="TheEndpoint.AService_PortType" name="TheEndpoint_pub_ws_AService_Port" /> …
Run Code Online (Sandbox Code Playgroud)

c# wcf soap .net-core

23
推荐指数
4
解决办法
5万
查看次数

在sql postdeployment构建脚本中使用变量?

我希望能够做的是能够在Visual Studio数据库项目中创建一个定义变量的publising xml脚本,该脚本将用于编写脚本.

我的问题是我得到一个错误:"SQL72008:未定义变量DeployType." 如果我没有在后部署脚本中定义变量,就像这样":setvar DeployType"varchar(100)"

当我运行publish.xml时,DeployType参数正确地设置在生成的脚本的顶部但是该值被":setvar DeployType"varchar(100)覆盖.所以为了使这项工作,我需要手动删除运行此脚本之前的行.

所以问题是如何在没有在postdeployment脚本中默认setvar变量的情况下让项目构建并能够发布?

在此输入图像描述

这是我的PostDeployment.sql文件的内容,它不会在没有默认DeployType变量的情况下构建

--The line causing my problems. I would like to skip it somehow.
:setvar DeployType "varchar(100)"

Print 'Always include core'
:r ..\Data\Core\_BaseCore.sql

--Conditionaly add based on DeployType comming from the publishing.xml
IF ('$(DeployType)' = 'A')
BEGIN
:r ..\Data\A\_BaseKnap.sql
END
ELSE IF ('$(DeployType)' = 'B')
BEGIN
:r ..\Data\B\_BaseB.sql
END
Run Code Online (Sandbox Code Playgroud)

这是Database.publish.xml文件中的内容

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <PropertyGroup>
   <IncludeCompositeObjects>True</IncludeCompositeObjects>
   <TargetDatabaseName>db name</TargetDatabaseName>
   <DeployScriptFileName>Database.sql</DeployScriptFileName>
   <ProfileVersionNumber>1</ProfileVersionNumber>
   <TargetConnectionString>Connection string</TargetConnectionString>
 </PropertyGroup>
 <ItemGroup> …
Run Code Online (Sandbox Code Playgroud)

sql msbuild sqlcmd database-project

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

如何从Exchange EWS获得真正免费的房间

并抱歉问题的标题很差

我试图从我的交换服务器获得所有免费房间(不是预订的房间).问题是,我也得到了我预订的房间,但没有人接受.

我预订房间后,我想将它们从列表中排除.

这是我用来预订房间的代码

ExchangeService service;
//...code to new-up and config service

var request = new Appointment(service)
{
  Subject = booking.Subject,
  Start = booking.Start,
  End = booking.End,
  Location = booking.Room
};

request.RequiredAttendees.Add(booking.Person);
request.RequiredAttendees.Add(booking.Room);

request.Save(SendInvitationsMode.SendOnlyToAll);
Run Code Online (Sandbox Code Playgroud)

要注意我已经尝试在Save()之后直接调用request.Accept()但没有那个"真正预订"房间.在Outlook中按"接受"是唯一的"修复".不用说,我已经尝试了我能找到的关于这个问题的一切(我不经常与Exchange合作).

然后获得免费房间的代码

var rooms = service.GetRooms(locationAddress);

// all the meeting rooms at location
var rooms= rooms.Select(i => new AttendeeInfo { SmtpAddress = i.Address, AttendeeType = MeetingAttendeeType.Room });

// Get all availabilites from all rooms at given locations
var availability = …
Run Code Online (Sandbox Code Playgroud)

c# exchangewebservices

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

无法使用数据库项目构建 .net 核心项目。错误 MSB4019

我有一个新的 .net Core 2.0 Web API 项目(在 Visual Studio 2017 版本 15.3.5 中),如果我添加一个新的数据库项目,我将无法构建解决方案

错误 MSB4019:未找到导入的项目“C:\Program Files\dotnet\sdk\2.0.0\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTask​​s.targets”。确认声明中的路径正确,并且该文件存在于磁盘上。

我尝试了各种解决方案

  • 安装了几乎所有 Visual Studio 安装程序缺少的东西
  • 已安装的 Visual Studio 构建工具 2017
  • 修复的 Visual Studio
  • 运气不好,我试图在 C:\ 上找到 Microsoft.Data.Tools.Schema.SqlTask​​s.targets 文件,以在项目文件中添加对它的引用(然后我不知道在 VSTS 中构建解决方案时这是否有效)。

那么为什么我可以将一个数据库项目添加到一个普通的 API 项目中,并且一切正常,但不能添加到 .net 核心项目中呢?

数据库项目是否不适用于 .net Core?我已经搜索了这方面的信息,但很抱歉我找不到它。

我不知道该怎么做。希望有人能帮忙。

database-project asp.net-core visual-studio-2017

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

当前文件中下一个错误的 Visual Studio 快捷方式?

有人知道在 Visual Studio 中(不是在 VSCode 中)当前文件中转到下一个错误的快捷方式的任何更改?

我知道CTRL+ SHIFT+F12F8但这只是去到下一个错误在错误列表

visual-studio

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

如何在Xamarin.Forms中同时长按和短按列表项?

我需要在列表中长按和短按

我正在使用效果来长按列表中的项目(ListView/CollectionView),但是当该效果起作用时,短按(点击)不起作用!

我的问题是:我是否需要创建另一个短点击效果版本,或者我可以以某种方式同时拥有两者吗?我到处搜索,没有任何信息可以帮助我找到解决方案......

我一直在我的存储库中使用此代码,但无法使两者同时工作。

<CollectionView
  x:Name="carsCollection"
  ItemsSource="{Binding Cars}"
  SelectionMode="Single"
  SelectionChangedCommand="{Binding TapCommand}"
  SelectionChangedCommandParameter="{Binding Source={x:Reference carsCollection}, Path=SelectedItem}"
  BackgroundColor="Orange">
  <CollectionView.ItemTemplate>
    <DataTemplate>
      <ContentView>
        <StackLayout
          effects:LongPressedEffect.Command="{Binding Path=BindingContext.LongTapCommand, Source={x:Reference ThisPage}}"
          effects:LongPressedEffect.CommandParameter="{Binding .}">
          <Label Text="CollectionView: Long Press works but not normal selection" />
          <StackLayout.Effects>
            <effects:LongPressedEffect />
          </StackLayout.Effects>
        </StackLayout>
      </ContentView>
    </DataTemplate>
  </CollectionView.ItemTemplate>
</CollectionView>
Run Code Online (Sandbox Code Playgroud)

包含命令的 ViewModel 位于此处

xaml xamarin.forms xamarin.forms.listview

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

使用 FakeItEasy 在方法中模拟方法

如何模拟/伪造另一个函数中调用的函数的结果?通常 Test2 将是一种我不喜欢获取真实数据的 DataAccess 方法。我喜欢我的单元测试测试的是业务逻辑。

这就是我现在所拥有的,但它根本不起作用。总和始终断言为 5!

public int Test1()
{
    var value = this.Test2(); //Unittest should substitute with 5
    var businesslogic = value + 10; //The business logic

    return businesslogic;
}

public int Test2()
{
    return 10; //I try to mock this value away in the test. Don´t go here!
}
Run Code Online (Sandbox Code Playgroud)

然后我有一个单元测试,我想在我的“业务逻辑”上运行。

[TestMethod()]
public void TestToTest()
{
//Arrange
var instance = A.Fake<IClassWithMethods>();

      //Make calling Test2 return 5 and not 10.
A.CallTo(() => instance.Test2()).Returns(5);

      //Call the method 
var sum = …
Run Code Online (Sandbox Code Playgroud)

c# unit-testing fakeiteasy

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

将所有视图重定向到一个视图(例如UnderConstructionView)的最佳方法

有可能以某种方式将所有视图路由到一个特定视图吗?我希望有一个"Under Construction view",它始终是默认视图,直到我"翻转开关"而不必构建.在此之前,所有其他控制器操作都会路由到此视图

我很想知道我是否可以在web.config中完成它,或者如果我必须在Global.asax中的RegisterRoutes中有一些if/else.

web-config asp.net-mvc-routing asp.net-mvc-3

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