我们有一个在Intranet上运行的Web应用程序,我正在尝试使用Visual Studio 2010将其发布到Internet.目标服务器正在运行iis7并且Web管理服务正在运行.
在Visual Studio 2010上,我的服务URL是:
网站/应用程序是:
默认网站/ WebApp
在目的地上标记为IIS应用程序并且允许不受信任的证书被检查,我正在使用管理帐户.
Visual Studio返回以下错误:
启动Web部署将应用程序/包发布到 https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default%20Web%20Site ... C:\ Program Files\MSBuild\Microsoft\VisualStudio\v10 .0\Web\Microsoft.Web.Publishing.targets(3588,5):错误:Web部署任务失败.(远程代理(URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=无法联系默认网站.确保在目标计算机上安装并启动了远程代理服务.)
无法联系远程代理(URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default网站).确保在目标计算机上安装并启动了远程代理服务.收到了不受支持的回复.响应头'MSDeploy.Response'是''但是'v1'是预期的. 远程服务器返回错误:(403)禁止.
有没有有效的SSL证书发布它的任何想法?
有没有办法DateTime.Now在Sql Server中设置列的默认值?
例:
table Event
Id int (auto-increment) not null
Description nvarchar(50) not null
Date datetime not null
Run Code Online (Sandbox Code Playgroud)
这条线:
Insert into Event(Description) values('teste');
Run Code Online (Sandbox Code Playgroud)
应该插入一行,Date值应该是当前日期.
我正在尝试使用报告服务器Web服务按代码部署报告服务器解决方案:http://_Server_Name_/ReportServer/ReportService2010.asmx?wsdl.
可悲的是我在网上找不到任何例子.只有来自MSDN的一些模糊信息.
通过Business Intelligence Development Studio发布时,它会发布共享数据源,然后发布报告.我正试图在C#上做类似的事情:
var service = new ReportingService2010();
service.Credentials = new NetworkCredential(username, password, domain);
foreach(var dataSourcePath in GetDataSources()) {
string name = Path.GetFileNameWithoutExtension(dataSourcePath);
Byte[] content = GetFileContent(dataSourcePath);
service.CreateCatalogItem("DataSource", name, parent, true, content, null, out warnings);
}
Run Code Online (Sandbox Code Playgroud)
但是CreateCatalogItem给了我以下SoapException异常:
输入XML不符合架构.API语法中描述了XML语法.对于报告中的XML,请参阅报告定义语言语法.---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidXmlException:输入XML不符合架构.API语法中描述了XML语法.对于报告中的XML,请参阅报告定义语言语法.
有什么我做错了或我应该采取的任何其他方法?
我有一个大型的WPF解决方案,可以运行2年.现在,当最奇怪的事情发生时,我们正在为该解决方案运行自动构建环境.
在50%的构建中,我收到此错误:
例外:无法将类型为"System.Windows.Controls.StackPanel"的对象强制转换为"System.Windows.Controls.Border".标记文件中对象'System.Windows.Controls.StackPanel'出错...
看起来很简单.问题是我的代码背后是:
<UserControl x:Class="SiSM.Episode.Mishap.SpecializationList" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Converters="clr-namespace:Utils.Converters;assembly=Utils" ...>
<Border x:Name="root" BorderThickness="0.5">
<StackPanel x:Name="stackPanelRoot" VerticalAlignment="Stretch">
<Grid>
...
</Grid>
<StackPanel>
...
</StackPanel>
<ScrollViewer>
...
</ScrollViewer>
</StackPanel>
</Border>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
错误在这里,因为如果我切换dockpanel的stackpanel,错误消息将更改为dockpanel.
我的构建环境如下:
将代码复制到build文件夹:
private void CopyCode(string sourceDir, string destinationDir) {
foreach (string dirPath in Directory.GetDirectories(sourceDir, "*", SearchOption.AllDirectories)) {
if (!dirPath.Contains(".svn") && !dirPath.Contains(@"\bin") && !dirPath.Contains(@"\obj")) {
Directory.CreateDirectory(dirPath.Replace(sourceDir, destinationDir));
}
}
foreach (string newPath in Directory.GetFiles(sourceDir, "*.*", SearchOption.AllDirectories)) {
if (!newPath.Contains(".svn") && !newPath.Contains(@"\bin") && !newPath.Contains(@"\obj")) {
string dest = newPath.Replace(sourceDir, destinationDir);
File.Copy(newPath, …Run Code Online (Sandbox Code Playgroud) 我有以下型号:
activity_types: id, name
activities: id, id_activity_type, occurrences, date (other fields)
Run Code Online (Sandbox Code Playgroud)
活动表存储活动按天发生的次数.但是现在我想向用户显示每个类型的活动按月发生了多少.
我根据这篇文章得到了以下解决方案,似乎没问题:
Activity.all(:joins => :activity_types,
:select => "activity_types.id, activity_types.name, SUM(activities.occurrences) as occurrences",
:group => "activity_types.id, activity_types.name",
:order => "activity_types.id")
Run Code Online (Sandbox Code Playgroud)
但这似乎有很多关于rails标准和rails API的代码说它已经被弃用了.
我发现以下解决方案非常简单:
Activity.sum(:occurrences).group(:activity_type_id)
Run Code Online (Sandbox Code Playgroud)
返回带有activity_type_id => occurrence 的哈希值.
我该怎么做以获得以下哈希:activity_type.name =>出现?
假设一个类似于这个问题的场景.我想得到以下结果:
score range | number of occurrences
-------------------------------------
0-9 | 11
10-19 | 14
20-29 | 3
... | ...
Run Code Online (Sandbox Code Playgroud)
我可以使用选定的答案作为解决方案:
select t.range as [score range], count(*) as [number of occurences]
from (
select case
when score between 0 and 9 then ' 0- 9'
when score between 10 and 19 then '10-19'
else '20-99' end as range
from scores) t
group by t.range
Run Code Online (Sandbox Code Playgroud)
即使在该范围内没有结果,我怎样才能确保显示30-39的分数范围?
有没有一种简单的方法从Rtf字符串中提取文本而不使用RichTextBox?
例:
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\lang2070\ltrch foo}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\lang2070\ltrch bar }\li0\ri0\sa0\sb0\fi0\ql\par}
}
}
Run Code Online (Sandbox Code Playgroud)
应该返回:
foo
bar
Run Code Online (Sandbox Code Playgroud) 我在App.xaml中定义了以下样式
<Style x:Key="textBoxMultiline" TargetType="{x:Type TextBox}" >
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="MinHeight" Value="50" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
Run Code Online (Sandbox Code Playgroud)
在整个解决方案中,我们在每个需要简短文本的文本框中使用它.
<TextBox x:Name="textBoxDescription" Grid.Row="2" Grid.Column="1" Style="{DynamicResource textBoxMultiline}" />
Run Code Online (Sandbox Code Playgroud)
一切都很好,但随后客户抱怨一些字段在较低分辨率的旧显示器上被取下,所以我ScrollViewer在一个较高的可视树节点上放置一个以防止整理.
<ScrollViewer Height="Auto" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
...
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
奇怪的是,TextBox具有上述风格的es开始向右扩展而不是包裹文本.
有没有办法防止这种情况而不删除ScrollViewer?
我正在使用上下文混合器对具有固定颜色的html背景图像的前192个像素应用乘法效果,以实现对页面标题的透明效果.
在HTML上我有2个画布.一个用于图像的一部分应用乘法效果,一个用于颜色.
在javascript上,将颜色画布的颜色和两个画布的宽度设置为window.innerWidth后,我得到了背景图片:
imageObj.src = $('html').css('background-image').replace(/^url|[\(\)]/g, '');
Run Code Online (Sandbox Code Playgroud)
现在出现了问题.我想将图像裁剪后的图像绘制到图像画布上,以便我可以应用乘法效果.我正在尝试执行以下操作:
imageObj.onload = function(){
// getting the background-image height
var imageHeight = window.innerWidth * imageObj.height / imageObj.width;
// get the corresponding pixels of the source image that correspond to the first 192 pixels of the background-image
var croppedHeight = 192 * imageObj.height / imageHeight;
// draw the image to the canvas
imageCanvas.drawImage(imageObj, 0, 0, imageObj.width, croppedHeight, 0, 0, window.innerWidth, 192);
// apply the multiply effect
colorCanvas.blendOnto( imageCanvas, 'multiply');
}
Run Code Online (Sandbox Code Playgroud)
但是我做错了得到裁剪的高度.
例如:对于1536x1152图像和1293x679浏览器容器,我为源裁剪高度得到的值是230,但要获得正确的裁剪我需要使用296左右的东西. …
c# ×4
sql ×2
wpf ×2
.net ×1
build ×1
canvas ×1
html5 ×1
iis-7 ×1
javascript ×1
linq-to-sql ×1
msdeploy ×1
postgresql ×1
sql-server ×1
textbox ×1
word-wrap ×1