I have a SilverLight application that uses a Linq-to-SQL service refrence. My service refrence is located at http://localhost:1832/PositionService.svc
When I start my project as a SharePoint Web Part this service is not a part of the SharePoint module. So it is not accessable because only the ".xap"-file is uploaded to SharePoint.
Can anyone give hints or help out in my problem?
When you upload the .xap, you should still be able to access the service but you have to make sure that the SharePoint user account has permission to access the service and you also have to add any necessary configurations settings, such as assemblies to be loaded and other, to Sharepoint-80 web.config file.
Related
I have the basic blazor project that im trying to host in a specific way. I have managed to host the app in IIS where all the files were in the same folder. The issue im having is the web config in the root folder and then having the actual app itself in a subfolder.
IIS app file structure
im using blazor server which is sitting the "test" folder.
test folder where the blazor app is, seperate to the web config
Is this even possible to host in this way? or is there routing or config that needs to be done to get it to work?
Thanks,
So far I'm afraid it is unavailable to host application in site level. No matter I set the aspnet core handler in root level or folder level, change location value,change processPath. IIS just ignore the attribute even I have set it in both root level and folder level.
I think even you were able to host blazor in a sub-folder, Duplicate attribute verification is easy to crash the application when you need to publish something in root folder.
So the best way to handle this is convert test folder to an application. Then everything get isolated and start working.
interesting idea
I see no reason, why not to create a sub directory as website in iis. There have to be a extra app pool unmanaged for each.
I have selected an Empty ASP.NET WebApp just to add a simple WebService 1.1 to in.
I can run my web service and see it working in the IE browser so my question is what is Virtual Directory for and do I even need it?
You don't need to have a virtual directory or a web application specific to your webservice. However, consider that your ASP.NET website or webservice is an application and requires an application pool to run in within IIS (or Cassini). Therefore, you need to make either the folder containing the webservice files or its parent a web application.
For example:
if your web service is hosted in such a disk folder:
C:\Inetpub\Wwwroot\Foo\Folder1\WebService\ASMX\MyGreatService.asmx
Any of these levels could be a web application:
C:\Inetpub\Wwwroot\Foo\Folder1\WebService\ASMX\
C:\Inetpub\Wwwroot\Foo\Folder1\WebService\
C:\Inetpub\Wwwroot\Foo\Folder1\
C:\Inetpub\Wwwroot\Foo\
(you get the picture...)
If you are doing this through IIS, when you create your website in IIS, it will automatically turn your top level directory into a web application. For example, if you create a website with its root folder at C:\Inetpub\Wwwroot\Foo\, that folder will already be a web application for you. To change any particular subfolder into its own web application, simply right-click on the folder you want to convert and select "Convert to Application".
For more details, I would refer you to the following articles:
IIS: Understanding Sites, Applications and Virtual Directories
IIS 7.0: Create and configure Virtual Directories
Web Application Vs. Virtual Directory
One of my folder is reside in local network or local machine for upload and display attachments. I can not manage (upload or display) this in MVC 4.0, ASP.NET. For that I wrote path in appsetting of web.config. Please guide me how to manage it.
Simply having the path recorded and used does not mean that the application has the permissions to access it.
You need to ensure that the account that the web application runs under has the permissions to access this folder (the account details will be in the properties of the web server application pool that is setup for the site).
try to:
create a Site mapped on your attachments folder
In your project, add two AppSettings: AttachmentAbsoluteUrl, AttachmentFullname
When you have to download an attachment, you can use the Url defined in the AttachmentAbsoluteUrl AppSettings Key, when you have to upload/delete/add, use the AttachmentFullname key.
In this way you can manage both development and production environments, using different AppSettings values.
For example, in my local computer, I have the Attachments folder in the same directory of the project, in production server, I have a different folder outside the Site directory.
You have to check if the Identity of the Application Pool used by your Web application have the rights to modify the contents of the Attachments folder.
I hope this can help you
I have developed a WCF service which uses the net.tcp binding and read and write files to the file system. When I start the windows service (in a console) I get following error even if the sample.dll is in the folder:
Unable to find assembly file sample.dll
This specific WCF service is hosted in a windows service which runs on windows 7 64bit and I have following questions:
Which account should I use for my application:
User / NetworkService / LocalSystem / LocalService
And why can’t the OS load the dll even if it is there?
Thank you in advance for your help!
For the dll you should add the following line of code right at the beginning of the OnStart method.
System.Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory
That should allow your service to load dlls from the actual directory.
According to the MSDN documentation on the ServiceAccount, the User member prompts for a username and password. I'd guess that if you're using the User account and it doesn't have read permissions for windows/system32, that would result in your assembly failing to be found.
Perhaps change the ServiceAccount up a step to a LocalService?
I have a WSDL file on disk and loaded as a web reference. The problem is that the web reference itself is looking for the WSDL on my machine (using an absolute path), which obviously won't work on teammates' machines.
Is it possible to have the web reference look for the WSDL with a relative path, or from the Resources file? The WSDL is for a third-party service that we've modified to add some extra fields (per their recommendation).
When you add a service reference to the WSDL file on your machine, it gets copied into your "Service References" folder in your project. At that point, the API for your service is determined. There is a "Reference.svcmap" (XML) that is created that holds the location of the original location of the WSDL file. This is so that you can update the service reference in your project if the API changes. But, even without having that original WSDL file you can check in the code and your team can use it without issue. But, if you want them to be able to update the service if the API changes, then you need to actually host that WSDL file in a publicly accessible place. Usually, the web service itself provides the WSDL file and you wouldn't have it on your file system. If you plan to update and change the web service, you should connect to the WSDL hosted on a development web server. That's really where it belongs, and not a local file. But, there's no reason your local file reference wouldn't work just fine until someone tried to update it. If your web service never changes, you've got no problem. If it could change, then host it somewhere and reference a real URL.
My initial testing of tweaking the XML in Reference.svcmap file to try for relative path references did not work, but if you decide you really want to get this to work as your question describes, this is the place to make your attempt.
My suggestion would be to create a programmatic proxy using the cmd line tool wsdl.exe or svcutil.exe to create the .cs or .vb proxy that you could then add to the solution.
This allows for not needing the wsdl file at all. See more information on how here for .NET 2.0 http://msdn.microsoft.com/en-us/library/7h3ystb6(v=vs.80).aspx
for .NET 3.5 or later and svcutil look here: http://msdn.microsoft.com/en-us/library/aa751905.aspx