我有一个环境变量MyLocation
当我在applicationhost.config中设置此环境变量的虚拟目录物理路径时.我们到处都是404,这意味着变量设置不正确.
<virtualDirectory path="/" physicalPath="%MyLocation%" />
Run Code Online (Sandbox Code Playgroud)
我验证了变量存在.在机器和用户下尝试过.
我们的applicationhost.config包含在TFS中,这就是我们要将位置设置为环境变量的原因.有人试过吗?并且有运气吗?
所以我想要完成的是转换构建中的所有配置文件.
在项目文件中,它们看起来像这样:
<None Include="FooBar.config.xml">
<TransformOnBuild>true</TransformOnBuild>
</None>
<None Include="FooBar.config.Release.xml">
<DependentUpon>FooBar.config.xml</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
Run Code Online (Sandbox Code Playgroud)
一切都适用于Windows服务和Windows应用程序.但对于网络项目来说,慢速猎豹并没有进行变革.经过一些研究后,我发现:"对于Web项目,当您发布或打包应用程序时,文件会被转换." 从慢速猎豹扩展页面.事实上,当我发布Web项目时,转换正确完成.
那么如何更改慢速猎豹默认行为并在构建服务器上执行所有变换?
环境:
我有一个ObservableCollection<T>实现ISupportIncrementalLoading接口.
当我将此集合绑定到普通的gridview时,一切正常.
但是当我将ItemsPanel模板更改为VariableSizedWrapGrid时.增量加载不再起作用.
有效的Xaml:
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
Run Code Online (Sandbox Code Playgroud)
Xaml不起作用:
<ItemsPanelTemplate>
<VariableSizedWrapGrid Orientation="Vertical" ItemHeight="250" ItemWidth="250" Margin="0,0,80,0"/>
</ItemsPanelTemplate>
Run Code Online (Sandbox Code Playgroud)
我也发现了这个和这个.说明VariableSizedWrapGrid不支持ISupportIncremetalLoading.
是否有人编写过VariableSizedWrapGrid,它支持增量加载?还是开源解决方案?
在我看来,我的后台任务不起作用/触发.有什么方法可以调试它们,或者用集成测试来测试它.
这是一个示例后台任务:
public sealed class MyBackgroundTask : IBackgroundTask
{
private ITileService _tileService;
//Tried a parameter-less constructor in case IoC doesn't work
public MyBackgroundTask() : this(new TileService) {}
public MyBackgroundTask(ITileService tileService)
{
_tileService = tileservice;
}
public async void Run(IBackgroundTaskInstance taskInstance)
{
Debug.WriteLine("MyBackgroundTask is running " + taskInstance.Task.Name );
taskInstance.Canceled += TaskInstanceOnCanceled;
if (!_cancelRequest && SomeOtherCondition)
{
var deferral = taskInstance.GetDeferral();
await _tileService.UpdateLiveTile(null);
deferral.Complete();
}
}
}
Run Code Online (Sandbox Code Playgroud)
注册后台任务:(运行此代码,使用调试器检查)
var backgroundTaskBuilder = new BackgroundTaskBuilder
{
TaskEntryPoint =
"MyNamespace.MyBackgroundTask",
Name = "MyBackgroundTask"
}; …Run Code Online (Sandbox Code Playgroud) 情况
我们正在某些WCF服务上实现不同类型的安全性.ClientCertificate,UserName&Password和Anonymous.
我们有2个ServiceBehaviorConfigurations,一个用于httpBinding,另一个用于wsHttpBinding.(我们有基于声明的安全性的自定义授权策略)作为一项要求,我们需要为每项服务提供不同的端点.带有httpBinding的3个端点和带有wsHttpBinding的1个端点.
一项服务的示例:
注意:我们正在开发.NET 3.5
问题
第1部分:我们不能两次指定相同的服务,一次使用http服务配置,一次使用wsHttp服务配置.
第2部分:我们无法在端点上指定服务行为.(抛出和异常,未找到端点行为...服务行为无法设置为端点行为)
配置
第1部分:
<services>
<service name="Namespace.MyService" behaviorConfiguration="securityBehavior">
<endpoint address="http://server:94/MyService.svc/Anonymous" contract="Namespace.IMyService" binding="basicHttpBinding" bindingConfiguration="Anonymous">
</endpoint>
<endpoint address="http://server:94/MyService.svc/UserNameAndPassword" contract="Namespace.IMyService" binding="basicHttpBinding" bindingConfiguration="UserNameAndPassword">
</endpoint>
<endpoint address="https://server/MyService.svc/BasicSsl" contract="Namespace.IMyService" binding="basicHttpBinding" bindingConfiguration="BasicSecured">
</endpoint>
</service>
<service name="Namespace.MyService" behaviorConfiguration="wsHttpCertificateBehavior">
<endpoint address="https://server/MyService.svc/ClientCert" contract="Namespace.IMyService" binding="wsHttpBinding" bindingConfiguration="ClientCert"/>
</service>
</services>
Run Code Online (Sandbox Code Playgroud)
服务行为配置:
<serviceBehaviors>
<behavior name="securityBehavior">
<serviceAuthorization serviceAuthorizationManagerType="Namespace.AdamAuthorizationManager,Assembly">
<authorizationPolicies>
<add policyType="Namespace.AdamAuthorizationManager,Assembly" />
</authorizationPolicies>
</serviceAuthorization>
</behavior>
<behavior name="wsHttpCertificateBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<serviceAuthorization serviceAuthorizationManagerType="Namespace.AdamAuthorizationManager,Assembly">
<authorizationPolicies>
<add policyType="Namespace.AdamAuthorizationManager,Assembly" />
</authorizationPolicies>
</serviceAuthorization>
<serviceCredentials>
<clientCertificate> …Run Code Online (Sandbox Code Playgroud) 我似乎无法找到Windows 8 metro应用程序的依赖注入框架.
是否有win8 metro应用程序的框架?
Ninject尚未支持win8 metro.那么有人有建议吗?(城堡,春天......)
我们在 TFS (2010) 团队构建上运行 SonarQube(5.0.1) 和 sonar.net-runner。
FxCop 工作正常,一切运行完美,我在声纳中看到了所有问题。
但是,当我尝试在声纳中提取测试结果时,我遇到了问题。
当我将该属性设置为sonar.cs.vstest.reportsPaths文件的绝对文件时trx,它会将我的测试结果发布到声纳。太好了。
但是当我使用通配符时,我的测试结果不会在声纳中发布。不太好
我试过的配置。
#1
sonar.cs.vstest.reportsPaths=E:/Builds/1/74/TestResults/*.trx
#2
sonar.cs.vstest.reportsPaths=TestResults/*.trx
#3
sonar.cs.vstest.reportsPaths=**/*.trx
#4
sonar.cs.vstest.reportsPaths=.**/*.trx
Run Code Online (Sandbox Code Playgroud)
完整配置
# ----- Project identification
sonar.projectVersion=2.6.0.0914
sonar.projectName=MySolution
sonar.projectKey=Company:MySolution
# ----- Use UTF-8 encoding, otherwise analysis is unable to read files
sonar.sourceEncoding=UTF-8
# ----- Visual studio bootstrapper
# Enable the Visual Studio bootstrapper
sonar.visualstudio.enable=true
#Define the solution to run sonar against
sonar.visualstudio.solution=MySolution.sln
#Specify the pattern of the test projects
sonar.visualstudio.testProjectPattern=.*Test*.
#We are using …Run Code Online (Sandbox Code Playgroud) 我有一个实体。具有以下属性:
public class Entity
{
public int CustomerId { get; set; }
public Customer { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
如何两次映射CustomerId。一次是int属性,一次是多对一关系?
<many-to-one name="Customer" column="[CustomerId]" class="Customer"/>
<property name="CustomerId" column="[CustomerId]" type="Int64" />
Run Code Online (Sandbox Code Playgroud)
只是这个,行不通。我已经尝试过,使它们成为只读但没有成功。
c# ×1
iis-express ×1
lazy-loading ×1
live-tile ×1
msbuild ×1
nhibernate ×1
slowcheetah ×1
sonar-runner ×1
sonarqube ×1
unit-testing ×1
wcf ×1
windows-8 ×1
xaml ×1