Jquery.min.map File 404 in MVC4 Application - c#

I have IIS 6.2 running a C# MVC4 application and I keep getting a jquery.min.map 404 error in Google Chrome. I do not get the same error in IE9. I have the uncompressed jquery file along with the minified one and the map all in my scripts directory controlled by a NuGet package. Is there something specific with Chrome that could be causing this or is there something else I can look into? It looks like all my references are correct (I'm including it in the Bundler, etc.)
Thanks!

I had the same problem today. The .map file wasn't being published. The solution was to right click on the .map file in Visual Studio and select properties. Note that the Build Action is None. Change None to Content and the .map file will be included when you publish.

You need to run Re-minify AA CSS/JS/HTML Files in Web Essentials.
Download here.

Related

Why is my deployed application still reading the cshtml view instead of the precompiled view

I am precompiling my razor views in my VS publish profile by setting the following properties:
Precompile options: deselect "Allow precompile site to be updatable", deselect "Emit debug information"
Merge options: select "Merge all outputs to a single assembly", give name "AppCode", check "Treat as library component (remove the AppCode.compiled file).
In order to test whether my application was actually reading from the compiled views, I renamed one of my cshtml files, and tested locally. All good, the view still loaded fine indicating that the compiled view was being called.
However, when I deployed all the binaries to the server and did the same test by renaming a cshtml file, the browser responsed with server 500 error.
What am I missing please?
So the issue turned out to be the missing PrecompiledApp.config file that was not uploaded to the server. After uploading the file, all good.

Convert Website to Web application With Visual Studio 2015

I have a Website Solution and I want Convert it to Web Application.
When I Transfer Base files (like DAL,BLL(.cs files my mean)) and Build My Solution it's working.
But When I Add other files that use the Base Files I have Many Errors Like (CS0246,CS0103,CS0118,CS1061).
I see this answer like:
https://msdn.microsoft.com/en-us/library/w7xf6dxs.aspx
and
Why am I getting error CS0246: The type or namespace name could not be found?
I want to Know if I build My Solution and Visual Studio Create .dll files why I have error that say not found X.dll? and how can it be fix?
You will have to go through and fix each error in turn as you migrate.
https://msdn.microsoft.com/en-us/library/aa983476(v=vs.100).aspx
I usually create an empty Web Application project and then copy the output into the same folder as my Web Site. Then I open the web application project in tye same solution as my website. Now you have two Projects for the same location.
Now enable the "show hidden files" option and "include" all the files in your project. At this point you will get loads of errors... Make sure that you first right-click on the root of your Web Application and select "Upgrade to Web Application" as this will do much of the grunt work for you.
In Web Applications you get Partial classes and when generated they are clashing with each other. In a Web Site you can have duplicate namespaces and class names, in a web application you can't. You need to go through all of your *.aspx and it's associated files and rename all of the class snakes to be unique.
This will start removing the errors although it may take some time to get through them all.

Copying DLL into additional directory on build ASP.NET

I have a web project created in Visual Studio 2012 that consists of a project as well as a web application. Both share the same solution. I'm basically just trying to get the DLL that's created in the project to be passed to the bin folder of the web application automatically with each build. I know it can be done because it's like that on other web projects I have, but I don't know why it works on some and not on others. I've been searching the internet hours, but have had zero luck. It seems like a very simple setting change so maybe someone on here knows.
I finally found the simple, one line answer I was looking for. I'll post the answer here to help others...
Go to Properties (for project in question), click on Build Events, enter the following into the Post-Build Event Command Line:
Copy /Y "$(ProjectDir)bin\debug*." "$(SolutionDir)bin*."
In this case, ProjectDir is the root directory of the project and SolutionDir is the root directory of the web application.

Building Projects Failure

I'm having this problem last Friday when I'm trying to build my project to deploy it.
Whenever I build my project (Ctr+Shift+B or F6) I always encounter this kind of error.
When I'm trying to locate the file from my PC it looks like it reside in temporary folder and when building my project, this files automatically created.
Anyone encountered this kind of problem?
You have an unclosed #region statement (or perhaps some other syntax error) in the .aspx or .cshtml file that is generating that code.
check if everything matches...
then use project properties to set properties of output exe.
Then use build solution to build the project.
You Will fine output exe in debug>bin folder

Parser Error : Could not create type

