I have 3 projects- Main Project, Project A and Project B. I have added reference to both A & B inside Main project. Now, if i make ajax call from Main project to say Project A (web service project), how would my url look like? I have tried using localhost, but i ran into CORS issue. So, is there any solution for that? thnks.
var url = '../ProjectA/someService.asmx?op=Action';
Related
I have two projects of Web API and Windows Forms App under one solution.
The names are:
Solution - CliendAddress
Web API - ClientAddress
WFA - ClientAddressWFA
In the ClientAddress project there is a class called ServiceResponse. How can I use this ServiceResponse class in my project ClientAddressWFA?
From my ClientAddressWFA, I've already added the reference to ClientAddress ๐
However, when I am trying to add using ClientAddress.Models; (<---- This is where the ServiceResponse class is) in my ClientAddress.WFA project, I'm getting an error๐
Recording: https://screenrec.com/share/XTp0dwbI42
If you need just this one source file then you can just add it to the other project "as link". Quick and dirty, but who cares. However, if you need more classes, then make a shared library project that would then be referenced by both projects. That's what shared libraries are for.
So, in project ClientAddressWFA try to add this one .cs file but instead of clicking "Add" click on small triangle next to "Add", and select "Add As Link".
Sometimes just restarting the visual studio and compiling again will work (Given that class you are referencing from another project is public and you have added project reference)
I used a decompiler to retrieve lost source code for a set of web services written long ago. I want to debug the retrieved web methods using an existing web forms project. The two projects my solution contains are: 1) The recovered web services project and 2) The calling web forms project (created years ago) that references the live web services.
I created a project reference from the web forms project to the new web service project. My goal is make temporary changes in the calling code to allow me to step into each WebMethod using the project reference instead of the live web service reference. I'm hoping to debug the WebMethods as if I was debugging a standard class library.
The problem is that none of the WebMethods are visible using the project reference. Only the containing class is visible in the calling project but none of the Public Subs or Functions show via intellisense. How can I debug these WebMethods using the existing calling code from the web forms project?
Here is one of the simpler calling routines:
Private Sub LoadCountryCode()
Dim liveWebService As New EPriceBookWebService.Service1SoapClient
'Next line TEMPORARILY commented out for testing...
'liveWebService.GetCustomerCountry(lstbxCusCodes.SelectedValue, _countryCode)
'Project reference below shows only the web service class, not the contained public methods via intellisene. WHY?
EPriceBookService.EPriceBookService.
End Sub
Here is the stub of the WebMethod() being called:
<WebMethod()>
Public Sub GetCustomerCountry(ByVal CusCode As String, ByRef CountryCode As String)
I'm answering my own question here...
It was unwise for me to use a project reference to debug a web service project. Instead, I've learned how to debug the web service project from the calling web forms project (directly stepping into the code). To do this I made use of an obscure setting in the web service project called "Don't open a page. Wait for a request from an external application." You can turn on this setting from the project property pages under the Web category. I learned about the setting here and here.
My two projects are in the same solution. The web forms project now references two web services 1) the live web service and 2) the localhost web service in my solution. I've added compiler (preprocessor) directives to the web forms project telling it which web service reference to use.
#If DEBUG Then
Dim theWebService As New localhostEPricebookWebReference.EPriceBookService
#Else
Dim theWebService As New EPriceBookWebService.Service1SoapClient
#End If
Be sure you turn off debug mode before deploying your application.
I have an MVC Area in a second Project (part of a different solution) and I cannot seem to find any way of accessing its Static Content when running my website.
Project 1 contains a normal MVC application which works fine.
Project 2 contains simply an Area. Project 2 is using RazorGenerator to compile the views, this project is referenced by Project 1 and is not in the same solution.
In Project 2 within my Area is a Content Folder with static images and styles. How can I get the main website to serve this content? I presume that I cannot because RazorGenerator is not able to compile non code files.
http://forums.asp.net/t/1534837.aspx?Static+content+in+Areas
In articles like above people simply manipulate the URL but this is not working for me, I get 404 for all because its not in the same solution.
How can I get this static content in Project 2 to be accessible to Project 1 given that I am using RazorGenerator to compile my views? I am aiming to make a self contained Area that I can add to other projects without needing to copy files over to support it.
I need to create a stand alone EXE of a solution. This solution contains two projects i.e:
A-project (set up as start)
B-project (A web services)
B-project uses a external DLL which is reside on same B-project folder.
Above solution runs perfectly after building it. Now i want to create a stand alone EXE. So that i can sell my product for commercial use (in my school).
To do this i have performed following points:
Add a new project(SETUP Project) in the solution with test name.
Now add project output and choose A-project from the project drop down.
Then i do the same for the B-project i.e. Add project output and choose B-project from the project drop down.
Check the .net framework 4 dependencies which was fine.
Build it.
Install it.
I went to the my program files directory and run test.exe with run as administrator, and try to open the web services URL.
I got to know that web services runs perfectly but when i enter the url it returns me Request error which happens when the method written in instance class didn't execute perfectly. In my project the method written in Instance classcalled the externall dll.
How should i link that dll with my EXE. so that it runs perfectly fine?
Should i change the path in code?
If you want to deploy one .EXE:
Add the dll that the Project B depend on as a Resource (right click on Add existing Item -> Select dll -> change build action to Embedded resources)
Do the same with Project A and Project B (i.e add them to your Setup.exe as Resources)
Then you need to implement the solution described here
Is it possible to redirect from one page in Project A to page in Project B with in same solution.Here the Project A is in C# and Project B In VB.
Is it possible? If so, can anyone then tell me of any issues.
You'd have to let project A know the base URL under which project B is running, probably via a setting in the Web.config file. There's no simple shortcut way just because they're in the same solution.