小编Nic*_*zer的帖子

更改背景不透明度而不更改内容不透明度

我想知道如何在不影响内部子控件的情况下更改WPF窗口背景的不透明度.当我将Window属性'Opacity'更改为0.5时,我会得到一个半透明窗口,但窗口内的图像也继承了0.5不透明度值,那么我怎样才能只为窗口设置不透明度?

.net wpf opacity

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

ActionLink在URL中显示参数而不是查询字符串?

我定义了这条路线:

routes.MapRoute(
                   "Details", // Route name
                   "{home}/{details}/{id}/{name}", // URL with parameters
                   new
                   {
                       controller = "Home",
                       action = "Details",
                       id = UrlParameter.Optional,
                       name = UrlParameter.Optional
                   } // Parameter defaults
               );
Run Code Online (Sandbox Code Playgroud)

ActionLink:

 @Html.ActionLink("Show Details", "Details", "MyController", new { id = 1, name ="a" })
Run Code Online (Sandbox Code Playgroud)

动作链接导致/Home/Details/1?name=a我追随/Home/List/1/a

asp.net-mvc asp.net-mvc-3

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

使用身份验证时,TFS WorkItemStore在ASP.NET MVC应用程序中抛出COMException

我完全被这个和无休止的google/stackoverflow搜索所困扰.我正在使用2012 Visual Studio SDK连接到TFS 2012并查询工作项存储.下面的代码在控制台应用程序和使用身份验证的ASP.NET MVC应用程序中,或在我的本地计算机上运行的任何场景中都可以正常运行.但是,COMException当我尝试从已部署到服务器并使用(Windows)身份验证的MVC应用程序中实例化WorkItemStore时,我得到了一个.

如果我<authentication mode="Windows" />在web.config中有元素,那没有区别; 只要[Authorize]我的控制器或其任何操作方法上有属性,只要调用下面的最后一行代码,我就会得到一个异常.如果我删除该[Authorize]属性,则不会发生异常.如果我调用代码修饰之前的某个时刻调用下面的代码[Authorize],则不会发生异常.不知何故,使用AuthorizeAttibute会导致此异常.

有关如何解决这个问题的任何想法?或者至少为了更准确地识别真正的根问题?我真的很想了解这里发生了什么.

Uri tfsAddress = new Uri("http://tfs-address:8080/tfs/DefaultCollection");
var myCreds = new NetworkCredential("userName", "password", "domain");
var tfsCreds = new TfsClientCredentials(new WindowsCredential(myCreds), false);

var defaultCollection = new TfsTeamProjectCollection(tfsAddress, tfsCreds);
defaultCollection.EnsureAuthenticated();

var store = defaultCollection.GetService<WorkItemStore>(); // <-- EXCEPTION
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

[COMException(0x80004005):错误HRESULT E_FAIL已从调用COM组件返回.]

Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative.BeginDataStoreInit(IntPtr handle,String defaultCachePath,String instanceId,Int32 cacheVersion)+0

Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.Datastore.BeginDataStoreInit(String defaultCachePath,String instanceId,Int32 cacheVersion)+56

Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal()+ 598

Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITfsTeamProjectCollectionObject.Initialize(TfsTeamProjectCollection teamProjectCollection)+23

Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.InitializeTeamFoundationObject(String fullName,Object instance)+43

Microsoft.TeamFoundation.Client.TfsConnection.CreateServiceInstance(程序集程序集,String …

c# authentication asp.net-mvc tfs-sdk tfs2012

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