I have created webservice and published it on local machine. Then I have uploaded it on server.
Now while I tried to access webservice it gives following error :
Parser Error Message: Could not create type 'webservice.myservice'
Source Error:
Line 1: <%# WebService Language="C#" CodeBehind="myservice.asmx.cs" Class="webservice.myservice" %>
I tried This link but unable to solve my problem.
What should I do?
I don't know if this is dragging something up from the dim and distant past, but I had this problem. I fixed it. So I thought I'd to share it.
When you create a web service in Visual Studio (I'm using 2010 but I'd imagine it's the same for others), it creates a file called Service1.asmx
You will be tempted to rename it to MyService.asmx (or whatever).
Then you'll look inside and see the line
public class Service1: System.Web.Services.WebService
which you'll change to
public class MyService: System.Web.Services.WebService
and then when you try running it, you get the error
Could not create type 'MyProject.MyService'
Because it still thinks the class is called Service1.
If you right click the .asmx file and select view markup, you'll see it still says:
<%# WebService Language="C#" CodeBehind="MyService.asmx.cs" Class="MyProject.Service1" %>
change it to
<%# WebService Language="C#" CodeBehind="MyService.asmx.cs" Class="MyProject.MyService" %>
save it, try it.
It worked for me.
I had the same problem and looked for it for a long time!
I tried a lot of things including the following:
Frameword version incorrect
A whole list of things that could be wrong
None of those worked for me. After some searching, testing and cursing, I finally found the problem: The application (webservice) was incorrectly hosted.
Let me explain with a little background:
I had a project containing two solutions: One solution was the website that I made (html, javascript, etc), the other solution contained a folder with the business logic, the database model and the webservices. Obviously the webservices folder contained my .asmx files and code-behind for them.
Project
Data Core
Database Model
Business Logic
Webservices
myWebservice.asmx
Website
I was hosting these in the following way:
My website was hosted as a new site with the website folder as root folder
My webservices I was hosting as an application in my website, with the webservices folder as root
More visually:
IIS 7
My Website => Pointing at the "Website" folder
Webservices Application => Pointing at the "Webservices" folder in the Data Core
This resulted in the following url "http://website/webservices/myWebservice.asmx", which gave me the "Could not create type" error.
Now, after playing around a bit I tried hosting my webservice application starting with the data core as root, instead of the webservice folder.
Visually:
IIS 7
My Website => Pointing at the "Website" folder
Webservices Application => Pointing at the "Data Core" folder.
Obviously using the same url as before would give me a "File not found" error. However, using the following url "http://website/webservices/webservices/myWebservice.asmx",I finally got my working webservices page!
A small url breakdown:
http ://website/ => My website from the "Website" folder
webservices/ => Equivalent to the "Data Core" folder
webservices/ => The "webservices" folder in the "Data Core" folder
myWebservice.asmx => The webservice file in the "webservices" folder, in the "Data Core" folder
I assume that because I was hosting my webservices directly from the "webservices" folder in the Data Core, that the server could not find the compiled DLL of the webservices (which resides in the "bin" folder), since I was hosting at a deeper level.
After changing the configuration and hosting the webservices from the "Data Core" folder, the IIS server could "see" the bin folder and host the webservices succesfully. When using the correct url that is ^_^
I hope this is clear and helps you with you problems!
Another thing that can cause the problem. Is not creating an application for the project through the IIS itself. If the code is already on the server navigate to it in IIS from the left Connections pane. If the web site directory is still a yellow folder icon (and not a globe icon) you need to right-click on it and choose Convert to Application otherwise follow these steps...
Start -> Search For IIS
Open It!!
Right Click on the Default Web Site or the web site you are planning to publish the service to it.
Add application... Enter an Alias ex. "MyWebService" ... Choose the physical path. in my case was C:\inetpub\wwwroot\MyWebService which is my default web site path.
Then when you publish through Visual Studio choose that folder. or just copy your code files to it.
I'm fairly certain this is just a summary of what Glenn said, but I ran into this issue because my application was created from the directory one level too high in the directory structure.
For example, my web service was in SiteProject_1/SiteProject_2/service.asmx
Originally SiteProject_1 was what I converted into the application within IIS. I was able to resolve the issue by removing that application within IIS and instead making SiteProject_2 into the application.
I was having this problem this morning and Google landed me here, but none of these answers worked for me. But I did figure out what was wrong - at least in my case - so I thought I'd share it in case it helps others.
I had a web service that had been working fine for months in a solution with other parts of the application that I work on. Yesterday, I needed to fix something in a release branch, so I opened Visual Studio on a copy of the solution in another directory. Visual Studio decided to be helpful and silently remap all my virtual directories in IIS to where the programs would be in the release folder (if I had bothered to build them, which I hadn't). Now when I tried to hit my web service, IIS was pointing to the release version which had the asmx but no bin folder.
Opening the Web properties tab in my development solution and clicking the Create Virtual Directory remapped it back to the development version and all was good with the world again.

Categories

Resources