Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all 3509 articles
Browse latest View live

Stylecop in VISUAL STUDIO 2013

$
0
0

Hi Guys,

I have Website application using VS.NET 2013, would like to integrate stylecop, I google some website they menttion to add below import to csproj file but it doesn't exist in my website application folder, so where should add it.

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- Your StyleCop <Import> will go here --><Import Project="$(ProgramFiles)\MSBuild\StyleCop\v4.7\StyleCop.targets" />

Thanks,
Shabbir


VS.PHP and PHP TOOLS for Visual Studio, which is the best ?

$
0
0

Hi,
I love Visual Studio. I use it since 2006 for c#, asp, WinForm project, etc. I have a question about PHP / Simple Web dev :

Which is the extention between VS.PHP and PHP TOOLS ?
What i need :

- Intellisence (auto completion all PHP core class and functions and major extention, project lib class and functions)
- Powerfull debug, with break points etc...
- CONTROL + K + D indentation for all documents
- Live edit over FTP
- Publish over FTP the file projet
- MySQL Integration (design tools, etc ?)
[- Integration of some platform like Drupal or Wordpress (intellisence and debug)
- Integartion with other HTML/Javascript framework (jquery, angular etc.) ]

Thanks for your opinion.

Visual Studio 2012 professional ihangs trying to load symbol

$
0
0

i am working on asp.net mvc5 web application inside visual studio. now VS was a bit slow , so i run the following commands:-

devenv /resetuserdata

now the Visual studio will hangs for a while trying to load the following dll :-

enter image description here

after that it will show "this item does not support previewing" and VS will hangs ..

can anyone advice on this please? although the dll file it is trying to load already exists ...

Questions about Nuget

$
0
0

Hi,

when you want to use Nuget, do you always have to use it from within Visual studio, or can it be run outside Visual Studio?

Help with setting up database mail

$
0
0

I'm using Visual Web Developer 2010 Express with SQL Server 2008 Express, VB.

Can anyone provide me with a clear step-by-step set of instructions for setting up and using database mail?  Under the Management box I have Policy Management, SQL Server Logs and Legacy but nothing about mail.  I've searched the web and can find only confusing (and sometimes contradictory) advice.

Help, I'm getting older and greyer and nowhere :)

Thanks!

asp.net 3.0 vs lastest version

$
0
0

i just download visual studio 2013 version, but i previous develop with asp.net 3.0 version, can i create a new project with asp.net 3.0 from visual studio 2013?

i just create a web application project, but it seems all the project structure is different from previous version.

help~ 

ASPX Website Template

$
0
0

Is there a website you can get for FREE or pay for a .Net template?  Not HTML/CSS or Wordpress...

Making visual studio inherit top web.config on compilation

$
0
0

Hi,

I have a many solutions such as forums, blogs, albums etc... for various systems of my website.

I have one web.config in the parent folder that defines all of the assemblies that asp.net requires, such as System.Web and System.Core etc..

My solutions don't compile because their web.config is empty and i wish to keep it like that.

How do i make visual studio "see" the top web.config on compilation?

At runtime it works fine since IIS home directory is set to the parent folder and each of my solutions are defined as virual directories. So IIS sees the top web.config always.

Thanks


System.Web.Mvc missing a reference error

$
0
0

Hi,

I just installed VS 2012 on my computer and trying to open an MVC 3 project that I've been developing in VS 2010. When I try to build the solution, I'm getting:

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 

This error is referencing a second project that is linked to my MVC project where I handle data access. In that project, I do haveusing System.Web.Mvc; in quite a few places. Any idea what's causing this and how I can fix it?

P.S. When I opened the project in VS 2012, it did a migration. I got lots of errors messages but in close examination, they are related to some SVN files (I use SVN to handle version control). My actual files in my project were all OK.

The only two messages that seemed relevant are:

MyProject.csproj: Visual Studio needs to make non-functional changes to this project in order to enable the project to open in this version and Visual Studio 2010 SP1 without impacting project behavior.
WarningMyProject.csproj: Visual Studio has made non-functional changes to this project in order to enable the project to open in this version and Visual Studio 2010 SP1 without impacting project behavior.

VS2010 very slow with large script block

$
0
0

Hi All: I used "swiffy" to convert an SWF to HTML5, which generates a large client script block to embed on a webpage. This one in particular is very large...about 350Kb (too large, I know), and once it's embedded in the <head> VS2010 slows to an unusable crawl. I presume it's Intellisense trying to parse all the code that's causing it to slow down...is there any way to disable it for this page so I can speed things up?

I'm in a VB web project...I've seen some links to disabling Intellisense in C#, but I don't see any intellisense options for "Basic" or "Jscript". I've also seen recommendations to delete fceap.dll, but I only want to temporarily disable it for this specific page (or temporarily for the project as a whole).

