在以前版本的Visual Studio中,您可以折叠html块,但在VS2012中似乎缺少.有关如何再次启用该功能的任何想法?
您好,并提前感谢您的帮助,我知道这个问题或类似的问题已经发布,经常对MVC 3应用程序有特殊的关注.但是,每当我尝试使用.net 4.0目标框架从visual web developer express 2010中启动任何应用程序时,我都会收到此错误消息.
确切的错误消息是:
尝试使用安全透明方法'System.Runtime.Diagnostics.DiagnosticTrace..ctor(System.String,System.Guid)'来访问安全关键方法'System.Runtime.Diagnostics.EtwDiagnosticTrace..ctor(System.String,System.Guid) )'失败'.
大会"System.ServiceModel.Internals,版本= 4.0.0.0,文化=中性公钥= 31bf3856ad364e35"标有AllowPartiallyTrustedCallersAttribute程序,并使用2级安全透明度模式.2级透明度导致AllowPartiallyTrustedCallers程序集中的所有方法默认情况下变为透明安全性,这可能是此异常的原因.
堆栈跟踪:
[MethodAccessException: Attempt by security transparent method 'System.Runtime.Diagnostics.DiagnosticTrace..ctor(System.String, System.Guid)' to access security critical method 'System.Runtime.Diagnostics.EtwDiagnosticTrace..ctor(System.String, System.Guid)' failed.
Assembly 'System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.]
System.Runtime.Diagnostics.DiagnosticTrace..ctor(String traceSourceName, Guid etwProviderId) +24
System.ServiceModel.Activation.FxTrace.InitializeTracing() +90
System.ServiceModel.Activation.FxTrace.get_Trace() +84 …Run Code Online (Sandbox Code Playgroud) 我有一个小型的MVC网站,这是一个朋友美发沙龙.在这个页面上,我有一个div,用于显示从数据库记录中获取的数字.这个数字是当前排队等待理发的人数.
我目前的能力是登录"管理"页面并使用表格更新此号码,从"2"到"5",然后将"5"更改为"6",具体取决于有多少人坐在这个队列.
这是目前的手动操作.代码如下:
=============================
[HttpPost]
public ActionResult Update(Data data)
{
if (ModelState.IsValid)
{
data.ID = 1; //EF need to know which row to update in the database.
db.Entry(data).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index", "Home");
}
return View(data);
}
Run Code Online (Sandbox Code Playgroud)
====================================
{
public class Data
{
public int ID { get; set; }
public string Queue_Number { get; set; }
}
public class DataDBContext : DbContext
{
public DbSet<Data>Queue { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
我真正想要的是,一旦你从"管理"页面上的表单手动更新了队列号,我想自动倒计时20分钟(理发所需的大致时间),然后有队列号自动调整为1,直到达到"0".
例如我们队列中有5个人,20分钟后自动调整为4个人,网页会自动更新/刷新,然后又有2个人进入,所以我们手动将其调整为队列中的6个人并启动计时器再次,每20分钟通过队列调整-1直到它下降到"0".一旦它变为"0",它就会一直停留在那里,直到我们手动将更多人添加到队列中.
我恐怕我不知道如何开始这样的请求,或者即使有可能?
我非常感谢这里的专家提供的任何帮助,这些帮助可以为我"babystep".我没有提供的任何信息我会努力补充 - …
c# database asp.net-mvc-3 visual-web-developer-2010 countdowntimer
我一直在尝试将我的网站部署在运行Windows Server 2012/IIS8的新VPS上.Visual Studio可以连接并创建目录结构然后失败.查看服务器日志,我收到以下链接中描述的错误 - 滚动到底部.
5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
This particular error does not give you much to go on, but the picture becomes much clearer if you look at the Web Deploy error log in Event Viewer.
User: DEPLOYSERVER\User1
Client IP: 192.168.0.203
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: …Run Code Online (Sandbox Code Playgroud) 这个问题很相似,但我认为不一样
msbuild ASPNETCOMPILER ASPNETRUNTIME startIndex错误
我有一个Web应用程序,我试图使用Visual Web Developer 2010 Express发布.
如果我在本地或生产服务器上发布,它没有任何区别,UNCHECK Precompile during publishing一切都会正常工作,它将发布和工作,没有运行时错误.
但是,如果我检查上面的内容,那么我收到一个错误:
Error 1 startIndex cannot be larger than length of string. ASPNETCOMPILER 0 0 bms
Run Code Online (Sandbox Code Playgroud)
没有其他错误,也没有其他信息!
谁能帮助我甚至开始追踪这个?
asp.net msbuild publish aspnet-compiler visual-web-developer-2010
我已经搜索了所有内容,并且我已经阅读了大量不同的回复 - 有些我试图暗示没有成功.我不是一个专业的程序员,但我感谢这个论坛的人们教我很多东西,从jquery到doctypes,到你的名字!
我有一个在VWD 2010 Express中开发的网站.我只想知道两件事:
我知道搜索引擎/重复内容对你的域名和www.yourdomain都不好,所以我想设置301重定向,这样如果最终用户输入mydomain,它们会自动重定向到www.mydomain(带有www).
我已经移动了一些不在根目录中但在文件夹中的页面.所以我想用新的位置替换过时的页面.我想通过自动将它们从www.mydomain/services /engineering.aspx 重定向到www.mydomain/products /engineering.aspx来实现.
这难吗?是(推荐)使用.htaccess,web.config还是其他东西?
感谢您抽出宝贵时间阅读本文,我衷心感谢所有反馈.
杰森韦伯
asp.net redirect http-status-code-301 visual-web-developer-2010
我有一个.net c#mvc3 Web服务应用程序,由可视化Web开发人员2010开发.我从一个android movile应用程序调用Web服务.我想从eclipse模拟器测试Web服务.当我调试webservice应用程序时,通过从Web浏览器调用服务一切正常,但是当我使用模拟器从Android应用程序调用时,得到"HTTP/1.1 400 Bad Request".
奇怪的是,如果我在我的本地IIS 7上发布Web服务应用程序,一切都不错,虽然我无法调试该服务.
当我使用可视化Web开发人员对服务进行重新编写时,会出现一个网页,其中包含以下地址:
的 "http://本地主机:1627/myservice.asmx/myMethod的"
在我的Android应用程序上,我用这样的URL调用该服务:
"http://10.0.2.2:1627/myservice.asmx/myMethod"
但后来我得到"HTTP/1.1 400 Bad Request"
我真的很感激任何帮助.
谢谢.
你好,我是ASP.NET的新手
我有一个来自另一个程序的设计html页面,我想使用可视化Web开发人员将html转换为asp.net aspx web表单.
我已正常打开页面,但在布局页面中移动或替换控件很困难,例如当我移动按钮时,页面的设计会崩溃.如何在不改变页面布局的情况下将按钮或文本框插入Visual Web Developer 2010中的aspx/html?
我们有一个使用System.Transactions命名空间的C#ASP.NET Web应用程序.
using System.Transactions;
Run Code Online (Sandbox Code Playgroud)
这在本地开发时工作正常 - 我们只需要首先通过网站添加引用 - >添加引用...
问题是在部署到Web主机(通过FTP复制)后,主机不知道此引用.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Transactions' does not exist in the namespace 'System' (are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
在Visual Web Developer Express 2010中工作,我们没有内置的References文件夹.我看到了这个解决方案:https://stackoverflow.com/a/13035466/2178080建议(但不建议)将dll复制到应用程序文件夹.
我有点新的部署ASP,不知道如何包含System.Transactions库,以便主机可以找到引用.有没有人遇到过这个问题?
编辑:我们采用了将dll与应用程序一起复制到站点的路径.执行此操作的步骤:
由于此解决方案被列为不推荐,我仍然对其他解决方案持开放态度.
Edit2: Grant和Chris帮助我理解我正在使用Web站点而不是Web应用程序.Grant帮助解决了网站问题的具体细节.
我一直在阅读xhtml和其他语言都不喜欢大写字母.这可能看起来像一个基本问题,但让我们说你命名了一个页面,例如:
Contact.aspx
Run Code Online (Sandbox Code Playgroud)
代替:
contact.aspx
Run Code Online (Sandbox Code Playgroud)
有关系吗?如果它确实重要,我可以简单地重命名该文件,以及任何指向它的超链接吗?
谢谢!
杰森韦伯
我正在尝试使用foreach控件循环遍历字符串数组,然后使用每个值在数据库中插入信息.有人可以帮我理解为什么在using子句中我不能使用foreach变量?
string[] ship_ids = ShipsInScope.Split('|');
foreach (string ship_id in ship_ids)
{
using (SqlCommand InsertCommand = new SqlCommand("insert into PROJECT_SHIP (CR_Number, Ship_Id) VALUES (@CR_Number, @CCF_Number)", DBConn))
{
InsertCommand.Parameters.Add("@CR_Number", SqlDbType.NVarChar, 10).Value = CRNumber;
InsertCommand.Parameters.Add("@Ship_Id", SqlDbType.NVarChar, 10).Value = Ship_Id;
InsertCommand.ExecuteNonQuery();
InsertCommand.Dispose();
}
}
Run Code Online (Sandbox Code Playgroud) 任何有关这方面的帮助将不胜感激.每当我运行我的程序时,我得到一个NullReferenceException未被用户代码处理.
因此,当我启动程序时,我会看到一个表单,我应该从名单列表中进行选择,并能够更新详细信息或删除它们,但下拉列表中没有任何内容.
我得到空引用:
comm.Parameters["@EmployeeID"].Value =
employeesList.SelectedItem.Value;
Run Code Online (Sandbox Code Playgroud)
这是CS文件中的选择按钮:
protected void selectButton_Click(object sender, EventArgs e)
{
// Declare objects
SqlConnection conn;
SqlCommand comm;
SqlDataReader reader;
// Read the connection string from Web.config
string connectionString =
ConfigurationManager.ConnectionStrings[
"HelpDesk"].ConnectionString;
// Initialize connection
conn = new SqlConnection(connectionString);
// Create command
comm = new SqlCommand(
"SELECT FirstName, LastName, Username, Address, City, County, Post Code, " +
"HomePhone, Extension, MobilePhone FROM Employees " +
"WHERE EmployeeID = @EmployeeID", conn);
// Add command parameters
comm.Parameters.Add("@EmployeeID", System.Data.SqlDbType.Int);
comm.Parameters["@EmployeeID"].Value = …Run Code Online (Sandbox Code Playgroud) c# sql asp.net nullreferenceexception visual-web-developer-2010
我使用的是Visual Web Developer Express 2010版.我选择了"新网站"(而不是新项目)来建立一个网站.我的项目针对.NET 2.0
我有一个我最初在该App_Code文件夹下创建的类文件.我在我的实例中实例化了一个类的对象default.aspx.cs
MyClass m = new MyClass();
Run Code Online (Sandbox Code Playgroud)
编译好了.但是,当我在远程IIS服务器上部署它时,当我从浏览器调用远程网站时,它会出现编译错误.
错误CS0246:找不到类型或命名空间名称"MyClass"(您是否缺少using指令或程序集引用?)
所以我在这里找到了这个问题 - 找不到类型或命名空间名称'LAD'(你是否缺少using指令或程序集引用?)
它说我不应该把类文件放到App_Code目录中.它要求将它放在差异处并将Build Action(在Properties中)设置为Compile.我在"MS Visual Web Developer 2010"中找不到属性中的构建操作 - 所以我不得不跳过这一步.
所以我只是从App_Code中删除它并在根文件夹中重新创建它.现在我的项目根本没有构建 - 我在构建阶段本身得到了同样的错误.
错误3找不到类型或命名空间名称"MyClass"(您是否缺少using指令或程序集引用?)
我有一种强烈的感觉,我的MyClass.cs根本没有构建.我该怎么办?我如何告诉IDE构建它?
.net c# asp.net visual-studio-2010 visual-web-developer-2010