.NET Web API 2 Project downloading browserLink.js - asp.net

I've got a .NET Web API project and on load I'm getting a download of this script called browserLink.
http://localhost:49818/ea93983f23c54f35a63de09646c09159/browserLink
Its associated with .NET Signalr but I'm not using that so I'm not sure why its being included. Any ideas how to turn it off?

Disable Browser Link in Visual Studio 2013.
Do this by editing your web.config file to add the following line to your appSettings section:
<appSettings>
<add key="vs:EnableBrowserLink" value="false"/>
</appSettings>
Note that Browser Link is only used when working in Visual Studio AND the web application is compiled in debug mode, i.e.:
<system.web>
<compilation debug="true" />
</system.web>
In other words, end-users of your site will never make this request.

Related

Deploying IIS, ASP.net with oracle database

Good day!
After watching a video I was able to summarize the steps I needed as such:
Steps in configuring and deploying to IIS ASP.NET
1. Create directory
example:
C:/inetpub/wwwroot/mvcauction
Open internet information services Manager
Right-click default website
Add application.
Choose website name.
example mvcauction
Paste the directory you created in step 1.
Click select button.
Make sure that the property has .net framework version 4.0
Click ok.
Go to your visual studio IDE.
Righ-click on the project file in the solution explorer.
CLick publish
Click publish profile drop down and select new. Add a profile name.
Example:
Local IIS Website
Choose publish method File System
Use step one's directory for the Target location
configuarion: Release
Choose local IIS Website.
Expect an error.
Open visual studio command prompt.
Execute this command: sqllocaldb share v11.0 IIS_DB
Update your web config. Refer to the paint screenshot.
Publish again in iis manager.
if not yet ok:
Go to visual studio again.
Open data base explorer.
Right-Click to data connections to add connection.
For the server name: Enter the value that we are using in the config file data source.
Example
(LocalDB).\IIS_DB
Click ok
Righ-Click on the new connection added.'
Choose new query.
Execute the shown commands.
Go to the browser and refresh.
However I cannot finish step 21 which I conclude is because the tutorial did not use oracle database as its data source. I cannot publish my visual studio project successfully. So, please, does anyone here know what to put in the web config file?
This is my web config file:
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="OracleConnectionString" connectionString="Data Source=localhost;USER ID=userid;PASSWORD=password"
providerName="Oracle.DataAccess.Client" />
<add name="ConnectionString" connectionString="Provider=MSDAORA;Data Source=localhost;Password=password;User ID=userid"
providerName="System.Data.OleDb" />
</connectionStrings>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
</configuration>

Configuration Error related to targetFramework in web.config

I have made an MVC website in Visual Studio 2015 and it works in my localhost. But when I published my website and put into my host, it doesn't work. It gives me this error notice:
Server Error in '/' Application.
Configuration Error
Parser Error Message: The 'targetFramework' attribute in the
element of the Web.config file is used only to target
version 4.0 and later of the .NET Framework (for example,
''). The 'targetFramework'
attribute currently references a version that is later than the
installed version of the .NET Framework. Specify a valid target
version of the .NET Framework, or install the required version of the
.NET Framework.
Source Error:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.
Source File: G:\xxx\xxx.com\httpdocs\web.config Line: 24
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.34248
Related parts in my web.config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
And this part with error:
<system.web>
<authentication mode="None" />
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.6" />
<httpRuntime targetFramework="4.6" />
</system.web>
Properties of my website:
And NuGet Package Manager:
EntityFramework Reference Properties:
Default Web Site Basic Settings: (To be honest, I am not sure whether I should add a new website(my website) in here.)
My installed .net frameworks:
My publish method:
I have investigated this problem on the Internet and I have found several links related to my problem: Asp.net MCV4 framework issue. In this link, there are two main offers:
changing this compilation tag
updating application pool in IIS
Actually, I have tried to change this tag but it doesn't change. Then I have controlled my application pool but it seems up-to-date.
I have called my host provider and I have explained my problem. They say that this error is not related to their servers.
What should I do? What is the solution for this?
Your website project is targeting v4.6 of the .NET Framework but your hosting provider has not yet installed this version. Your options:
Ask provider to install it - they are unlikely to do this.
Find another provider that does support it.
Change your project to target v4.5.
I'm adding one more information to complement DavidG's answer. If Internet Information Server (IIS) is your provider then Web Platform Installer (an IIS extension) is a very helpful tool. It can your best bet to check the current state of what all components are installed on your machine (Refer screenshot)
It is very easy to check what all components are missing from your computer. Based on that, you can kick-start installation of any missing component through the UI of this IIS extension itself.
I just had a similar problem following the installation ( windows update) of the KB 3205402.
Big difference with my case: the application worked well before the update !
==> I found in "IIS Manager", in "ISAPI and CGI Restrictions", that the framework ASP.NET v4.0.30319 has been switched to "unauthorized" !
Switching it to "Authorized" resolved my problem
I changed:
<system.web>
<compilation debug="true" targetFramework="4.7" />
<httpRuntime targetFramework="4.7" />
<customErrors mode="Off"/>
</system.web>
to
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<customErrors mode="Off"/>
</system.web>
i.e, changed targetFramework value to 4.5 (the one supported on server) from 4.7. and worked.
had the same issue on the below line on an offline server ,
<compilation targetFramework="4.5.2">
tried adding all the roles and features related to .Net framework from the server manager and to its pool ,
but didn't work , what worked for me is just downloading Microsoft .NET Framework 4.5.2(Offline Installer)
I went round and round with this today with no resolution. Exasperated, I finally just deleted my working copy from my drive, and rechecked it out from SVN.
Fixed.
Not a particularly clever answer, but it fixed it for me, no idea what the actual problem was.
I tried replacing the targetFramework 4.5.2 to targetFramework 4.0 directly in config file. Then it and all the functions work correctly.
Before:
<compilation targetFramework="4.5.2">
After:
<compilation targetFramework="4.0">