mvc datagrid showing additional column

$
0
0

In the datagrid one additonal column is showing after the column name(employeename) .

<style type="text/css">
.webgrid-table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1.2em;
width: 100%;
display: table;
border-collapse: separate;
border: solid 1px #98BF21;
background-color: white;
}

.webgrid-table td, th {
border: 1px solid #98BF21;
padding: 3px 7px 2px;
}

.webgrid-header {
background-color: #A7C942;
color: #FFFFFF;
padding-bottom: 4px;
padding-top: 5px;
text-align: left;
}

.webgrid-footer {
}

.webgrid-row-style {
padding: 3px 7px 2px;
}

.webgrid-alternating-row {
background-color: #EAF2D3;
padding: 3px 7px 2px;
}
</style>

<h2>Index</h2>

<p>
@Html.ActionLink("Create New", "Create")
</p>

@{WebGrid grid = new WebGrid(Model, rowsPerPage: 2);}
@grid.GetHtml(
tableStyle: "webgrid-table",
headerStyle: "webgrid-header",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
selectedRowStyle: "webgrid-selected-row",
rowStyle: "webgrid-row-style",

caption:"EMPLOYEES",columns: new[] {
grid.Column ("employeeid",header:"Emp.id"),
grid.Column ("divisionid",header:"Div.id"),
grid.Column ("departmentid",header:"Dep.id"),
grid.Column ("gender","Gender"),
grid.Column ("employeename",header:"Name"),
grid.Column ("","",format:@<td class="ActionsTH" >
@Html.ActionLink("Edit", "Edit", new { id = item.employeeid }) |
@Html.ActionLink("Details", "Details", new { id = item.employeeid }) |
@Html.ActionLink("Delete", "Delete", new { id = item.employeeid })
</td>)},
mode:WebGridPagerModes.All,
numericLinksCount: 5)

Visual Studio 2010 or Visual Studio 2013

$
0
0

Hi every body,

Welcome again, i am ASP.net net developer, but i stopped for Period of time,  i was working with Visual Studio 2005 

I want to back again and i have good books and DVDs for Visual Studio 2010, so i am confused learn Visual Studio 2010  or Visual Studio 2013

what is the best ??

Nsubstitute MS Tests

$
0
0

Hi everyone,
I am learning unittesting and I am using Nsubstitute as a choice of mocking framework.
so I have this small imaginary app I am writing for a guest inn. I am trying to write
a test to ensure that once a reservation is made on a friday, room prices should be
discounted by 20%. But I don't understand how this Nsubstitute works (mind you still
learning) so I thought using the when() do() should help me test the scenario I aim.
can someone help me understand the when() do() methods of the Nsubstitute framework?
How do I complete this test? Hope y'all can help!!

public void DiscountRoomPricesAtWeekends(){
        //Arrange
        //prices at weekends should be discounted by 20%
        //get price of a particular room and discount price
        var roomprice = new Rooms() { Price = 100M };
        //if day to check in is a friday or saturday its 20% off
        var reserve = Substitute.For<Reservation>();
        //Make sure that the date of reservation is always friday.            
        //reserve.ReservationDate.DayOfWeek.Returns(DayOfWeek.Friday);
        //(double) roomprice.Price * 0.20) 
        var percentage = (double) roomprice.Price * 0.20;
        reserve.When(r => r.ReservationDate.DayOfWeek.Returns(DayOfWeek.Friday))
               .Do(p => );
        //Act 
        //Assert
        //Assert.AreEqual(percentage, 20);
        Assert.AreEqual();}

Publishing timestamps

$
0
0

I'm using Visual Studio 2010 Professional with an ASP.NET project.

Is there anywhere I can get a list of the times I've published the project?

Need small help in Vb.net 2012 webbrowser

$
0
0
<div class="body">

Hello , i need some help in a small problem i've searched and try to figure out a way to detect if a button is available in a webbrowser page

 the but i want to detect has a javascript onclick function :

<a href="#" onclick="javascript:self.close();" class="button red"><span>Next</span></a>

this button in first part of webbrowser page is hidden and after certain interval of time  it appear on page.

I've tried with allelements and innertext but the problem is that i can use it function even the button is hidden all i want is to use it only when is available and visible on screen,or a way to catch javascript time interval and make it equal with a progressbar.

Thank you !!! hope you will understand.

</div>

Review Project and Solution Changes

$
0
0

Hi,

I got this error and i dont know what to do.. thank you.

error

WCF Service Application Vs WCF Service Library

$
0
0

Hi,