Is there a "release" configuration for ASP.NET Web Sites?

I use Visual Studio for Website development (VS 2010 Ultimate and VS 2012 Professional). To be more specific, I created this website by File > New Web Site, so I do not believe this is a project.
While developing the website, I have debug="true" enabled in the web.config file. When I publish, I manually change to debug="false".
<configuration>
<system.web>
<compilation debug="true" strict="true" explicit="true" targetFramework="4.5">
</system.web>
</configuration>
There are two config files in the solution: "web.config" and "web.Debug.config".
This is what the various forum articles and "Programming ASP.NET" books say to do, but I wonder if there is a way to have debug="true" for local development and automatically switch to debug="false" when using Build > Publish Web Site so I don't have to manually change the web.config file?
According to this forum answer, "There is no way to have a Release configuration for your website."
Keeping in mind that this is a Web Site and not a project, it looks like adding another config based on comment suggestions might not be possible. A possibly valid answer is "no, it is not possible in this context."
Is there another way to achieve the intended outcome without using the current workaround of manually changing the debug setting?
Sorry, it's related to it being a "web site" type project, which aren't compiled:
Configuration of publishing an ASP.NET web site
To quote the previous responder above:
"Web Site projects don't have the Release configuration available, but it makes no difference since they are not compiled. Web Application projects, on the other hand, do get compiled and have both configurations available."
According to the available references, for "ASP.NET Website" it is not possible to have a separate release configuration.
So the answer to the posed question is no: it is not currently possible. Manually changing the debug attribute when you publish and then changing it back is the only option in that case.
How can you proceed? If you really need to have a release configuration and a debug configuration, the a possible option is Converting a Web Site Project to a Web Application Project. While not a direct answer to the presented question, it is an alternative.
For some projects I've set up an Environment appSetting and scoped all other keys off of that Environment.
For instance:
<add key="Environment" value="Development"/>
<add key="Development.Title" value="My Dev App"/>
<add key="Production.Title" value="My Production App"/>
<connectionStrings>
<add name="DbContext.Development" connectionString="Initial Catalog=DatabaseDev;...."
providerName="System.Data.SqlClient" />
<add name="DbContext.Production" connectionString="Initial Catalog=DatabaseProd;...."
providerName="System.Data.SqlClient" />
</connectionStrings>
Then you would create a Configuration class that would pull appSettings and connectionStrings by looking for:
appSetting
string.Format("{0}.Title", ConfigurationManager.AppSettings["Environment"])
connectionString
string.Format("DbContext.{0}", ConfigurationManager.AppSettings["Environment"])
Not perfect but this will let you only have to replace one web.config value instead of a bunch without the help of the Publish config transform.

Is it possible to host an aspx (.NET 4.0) website locally on Windows 8 Enterprise?

As the title states is it possibly to host a dynamic (that would be .aspx correct?) website locally (IIS 8) on a computer running Windows 8 Enterprise? I've installed all the IIS components, added the website as many guides on Google will show but I get error 9 as stated here:http://support.microsoft.com/kb/942055
my web.config is as follows:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
I also have the correct version set for the site (.NET 4.0) and tried resetting all feature delegations. At this point I'm thinking of just doing a cheese puff solution and just running the site via the built in server within Visual Web Developer.
"Stock" ASP.NET Web.Config file
When I create a standard, empty ASP.Net Web Forms Application targeting .NET Framework 4.0, here's the standard Web.config file that's generated:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections />
<connectionStrings />
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
</authentication>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
EDIT: I removed the Membership, Role, Profile, and SessionState sections that were previously here. These aren't, strictly, required but are part of the standard Empty ASP.Net Web Forms Application template to help you get started quickly. What is shown above is the minimum Web.config you need.
NOTE: Don't worry about the debug="true" in the <Compilation /> element. You should have that attribute set to false in production anyway.
I Suspect it's your IIS Configuration
After re-reading your question, I suspect that you haven't properly configured IIS to host the site properly.
First, I want to start by saying that there's Internet Information Services (IIS), the actual web server, that can be installed on Windows 8 as well as server OSes such as Windows Server 2012. There is also IIS Express, used for development and which is a replacement for the old Development Web Server (code-named Cassini) in VS2008 and VS2010 (prior to SP1 when IIS Express was made available through an additional installation).
It sounds to me like you have installed IIS under Windows 8 Program and Features. Now you need to create a site in IIS that points to where your web application is located on your hard disk.
Open IIS Manager
Expand your machine name in the Connections pane on the left.
Expand the Sites folder. There should already be a site called Default Web Site.
Right-click the Sites folder and choose Add Website....
Give the site a name. Choose the DefaultAppPool for now (you can change it later).
Under Physical path, browse to where your web site/application is located on your hard disk.
Click OK.
There are other options on that page and you can find help on them at MSDN. That may be enough to get you started, though.

No more Intellisense for ASP tags visual studio 2010

I'm not getting intellisense for asp tags anymore in websites or web applications.
There is a check mark for the following:
Tools->Options->Text
Editor->C#->General->Auto list
members
Tools->Options->Text
Editor->C#->General->Parameter
information
Tools->Options->Text
Editor->C#->Intellisense->Show
completion list after a character is
typed
My dev environment is server 2008 R2 64 bit, VS 2010 Ultimate (ver 10.1.30319.1 RTMRel), I don't have resharper installed, but I do have AnkhSVN installed.
How do I get intellisense back?
UPDATE: Here is my webconfig:
<configuration>
<connectionStrings>
<add name="MerchandiseEntitiesContainer" connectionString="metadata=res://*/Merchandise.Entities.csdl|res://*/Merchandise.Entities.ssdl|res://*/Merchandise.Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\sqlexpress;Initial Catalog=OldOslernet;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime executionTimeout="1800"
maxRequestLength="1048576"
useFullyQualifiedRedirectUrl="false" />
</system.web>
<appSettings>
<add key="upLoadPath" value="images/products/"/>
</appSettings>
</configuration>
Also, here is a pic of the editor:
http://img688.imageshack.us/img688/958/extension.png
Delete Schema Files
Delete all files in the following folder: C:\Users[UserName]\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas. It is safe to delete anything in this folder as Visual Studio will regenerate them as needed.
Unblock Referenced Assemblies
There could be a problem with one of the referenced assemblies in your project being blocked on your machine. Right-click on each DLL in Windows Explorer, select Properties, and click the "Unblock" button (if the DLL is being blocked.)
Reset Visual Studio Settings
If all else fails, you can try to reset your settings in Visual Studio 2010 (MSDN Link.) You'll have to tweak your settings all over again but it is worth trying.
This is what worked for me for aspx/ascx files:
Right click on the file in Solution Explorer
Select Open With
Select Web Form Editor (Default)
Click Set as Default
Check file extension - editor bindings in preferences.
Check the system.web\pages\controls config section in your web configuration file.
Check the system.web\compilation\assemblies section too.

Resources