As a newbie to WCF, I am trying to learn the concepts.If it is a very basic question, pardon me. What is the difference between WCF Service Library and WCF Service Application. When do we use one over the other?

 

 

Auto insert predefined comment in vs 2013

$
0
0

I want to Auto insert predefined comment in vs 2013.

So I'd hit some shortcut (say for instance Alt + Q or whatever) and it'd automatically insert predefined text in the visual studio editor. For instance, this could be my pre-defined text to insert comment in my C# code: /* John Smith | Task#44 */

I know many years ago (in the era of VS 2003), I used to do this using Macro.

Is there any way I can achieve this on VS 2013? Thanks.

Opening Visual studio solution file on a new pc?

$
0
0

Hi,

im attempting to open a visual studio solution file on a new pc. The solution file was built in web express 2013 and i am using the same version on the new pc.

However when i try and open the solution im getting the following error; 

"Error opening web http://localhost:61437. Unable to open the Web site 'http://localhost:61437'. The Web server 'http://localhost:61437' could not be found."

How do i edit this so that i can open the solution?

Thanks 

Login/Logout fail randomly

$
0
0

I am building a ASP.NET 4.5 application (not MVC another big story) using the .Net authentication an up to date Visual Studio 13. Yesterday I did some package manager updates that included some microsoft authentication updates. Everything was fine for a while. Later in the day I suddenly could not log out, no errors. Searched the web for solutions and found nothing. This morning it was working fine and then late this afternoon log off stopped working again. In Chrome, which auto logs in the last user, log out will not work. In IE, which does not auto log in, login/logout worked (after Chrome stopped working) for a while but suddenly login stopped working. I have tried closing IE, reboot my computer - no luck. Being a programmer this kind of work/doesn't behaviour is disturbing.

My Logout code is in a logout page

protected void Page_Load(object sender, EventArgs e) { 
  Context.GetOwinContext().Authentication.SignOut();
  Session.Abandon();

//Context.GetOwinContext().Authentication.SignOut();
//FormsAuthentication.SignOut();
//HttpContext.Current.GetOwinContext().Authentication.SignOut();
//Session.Abandon();
//Roles.DeleteCookie();

//FormsAuthentication.SignOut();
//Session.Clear();
//Session.RemoveAll();
//Session.Abandon();

  Response.Redirect("~/Default.aspx", true);
}

I left in the comments to show all the different things I tried. The uncommented one works fine when logout is working, like in IE when I could login.

I will get this error in Chrome when it fails, and I get it 4 times time it happens. I have my doubts it is related.

System.Web.HttpException (0x80004005): Server cannot append header after HTTP headers have been sent.
at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)
at System.Web.HttpHeaderCollection.Set(String name, String value)
at Microsoft.Owin.Host.SystemWeb.CallHeaders.AspNetResponseHeaders.Set(String key, String[] values)
at Microsoft.Owin.Host.SystemWeb.CallHeaders.AspNetResponseHeaders.set_Item(String key, String[] value)
at Microsoft.Owin.Infrastructure.OwinHelpers.SetHeaderUnmodified(IDictionary`2 headers, String key, String[] values)
at Microsoft.Owin.Infrastructure.OwinHelpers.AppendHeaderUnmodified(IDictionary`2 headers, String key, String[] values)
at Microsoft.Owin.HeaderDictionary.AppendValues(String key, String[] values)
at Microsoft.Owin.Infrastructure.ChunkingCookieManager.AppendResponseCookie(IOwinContext context, String key, String value, CookieOptions options)
at Microsoft.Owin.Security.Cookies.CookieAuthenticationHandler.<ApplyResponseGrantAsync>d__f.MoveNext()

I do not have a redirect in a try/catch statement anywhere in my code. I fix for most with this problem.

This is my startup which is just the default one pretty much.

public partial class Startup {


// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301883
public void ConfigureAuth(IAppBuilder app)
{
// Configure the db context, user manager and signin manager to use a single instance per request
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
//ExpireTimeSpan = new System.TimeSpan(14, 0, 0, 0),
SlidingExpiration = false,
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)),
OnException = context => { 
Debug.Log(this, "CookieAuthenticationProvider exception: \n" + context.Exception.ToString());
}
}
});

// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

// Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process.
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);

}



SlidingExpiration was True and I tried False to see it would help because of a comment somewhere, it didn't help. This is all quite mysterious with no exceptions on the login/logout failures. I wonder that it might be cookie related.

At this point I wonder if I can trust Owin if it can pull this kind of mysterious failure out the blue - I was working on completely unrelated forms in when it failed - it works/it doesn't. Authentication must work for me to develop let alone release the product. Any suggestions for an alternate authentication system are welcome.

George

Viewing all 3509 articles
Browse latest View live




Latest Images